Bug 135958 - CSS JIT: compile the :empty pseudo class
Summary: CSS JIT: compile the :empty pseudo class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-14 15:34 PDT by Benjamin Poulain
Modified: 2014-08-14 21:07 PDT (History)
5 users (show)

See Also:


Attachments
Patch (44.38 KB, patch)
2014-08-14 15:36 PDT, Benjamin Poulain
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-08-14 15:34:18 PDT
CSS JIT: compile the :empty pseudo class
Comment 1 Benjamin Poulain 2014-08-14 15:36:29 PDT
Created attachment 236629 [details]
Patch
Comment 2 WebKit Commit Bot 2014-08-14 15:38:32 PDT
Attachment 236629 [details] did not pass style-queue:


ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2527:  This { should be at the end of the previous line  [whitespace/braces] [4]
ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2542:  This { should be at the end of the previous line  [whitespace/braces] [4]
Total errors found: 2 in 16 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andreas Kling 2014-08-14 21:00:42 PDT
Comment on attachment 236629 [details]
Patch

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

r=me

> Source/WebCore/cssjit/SelectorCompiler.cpp:2465
> +static void jumpIfElementIsNotEmpty(Assembler& assembler, RegisterAllocator &registerAllocator, Assembler::JumpList& notEmptyCases, Assembler::RegisterID element)

RegisterAllocator& (& placement)

> Source/WebCore/cssjit/SelectorCompiler.cpp:2515
> +    if (m_selectorContext == SelectorContext::QuerySelector) {
> +        jumpIfElementIsNotEmpty(m_assembler, m_registerAllocator, failureCases, elementAddressRegister);
> +        return;
> +    }

The querySelector path is so nice and tidy.
Is the affected-by-empty bit optimization really necessary?
Comment 4 Benjamin Poulain 2014-08-14 21:04:50 PDT
(In reply to comment #3)
> > Source/WebCore/cssjit/SelectorCompiler.cpp:2515
> > +    if (m_selectorContext == SelectorContext::QuerySelector) {
> > +        jumpIfElementIsNotEmpty(m_assembler, m_registerAllocator, failureCases, elementAddressRegister);
> > +        return;
> > +    }
> 
> The querySelector path is so nice and tidy.
> Is the affected-by-empty bit optimization really necessary?

Today the flag avoid some style recalc when updating the tree.

I suspect that flag is the cause of the bug, I will look into it in the follow up.
Comment 5 Benjamin Poulain 2014-08-14 21:07:14 PDT
Committed r172619: <http://trac.webkit.org/changeset/172619>