WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
235222
Setting `content: normal` on a ::marker should make computed style return resolved values
https://bugs.webkit.org/show_bug.cgi?id=235222
Summary
Setting `content: normal` on a ::marker should make computed style return res...
Antoine Quint
Reported
2022-01-14 00:40:33 PST
Setting `content: normal` on a ::marker should make computed style return resolved values
Attachments
Patch
(10.25 KB, patch)
2022-01-14 00:48 PST
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch
(12.02 KB, patch)
2022-01-14 02:27 PST
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch
(13.60 KB, patch)
2022-01-14 12:02 PST
,
Antoine Quint
no flags
Details
Formatted Diff
Diff
Patch
(13.46 KB, patch)
2022-01-14 13:09 PST
,
Antoine Quint
akeerthi
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Antoine Quint
Comment 1
2022-01-14 00:48:49 PST
Created
attachment 449145
[details]
Patch
Antoine Quint
Comment 2
2022-01-14 02:27:47 PST
Created
attachment 449153
[details]
Patch
Antti Koivisto
Comment 3
2022-01-14 05:20:29 PST
Comment on
attachment 449153
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=449153&action=review
> Source/WebCore/rendering/style/RenderStyle.h:1474 > + bool hasContentNone() const { return m_nonInheritedFlags.hasExplicitlyClearedContent || styleType() == PseudoId::Before || styleType() == PseudoId::After; }
Not quite following the logic of this patch. Like any ::before/after has content:none?
> Source/WebCore/style/StyleBuilderCustom.h:1524 > + auto isEquivalentToNone = builderState.style().styleType() == PseudoId::Before || builderState.style().styleType() == PseudoId::After; > + builderState.style().setHasExplicitlyClearedContent(isEquivalentToNone);
Seems like the flag should have a new name but I'm not sure what that would be (because above).
Antoine Quint
Comment 4
2022-01-14 07:19:12 PST
(In reply to Antti Koivisto from
comment #3
)
> Comment on
attachment 449153
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=449153&action=review
> > > Source/WebCore/rendering/style/RenderStyle.h:1474 > > + bool hasContentNone() const { return m_nonInheritedFlags.hasExplicitlyClearedContent || styleType() == PseudoId::Before || styleType() == PseudoId::After; } > > Not quite following the logic of this patch. Like any ::before/after has > content:none?
No, that's just wrong, it should be checking for hasContent() as well. I'll fix this.
> > Source/WebCore/style/StyleBuilderCustom.h:1524 > > + auto isEquivalentToNone = builderState.style().styleType() == PseudoId::Before || builderState.style().styleType() == PseudoId::After; > > + builderState.style().setHasExplicitlyClearedContent(isEquivalentToNone); > > Seems like the flag should have a new name but I'm not sure what that would > be (because above).
It should probably be: setHasContentNone() I think. I'll modify it.
Antoine Quint
Comment 5
2022-01-14 12:02:48 PST
Created
attachment 449196
[details]
Patch
Aditya Keerthi
Comment 6
2022-01-14 12:54:19 PST
Comment on
attachment 449196
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=449196&action=review
> Source/WebCore/rendering/style/RenderStyle.h:1474 > + bool hasContentNone() const { return !contentData() && (m_nonInheritedFlags.hasContentNone || styleType() == PseudoId::Before || styleType() == PseudoId::After); }
I'm concerned the method name is potentially inaccurate. I understand that the `PseudoId::Before` and `PseudoId::After` checks are because the spec says "normal: For ::before and ::after, this computes to none." But the specified value is not none. I would name this method `hasEffectiveContentNone` or something similar to indicate this is speaking to the computed value.
> Source/WebCore/rendering/style/RenderStyle.h:1475 > + bool hasContentNormal() const { return !contentData() && !hasContentNone(); }
If we decide to go with the "effective" naming scheme above, this method no longer makes sense without also being renamed. But "effective" doesn't work here either, because "content: normal" could also compute to "contents". Since it only has one call site, I would remove the method entirely. Then, in RenderThemeIOS, update the condition to `return style.hasContent() || style.hasEffectiveContentNone()`).
Antoine Quint
Comment 7
2022-01-14 13:04:08 PST
(In reply to Aditya Keerthi from
comment #6
)
> Comment on
attachment 449196
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=449196&action=review
> > > Source/WebCore/rendering/style/RenderStyle.h:1474 > > + bool hasContentNone() const { return !contentData() && (m_nonInheritedFlags.hasContentNone || styleType() == PseudoId::Before || styleType() == PseudoId::After); } > > I'm concerned the method name is potentially inaccurate. > > I understand that the `PseudoId::Before` and `PseudoId::After` checks are > because the spec says "normal: For ::before and ::after, this computes to > none." > > But the specified value is not none. I would name this method > `hasEffectiveContentNone` or something similar to indicate this is speaking > to the computed value. > > > Source/WebCore/rendering/style/RenderStyle.h:1475 > > + bool hasContentNormal() const { return !contentData() && !hasContentNone(); } > > If we decide to go with the "effective" naming scheme above, this method no > longer makes sense without also being renamed. But "effective" doesn't work > here either, because "content: normal" could also compute to "contents". > > Since it only has one call site, I would remove the method entirely. Then, > in RenderThemeIOS, update the condition to `return style.hasContent() || > style.hasEffectiveContentNone()`).
Good points, I'll update the patch to do this.
Antoine Quint
Comment 8
2022-01-14 13:09:23 PST
Created
attachment 449211
[details]
Patch
EWS
Comment 9
2022-01-15 05:26:52 PST
/Volumes/Data/worker/Commit-Queue/build/LayoutTests/imported/w3c/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).
Antoine Quint
Comment 10
2022-01-15 05:32:20 PST
Committed
r288054
(?): <
https://commits.webkit.org/r288054
>
Radar WebKit Bug Importer
Comment 11
2022-01-15 05:33:16 PST
<
rdar://problem/87637233
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug