Bug 133609

Summary: CSS JIT: Reflect parent fragment's relations to sub fragments
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: CSSAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, buildbot, bunhere, cdumez, commit-queue, gyuyoung.kim, rniwa, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2
none
Patch
none
Patch none

Yusuke Suzuki
Reported 2014-06-07 12:26:41 PDT
Since some predicates use relationToRightFragment, reflecting parent fragment's relations to sub fragments is needed.
Attachments
Patch (2.89 KB, patch)
2014-06-07 12:27 PDT, Yusuke Suzuki
no flags
Patch (12.41 KB, patch)
2014-06-08 01:27 PDT, Yusuke Suzuki
no flags
Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 (631.75 KB, application/zip)
2014-06-08 03:31 PDT, Build Bot
no flags
Patch (16.83 KB, patch)
2014-06-24 14:17 PDT, Yusuke Suzuki
no flags
Patch (17.10 KB, patch)
2014-06-24 15:07 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2014-06-07 12:27:58 PDT
WebKit Commit Bot
Comment 2 2014-06-07 12:29:51 PDT
Attachment 232667 [details] did not pass style-queue: ERROR: Source/WebCore/ChangeLog:12: You should remove the 'No new tests' and either add and list tests, or explain why no new tests were possible. [changelog/nonewtests] [5] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yusuke Suzuki
Comment 3 2014-06-07 12:30:09 PDT
Comment on attachment 232667 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232667&action=review > Source/WebCore/cssjit/SelectorCompiler.cpp:618 > + // To make it works correctly, Reflect fragment's relations to sub fragments. For example, `generateElementIsActive` uses it.
Yusuke Suzuki
Comment 4 2014-06-07 12:30:55 PDT
Some tests are needed. I'll add it later.
Yusuke Suzuki
Comment 5 2014-06-07 12:37:16 PDT
Hmm, now I have no idea about how to test it. I need to investigate it more.
Benjamin Poulain
Comment 6 2014-06-07 16:44:17 PDT
Comment on attachment 232667 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232667&action=review Good catch! It is a shame not a single test caught that bug. I think this needs test so that such issue never happen again. The filters :active and :hover are probably harder to test for this. The filters ":first-child", ":last-child" and ":nth-child" would be easier to test. Something like this might work for testing: -have a bunch of sibling elements. -use one of the functional pseudo class on the rightmost selector with one of the marking filters (let's say :first-child for example). -test the style. -move the order of the elements programmatically. -test the style again. If the elements share the style because "flagIsUnique" is not set, you should be able to get the wrong style. > Source/WebCore/ChangeLog:12 > + No new tests (OOPS!). We you have no test, you need to remove this line to be able to land a patch. >> Source/WebCore/cssjit/SelectorCompiler.cpp:618 >> + // Some non-backtrack-related predicates use relationToRightFragment information to decide whether checkingContext->elementStyle should be refered. >> + // To make it works correctly, Reflect fragment's relations to sub fragments. > > For example, `generateElementIsActive` uses it. This works but I am afraid it is not future proof. It is very likely that functional pseudo class will support relation in the future. Let's add a boolean on SelectorFragment instead. Maybe "isRightmost" or something like that?
Yusuke Suzuki
Comment 7 2014-06-08 01:24:09 PDT
Comment on attachment 232667 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=232667&action=review >> Source/WebCore/ChangeLog:12 >> + No new tests (OOPS!). > > We you have no test, you need to remove this line to be able to land a patch. OK, so in the meantime, remove this. >>> Source/WebCore/cssjit/SelectorCompiler.cpp:618 >>> + // To make it works correctly, Reflect fragment's relations to sub fragments. >> >> For example, `generateElementIsActive` uses it. > > This works but I am afraid it is not future proof. It is very likely that functional pseudo class will support relation in the future. > Let's add a boolean on SelectorFragment instead. Maybe "isRightmost" or something like that? That's nice. So I'll add flag to constructFragments and field to SelectorFragment. It represents that where this fragment is in root fragment list.
Yusuke Suzuki
Comment 8 2014-06-08 01:27:02 PDT
Build Bot
Comment 9 2014-06-08 03:31:17 PDT
Comment on attachment 232682 [details] Patch Attachment 232682 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/6333817916751872 New failing tests: media/W3C/video/networkState/networkState_during_loadstart.html
Build Bot
Comment 10 2014-06-08 03:31:20 PDT
Created attachment 232683 [details] Archive of layout-test-results from webkit-ews-09 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-09 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Yusuke Suzuki
Comment 11 2014-06-08 10:33:06 PDT
Ah, I've missed your overall comment. > Something like this might work for testing: > -have a bunch of sibling elements. > -use one of the functional pseudo class on the rightmost selector with one of the marking filters (let's say :first-child for example). > -test the style. > -move the order of the elements programmatically. > -test the style again. I'll add tests!
Yusuke Suzuki
Comment 12 2014-06-24 14:17:43 PDT
Benjamin Poulain
Comment 13 2014-06-24 14:55:12 PDT
Comment on attachment 233740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=233740&action=review > Source/WebCore/cssjit/SelectorCompiler.cpp:345 > +static inline bool isRightmostInRootFragments(const SelectorFragment& fragment) > +{ > + return fragment.relationToRightFragment == FragmentRelation::Rightmost && fragment.positionInRootFragments == FragmentPositionInRootFragments::Rightmost; > +} I would rename this by how it is used for code generation. Maybe: shouldUseRenderStyleFromCheckingContext()?
Yusuke Suzuki
Comment 14 2014-06-24 15:07:01 PDT
WebKit Commit Bot
Comment 15 2014-06-24 15:57:06 PDT
Comment on attachment 233747 [details] Patch Clearing flags on attachment: 233747 Committed r170398: <http://trac.webkit.org/changeset/170398>
WebKit Commit Bot
Comment 16 2014-06-24 15:57:12 PDT
All reviewed patches have been landed. Closing bug.
Ryosuke Niwa
Comment 17 2014-06-24 17:22:13 PDT
Benjamin Poulain
Comment 18 2014-06-24 17:41:24 PDT
(In reply to comment #17) > It looks like this patch broke a bunch of transitions tests: > http://build.webkit.org/results/Apple%20Mavericks%20Release%20WK1%20(Tests)/r170398%20(6904)/results.html I looked into those tests, I believe it is unrelated.
Note You need to log in before you can comment on or make changes to this bug.