Bug 215409 - getPropertyValue for url path doesn't return the "#" character
Summary: getPropertyValue for url path doesn't return the "#" character
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 13
Hardware: Mac macOS 10.15
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-12 03:59 PDT by Thien
Modified: 2021-05-03 03:56 PDT (History)
13 users (show)

See Also:


Attachments
Patch (3.13 KB, patch)
2021-05-01 06:06 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.85 KB, patch)
2021-05-02 04:00 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (2.55 KB, patch)
2021-05-03 00:59 PDT, Rob Buis
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thien 2020-08-12 03:59:09 PDT
When calling getPropertyValue of a property that is a url(...) pointing to another element (common in SVG), the result is returned without the "#" part.

For example, the CSS:

```
marker-mid: url(#dot)
```

The returned string in:
- Firefox 79: "url(#dot)"
- Chrome 84: "url(#dot)"
- Safari 13: "url(dot)"

Demo: https://codesandbox.io/s/modest-moon-z98tr?file=/index.html
Comment 1 Radar WebKit Bug Importer 2020-08-12 11:00:12 PDT
<rdar://problem/66919778>
Comment 2 Rob Buis 2021-05-01 06:06:28 PDT
Created attachment 427495 [details]
Patch
Comment 3 Rob Buis 2021-05-02 04:00:32 PDT
Created attachment 427523 [details]
Patch
Comment 4 EWS 2021-05-02 12:08:40 PDT
Committed r276888 (237234@main): <https://commits.webkit.org/237234@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427523 [details].
Comment 5 Darin Adler 2021-05-02 17:52:46 PDT
Comment on attachment 427523 [details]
Patch

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

> Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp:125
> +            return CSSPrimitiveValue::create(makeString('#', svgStyle.maskerResource()), CSSUnitType::CSS_URI);

More efficient because it uses '#'.

> Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp:139
> +            return CSSPrimitiveValue::create(makeString("#", svgStyle.markerEndResource()), CSSUnitType::CSS_URI);

Slightly less efficient because it uses "#". Should be consistent.
Comment 6 Rob Buis 2021-05-03 00:59:52 PDT
Reopening to attach new patch.
Comment 7 Rob Buis 2021-05-03 00:59:55 PDT
Created attachment 427542 [details]
Patch
Comment 8 Rob Buis 2021-05-03 02:07:13 PDT
Comment on attachment 427523 [details]
Patch

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

>> Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp:125
>> +            return CSSPrimitiveValue::create(makeString('#', svgStyle.maskerResource()), CSSUnitType::CSS_URI);
> 
> More efficient because it uses '#'.

I see.

>> Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp:139
>> +            return CSSPrimitiveValue::create(makeString("#", svgStyle.markerEndResource()), CSSUnitType::CSS_URI);
> 
> Slightly less efficient because it uses "#". Should be consistent.

I intended to at least be consistent but failed there, so I made a fix-up patch.
Comment 9 EWS 2021-05-03 02:24:43 PDT
Committed r276894 (237240@main): <https://commits.webkit.org/237240@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427542 [details].