Bug 238102

Summary: [cssom] border-image not serialized at specified-value time
Product: WebKit Reporter: Oriol Brufau <obrufau>
Component: CSSAssignee: Oriol Brufau <obrufau>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, darin, ericwilligers, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, koivisto, macpherson, menard, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/33267
Bug Depends on:    
Bug Blocks: 237487    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

Description Oriol Brufau 2022-03-18 15:59:42 PDT
Run this:

    document.body.style.borderImage = 'url("") 10 / 20 / 30 round';
    
    document.body.style.borderImage;
    // Expected: 'url("") 10 / 20 / 30 round'
    // Actual: ''
    
    document.body.style.cssText;
    // Expected: 'border-image: url("") 10 / 20 / 30 round'
    // Actual: 'border-image-source: url(""); border-image-slice: 10; border-image-width: 20; border-image-outset: 30; border-image-repeat: round;'
Comment 1 Oriol Brufau 2022-03-18 16:21:39 PDT
Created attachment 455147 [details]
Patch
Comment 2 EWS Watchlist 2022-03-18 16:23:33 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Oriol Brufau 2022-03-18 16:38:24 PDT
Created attachment 455150 [details]
Patch
Comment 4 Oriol Brufau 2022-03-19 15:11:27 PDT
PTAL
Comment 5 Darin Adler 2022-03-19 17:58:06 PDT
Comment on attachment 455150 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=455150&action=review

> Source/WebCore/css/StyleProperties.cpp:952
> +            result.append(" / ");

It’s more efficient to append multiple strings in a single append call, less string buffer growing computation. So the separator could go into a local variable, and then:

    result.append(separator, valueText);

Just make sure to set separator to “” when one is not needed. In fact if we use a variable outside the loop, we can also avoid the result.isEmpty check.

    auto separator = “”;
    for … {
        …
        result.append(separator, valueText);
        separator = “ “;
    }
Comment 6 Oriol Brufau 2022-03-19 18:39:53 PDT
Created attachment 455184 [details]
Patch
Comment 7 EWS 2022-03-19 20:19:17 PDT
Committed r291537 (248643@main): <https://commits.webkit.org/248643@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455184 [details].
Comment 8 Radar WebKit Bug Importer 2022-03-19 20:20:21 PDT
<rdar://problem/90531782>
Comment 9 Alexey Proskuryakov 2022-08-16 18:31:31 PDT
*** Bug 183993 has been marked as a duplicate of this bug. ***