Summary: | CSS: Implement the :placeholder-shown pseudo-class from Selectors Level 4 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | James Craig <jcraig> | ||||||||
Component: | CSS | Assignee: | Benjamin Poulain <benjamin> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | benjamin, commit-queue, ddkilzer, dtrebbien, jcraig, kling, koivisto, syoichi, timothy | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 118122 | ||||||||||
Attachments: |
|
Description
James Craig
2013-06-27 18:17:37 PDT
Created attachment 236847 [details]
Patch
Attachment 236847 [details] did not pass style-queue:
ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2832: This { should be at the end of the previous line [whitespace/braces] [4]
Total errors found: 1 in 31 files
If any of these errors are false positives, please file a bug against check-webkit-style.
I'll fix Windows tomorrow. Created attachment 236889 [details]
Patch
Attachment 236889 [details] did not pass style-queue:
ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2832: This { should be at the end of the previous line [whitespace/braces] [4]
Total errors found: 1 in 31 files
If any of these errors are false positives, please file a bug against check-webkit-style.
I assume this selector to style the magnifying glass would work with this patch: .filter-bar > input[type="search"]:placeholder-shown::-webkit-search-decoration That is how I plan to use it in the Web Inspector. Comment on attachment 236889 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236889&action=review > Source/WebCore/html/HTMLTextFormControlElement.cpp:169 > + setNeedsStyleRecalc(); Why explicit setNeedsStyleRecalc? Shouldn't style change trigger recalc? > Source/WebCore/html/HTMLTextFormControlElement.cpp:175 > + if (m_isPlaceholderVisible) > + placeholder->setInlineStyleProperty(CSSPropertyDisplay, CSSValueBlock, true); > + else > + placeholder->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone, true); I would use placeholder->setInlineStyleProperty(CSSPropertyDisplay, m_isPlaceholderVisible ? CSSValueBlock : CSSValueNone, true); > Source/WebCore/html/HTMLTextFormControlElement.cpp:643 > + placeholder->setInlineStyleProperty(CSSPropertyVisibility, CSSValueVisible : CSSValueHidden); This doesn't look like it would compile. > Source/WebCore/html/HTMLTextFormControlElement.cpp:650 > + placeholder->setInlineStyleProperty(CSSPropertyVisibility, CSSValueVisible : CSSValueHidden); Nor does this. Created attachment 236904 [details]
Patch
Attachment 236904 [details] did not pass style-queue:
ERROR: Source/WebCore/cssjit/SelectorCompiler.cpp:2832: This { should be at the end of the previous line [whitespace/braces] [4]
Total errors found: 1 in 31 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Committed r172826: <http://trac.webkit.org/changeset/172826> (In reply to comment #7) > (From update of attachment 236889 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=236889&action=review > > > Source/WebCore/html/HTMLTextFormControlElement.cpp:169 > > + setNeedsStyleRecalc(); > > Why explicit setNeedsStyleRecalc? Shouldn't style change trigger recalc? Unfortunately we also need that one. The style change is done on the shadow DOM. We need that setNeedsStyleRecalc() to update the style of the current element based on :placeholder-shown. |