WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
111252
Merge SelectorCheckingContext into SelectorChecker.
https://bugs.webkit.org/show_bug.cgi?id=111252
Summary
Merge SelectorCheckingContext into SelectorChecker.
Dimitri Glazkov (Google)
Reported
2013-03-02 09:36:57 PST
Merge SelectorCheckingContext into SelectorChecker.
Attachments
WIP
(38.12 KB, patch)
2013-03-02 09:45 PST
,
Dimitri Glazkov (Google)
no flags
Details
Formatted Diff
Diff
Patch
(38.10 KB, patch)
2013-03-02 13:25 PST
,
Dimitri Glazkov (Google)
buildbot
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Dimitri Glazkov (Google)
Comment 1
2013-03-02 09:45:39 PST
Created
attachment 191108
[details]
WIP
Dimitri Glazkov (Google)
Comment 2
2013-03-02 13:25:58 PST
Created
attachment 191117
[details]
Patch
Build Bot
Comment 3
2013-03-02 14:40:38 PST
Comment on
attachment 191117
[details]
Patch
Attachment 191117
[details]
did not pass mac-ews (mac): Output:
http://webkit-commit-queue.appspot.com/results/16797731
New failing tests: editing/selection/selection-invalid-offset.html
Eric Seidel (no email)
Comment 4
2013-03-05 12:25:09 PST
I thought I wrote up comments for this patch, but they must have not sent. I'm slightly surprised to see this, since SelecorChecker (and many of the style classes) could just be static and operate on context objets. That appears to be someone's eariler goal here. That said, It's OK for the logic and state to live in a single stack allocated class. I assume you were the person who did the split before?
Antti Koivisto
Comment 5
2013-03-05 12:36:16 PST
Comment on
attachment 191117
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=191117&action=review
> Source/WebCore/css/StyleResolver.cpp:2118 > - SelectorChecker selectorChecker(document(), state.mode()); > - SelectorChecker::SelectorCheckingContext context(ruleData.selector(), state.element(), SelectorChecker::VisitedMatchEnabled); > - context.elementStyle = state.style(); > - context.scope = scope; > - context.pseudoId = state.pseudoStyleRequest().pseudoId; > - context.scrollbar = state.pseudoStyleRequest().scrollbar; > - context.scrollbarPart = state.pseudoStyleRequest().scrollbarPart; > - context.behaviorAtBoundary = behaviorAtBoundary; > - SelectorChecker::Match match = selectorChecker.match(context, dynamicPseudo, DOMSiblingTraversalStrategy()); > + SelectorChecker selectorChecker(ruleData.selector(), state.element(), state.mode(), SelectorChecker::VisitedMatchEnabled, state.style(), scope, state.pseudoStyleRequest().pseudoId, state.pseudoStyleRequest().scrollbar, state.pseudoStyleRequest().scrollbarPart, behaviorAtBoundary);
Wasn't the point of having a context object to avoid confusing and inflexible argument lists like this?
Dimitri Glazkov (Google)
Comment 6
2013-03-05 12:45:06 PST
(In reply to
comment #4
)
> I thought I wrote up comments for this patch, but they must have not sent. > > I'm slightly surprised to see this, since SelecorChecker (and many of the style classes) could just be static and operate on context objets. That appears to be someone's eariler goal here. > > That said, It's OK for the logic and state to live in a single stack allocated class. I assume you were the person who did the split before?
Roland did it a while back in
bug 77525
. Back then, SelectorChecker was a lot more than just an on-stack class. Since then, I whittled it down, and it seems to make little sense to have both of these. The const SelectorCheckerContext& param in front of all of SelectorChecker members even looks like a "this" ptr (if you pretend it's Python :)
Dimitri Glazkov (Google)
Comment 7
2013-03-05 12:48:18 PST
Comment on
attachment 191117
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=191117&action=review
>> Source/WebCore/css/StyleResolver.cpp:2118 >> + SelectorChecker selectorChecker(ruleData.selector(), state.element(), state.mode(), SelectorChecker::VisitedMatchEnabled, state.style(), scope, state.pseudoStyleRequest().pseudoId, state.pseudoStyleRequest().scrollbar, state.pseudoStyleRequest().scrollbarPart, behaviorAtBoundary); > > Wasn't the point of having a context object to avoid confusing and inflexible argument lists like this?
Ideally, SelectorChecker should just take State as a constructor: SelectorCheckt(ruleData.selector(), SelectorChecker::VisitedMatchEnabled, state); It's pretty nice logically -- convey the current resolver state into the selector checker. However, the way they are defined is a bit messy. StyleResolver.h needs SelectorChecker.h to pull in some constants. I was thinking of moving them into a separate header, and then it'll be pretty.
Dimitri Glazkov (Google)
Comment 8
2013-03-05 12:58:45 PST
One other thing that might be useful: I was hoping to study the places where nested SelectorCheckers are created next, and: 1) defining better separation between nesting checkers and nested checkers (like, often the nesting checker messes with the nested checker, and that seems bad) 2) exploring selector checker only doing one thing (checking selectors) and some other class doing the thing of traversing the selector chain. If you have other cool ideas, let me know. This is my hobby hacking anyway :)
Antti Koivisto
Comment 9
2013-03-05 13:12:33 PST
(In reply to
comment #7
)
> Ideally, SelectorChecker should just take State as a constructor:
You mean StyleResolver::State? That doesn't seem correct. We don't want to have two-way dependency between these. SelectorChecker has clients that have nothing to do with StyleResolver.
Dimitri Glazkov (Google)
Comment 10
2013-03-05 13:34:01 PST
(In reply to
comment #9
)
> (In reply to
comment #7
) > > Ideally, SelectorChecker should just take State as a constructor: > > You mean StyleResolver::State? That doesn't seem correct. We don't want to have two-way dependency between these. SelectorChecker has clients that have nothing to do with StyleResolver.
Right (see the second half of
comment 7
). StyleResolver doesn't need to depend on SelectorChecker, so by moving a few enums, I can switch the dependency and have SelectorChecker depend on StyleResolver.
Benjamin Poulain
Comment 11
2014-12-25 22:40:32 PST
Closing, SelectorCheckingContext is irrelevant now.
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