WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
226694
Handle custom identifiers and strings separately, so we can quote strings correctly consistently
https://bugs.webkit.org/show_bug.cgi?id=226694
Summary
Handle custom identifiers and strings separately, so we can quote strings cor...
Darin Adler
Reported
2021-06-05 23:01:00 PDT
Handle custom identifiers and strings separately, so we can quote strings correctly consistently
Attachments
Patch
(135.81 KB, patch)
2021-06-05 23:52 PDT
,
Darin Adler
sam
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(136.81 KB, patch)
2021-06-06 15:36 PDT
,
Darin Adler
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Darin Adler
Comment 1
2021-06-05 23:52:13 PDT
Created
attachment 430678
[details]
Patch
Darin Adler
Comment 2
2021-06-05 23:55:11 PDT
Tried to cc people who might be interested in work in this area. There is so much we can do to simplify our CSS object model implementation, but this correctness change is more important than that since it’s causing us to be different from the other browsers and fail WPT tests.
Sam Weinig
Comment 3
2021-06-06 13:32:48 PDT
Comment on
attachment 430678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430678&action=review
> Source/WebCore/animation/CSSAnimation.cpp:51 > - , m_animationName(backingAnimation.name()) > + , m_animationName(backingAnimation.name().string)
In the future we should see if m_animationName is necessary given the base class holds onto the backingAnimation and could pull the string from there.
> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3426 > + for (size_t i = 0; i < t->size(); ++i) {
Would probably be a good idea for AnimationList to have an animations() function that return an IteratorRange<> (or just the underlying Vector) at some point to avoid this.
> Source/WebCore/css/CSSUnits.h:71 > + CustomIdent,
Daring, I like it!
Darin Adler
Comment 4
2021-06-06 15:09:14 PDT
Comment on
attachment 430678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430678&action=review
>> Source/WebCore/animation/CSSAnimation.cpp:51 >> + , m_animationName(backingAnimation.name().string) > > In the future we should see if m_animationName is necessary given the base class holds onto the backingAnimation and could pull the string from there.
That’s a really good point. Seems like it is not. I am torn about what to pursue next. Further cleanup of things I encountered here like this would be great. The mission that led me here, though, was finding easy ways to pass a lot more WPT, and I was trying to start with counter-list-style improvements, which led me to this work.
>> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3426 >> + for (size_t i = 0; i < t->size(); ++i) { > > Would probably be a good idea for AnimationList to have an animations() function that return an IteratorRange<> (or just the underlying Vector) at some point to avoid this.
Absolutely! Well worth it.
>> Source/WebCore/css/CSSUnits.h:71 >> + CustomIdent, > > Daring, I like it!
Took a lot of discipline for me to not rename everything in the class right now. This code needs to be changed a lot more to be good long term.
Darin Adler
Comment 5
2021-06-06 15:36:59 PDT
Created
attachment 430700
[details]
Patch
Darin Adler
Comment 6
2021-06-06 15:42:16 PDT
Comment on
attachment 430678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430678&action=review
>>> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3426 >>> + for (size_t i = 0; i < t->size(); ++i) { >> >> Would probably be a good idea for AnimationList to have an animations() function that return an IteratorRange<> (or just the underlying Vector) at some point to avoid this. > > Absolutely! Well worth it.
I think the best idea here is to make AnimationList derive from Vector instead of holding one. This really just is a Vector with reference counting and one special function "fillUnsetProperties". Or maybe we can use use RefCountedArray instead of a Vector. Unsure how often these are resized.
Darin Adler
Comment 7
2021-06-06 15:46:22 PDT
Comment on
attachment 430678
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430678&action=review
>>>> Source/WebCore/css/CSSComputedStyleDeclaration.cpp:3426 >>>> + for (size_t i = 0; i < t->size(); ++i) { >>> >>> Would probably be a good idea for AnimationList to have an animations() function that return an IteratorRange<> (or just the underlying Vector) at some point to avoid this. >> >> Absolutely! Well worth it. > > I think the best idea here is to make AnimationList derive from Vector instead of holding one. This really just is a Vector with reference counting and one special function "fillUnsetProperties". Or maybe we can use use RefCountedArray instead of a Vector. Unsure how often these are resized.
To make this call site work as a modern for loop, all we’d have to do is add AnimationList::begin/end.
Darin Adler
Comment 8
2021-06-06 19:39:43 PDT
Committed
r278540
(
238538@main
): <
https://commits.webkit.org/238538@main
>
Radar WebKit Bug Importer
Comment 9
2021-06-06 19:40:16 PDT
<
rdar://problem/78931824
>
Sam Sneddon [:gsnedders]
Comment 10
2021-06-07 05:23:54 PDT
(In reply to Darin Adler from
comment #2
)
> Tried to cc people who might be interested in work in this area. There is so > much we can do to simplify our CSS object model implementation, but this > correctness change is more important than that since it’s causing us to be > different from the other browsers and fail WPT tests.
Yay! To check I'm understanding code I don't actually know(!): The reason why we have a separate CSSUnitType::CustomIdent to CSSUnitType::CSS_IDENT is because we effectively split CSS_IDENT up into smaller categories (with CSS_VALUE_ID and CSS_PROPERTY_ID too)?
Darin Adler
Comment 11
2021-06-07 16:10:37 PDT
(In reply to Sam Sneddon [:gsnedders] from
comment #10
)
> The reason why we have a separate CSSUnitType::CustomIdent to > CSSUnitType::CSS_IDENT is because we effectively split CSS_IDENT up into > smaller categories (with CSS_VALUE_ID and CSS_PROPERTY_ID too)?
That’s right. If we clean this up a bit, I’m not sure we will CSS_IDENT itself at all. The actual web-exposed CSS unit numbers are not using CSSUnitType; it’s entirely an internal concept. We should really separate the numeric types which are used for calculations, and conversion from one numeric type to another, from the other types that just let the internal primitive values hold the different sorts of values. And there’s no need for either of those to be a single enumeration that is exposed.
Oriol Brufau
Comment 12
2021-06-09 05:27:09 PDT
***
Bug 204506
has been marked as a duplicate of this bug. ***
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