WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
118162
CSS: Implement the :placeholder-shown pseudo-class from Selectors Level 4
https://bugs.webkit.org/show_bug.cgi?id=118162
Summary
CSS: Implement the :placeholder-shown pseudo-class from Selectors Level 4
James Craig
Reported
2013-06-27 18:17:37 PDT
CSS: Implement the :placeholder-shown pseudo-class from Selectors Level 4 :placeholder-shown
http://dev.w3.org/csswg/selectors4/#rw-pseudos
Attachments
Patch
(97.62 KB, patch)
2014-08-19 19:08 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(100.15 KB, patch)
2014-08-20 12:47 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Patch
(99.31 KB, patch)
2014-08-20 17:52 PDT
,
Benjamin Poulain
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2014-08-19 19:08:55 PDT
Created
attachment 236847
[details]
Patch
WebKit Commit Bot
Comment 2
2014-08-19 19:10:13 PDT
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.
Benjamin Poulain
Comment 3
2014-08-20 01:39:56 PDT
I'll fix Windows tomorrow.
Benjamin Poulain
Comment 4
2014-08-20 12:47:04 PDT
Created
attachment 236889
[details]
Patch
WebKit Commit Bot
Comment 5
2014-08-20 12:49:16 PDT
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.
Timothy Hatcher
Comment 6
2014-08-20 13:54:42 PDT
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.
Antti Koivisto
Comment 7
2014-08-20 14:58:38 PDT
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.
Benjamin Poulain
Comment 8
2014-08-20 17:52:46 PDT
Created
attachment 236904
[details]
Patch
WebKit Commit Bot
Comment 9
2014-08-20 17:56:33 PDT
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.
Benjamin Poulain
Comment 10
2014-08-20 20:33:39 PDT
Committed
r172826
: <
http://trac.webkit.org/changeset/172826
>
Benjamin Poulain
Comment 11
2014-08-20 20:37:27 PDT
(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.
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