New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 597500 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Not on Chrome anymore
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Pseudo and non pseudo elements don't return correct computed content value

Project Member Reported by nainar@chromium.org, Mar 24 2016

Issue description

content should compute to "normal" for elements
(not pseudo elements) and to "none" if the specified value of pseudo
elements ::before and ::after is "normal."

The spec concerning this is given here: 
https://drafts.csswg.org/css2/generate.html#content

jsfiddle: https://jsfiddle.net/h3poctzk/
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aaeefae6c3a945e7fcfef382c3a82002ffae0e19

commit aaeefae6c3a945e7fcfef382c3a82002ffae0e19
Author: nainar <nainar@chromium.org>
Date: Wed Mar 30 12:15:48 2016

Pseudo and non pseudo elements should return correct computed content value

This patch makes sure that content computes to "normal" for elements
(not pseudo elements) and to "none" if the specified value of pseudo
elements ::before and ::after is "normal."

This patch makes us interoperable with all other browsers for the
case of pseudo elements :before and ::after where the specified value
is "normal".

With regards to non psuedo elements we are now interoperable with IE
and the spec and return "normal" for the computed content all all non
psuedo elements.
Other browsers are inconcistent on this behaviour:
1. Edge returns an empty string for non pseudo elements
2. FF returns none for non pseudo elements.

The spec implemented is given here:
https://drafts.csswg.org/css2/generate.html#content

BUG= 597500 

Review URL: https://codereview.chromium.org/1812763002

Cr-Commit-Position: refs/heads/master@{#383949}

[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/css3/supports-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/css3/supports.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/content-property-quote-types.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-listing-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/disallowed-url-serialization.html
[add] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-content.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/nested-at-rules-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/nested-at-rules.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-styles-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/svg/css/getComputedStyle-listing-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Project Member

Comment 2 by bugdroid1@chromium.org, Mar 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aaeefae6c3a945e7fcfef382c3a82002ffae0e19

commit aaeefae6c3a945e7fcfef382c3a82002ffae0e19
Author: nainar <nainar@chromium.org>
Date: Wed Mar 30 12:15:48 2016

Pseudo and non pseudo elements should return correct computed content value

This patch makes sure that content computes to "normal" for elements
(not pseudo elements) and to "none" if the specified value of pseudo
elements ::before and ::after is "normal."

This patch makes us interoperable with all other browsers for the
case of pseudo elements :before and ::after where the specified value
is "normal".

With regards to non psuedo elements we are now interoperable with IE
and the spec and return "normal" for the computed content all all non
psuedo elements.
Other browsers are inconcistent on this behaviour:
1. Edge returns an empty string for non pseudo elements
2. FF returns none for non pseudo elements.

The spec implemented is given here:
https://drafts.csswg.org/css2/generate.html#content

BUG= 597500 

Review URL: https://codereview.chromium.org/1812763002

Cr-Commit-Position: refs/heads/master@{#383949}

[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/css3/supports-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/css3/supports.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/content-property-quote-types.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-listing-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/disallowed-url-serialization.html
[add] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-content.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/nested-at-rules-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/css/nested-at-rules.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete.html
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-styles-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/LayoutTests/svg/css/getComputedStyle-listing-expected.txt
[modify] https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Comment 3 by nainar@chromium.org, Mar 30 2016

Status: Fixed (was: Started)

Comment 4 by map...@gmail.com, May 12 2016

This change is impacting production code.  Not sure if you can hold back on this update.

As you note the browsers are very inconsistent on what getComputedStyle() returns for non-pseudo elements content value.  

Chrome 50, Edge, Safari all return “”
IE11 returns “normal”
Firefox returns “none”
Chrome 51 proposes to return “normal”

We believe IE11 hasn’t surfaced these issues because most apps that need to do this are using IE8 backwards compatible style checks using the non-standard currentStyle property.

Typical check:
    var docElement = document.documentElement;
    var testDiv = docElement.insertBefore(document.createElement(tag), docElement.firstChild);
    var styleValue = (testDiv.currentStyle || getComputedStyle(testDiv, null) || {})[‘content’];

Seems like this change should be given more time in the beta channel before being released to stable.  

We ask for more time to update production apps and get other browser vendors consistent with the spec.  

Comment 5 by nainar@chromium.org, May 16 2016

c#4 - reverting the change that caused this. Please refer to  bug 609848  for more details. 
Project Member

Comment 6 by bugdroid1@chromium.org, May 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bd9df7c452f9a6aadc49214a4a09451fc726be92

commit bd9df7c452f9a6aadc49214a4a09451fc726be92
Author: nainar <nainar@chromium.org>
Date: Thu May 19 10:49:13 2016

Revert of Pseudo and non pseudo elements should return correct computed content value (patchset #14 id:260001 of https://codereview.chromium.org/1812763002/ )

Reason for revert:
BUG= 609848 

A lot of sites in production are depending on content returning an empty string.

Original issue's description:
> Pseudo and non pseudo elements should return correct computed content value
>
> This patch makes sure that content computes to "normal" for elements
> (not pseudo elements) and to "none" if the specified value of pseudo
> elements ::before and ::after is "normal."
>
> This patch makes us interoperable with all other browsers for the
> case of pseudo elements :before and ::after where the specified value
> is "normal".
>
> With regards to non psuedo elements we are now interoperable with IE
> and the spec and return "normal" for the computed content all all non
> psuedo elements.
> Other browsers are inconcistent on this behaviour:
> 1. Edge returns an empty string for non pseudo elements
> 2. FF returns none for non pseudo elements.
>
> The spec implemented is given here:
> https://drafts.csswg.org/css2/generate.html#content
>
> BUG= 597500 
>
> Committed: https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19
> Cr-Commit-Position: refs/heads/master@{#383949}

TBR=alancutter@chromium.org,timloh@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 597500 

Review-Url: https://codereview.chromium.org/1977323002
Cr-Commit-Position: refs/heads/master@{#394729}

[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/css3/supports-expected.txt
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/css3/supports.html
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/css/content-property-quote-types.html
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-listing-expected.txt
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
[delete] https://crrev.com/be6cc8b3ee9ec912533a2a57a8529f3a524ae0d9/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-content.html
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/css/nested-at-rules-expected.txt
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/css/nested-at-rules.html
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete.html
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-styles-expected.txt
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/LayoutTests/svg/css/getComputedStyle-listing-expected.txt
[modify] https://crrev.com/bd9df7c452f9a6aadc49214a4a09451fc726be92/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, May 31 2016

Labels: merge-merged-2704
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7597d46261e696554606f4ed3d0931147cc2d1ba

commit 7597d46261e696554606f4ed3d0931147cc2d1ba
Author: Alan Cutter <alancutter@chromium.org>
Date: Tue May 31 01:25:00 2016

Revert of Pseudo and non pseudo elements should return correct computed content value (patchset #14 id:260001 of https://codereview.chromium.org/1812763002/ )

Reason for revert:
BUG= 609848 

A lot of sites in production are depending on content returning an empty string.

Original issue's description:
> Pseudo and non pseudo elements should return correct computed content value
>
> This patch makes sure that content computes to "normal" for elements
> (not pseudo elements) and to "none" if the specified value of pseudo
> elements ::before and ::after is "normal."
>
> This patch makes us interoperable with all other browsers for the
> case of pseudo elements :before and ::after where the specified value
> is "normal".
>
> With regards to non psuedo elements we are now interoperable with IE
> and the spec and return "normal" for the computed content all all non
> psuedo elements.
> Other browsers are inconcistent on this behaviour:
> 1. Edge returns an empty string for non pseudo elements
> 2. FF returns none for non pseudo elements.
>
> The spec implemented is given here:
> https://drafts.csswg.org/css2/generate.html#content
>
> BUG= 597500 
>
> Committed: https://crrev.com/aaeefae6c3a945e7fcfef382c3a82002ffae0e19
> Cr-Commit-Position: refs/heads/master@{#383949}

TBR=alancutter@chromium.org,timloh@chromium.org
BUG= 597500 

Review-Url: https://codereview.chromium.org/1977323002
Cr-Commit-Position: refs/heads/master@{#394729}
(cherry picked from commit bd9df7c452f9a6aadc49214a4a09451fc726be92)

Review URL: https://codereview.chromium.org/2021163002 .

Cr-Commit-Position: refs/branch-heads/2704@{#681}
Cr-Branched-From: 6e53600def8f60d8c632fadc70d7c1939ccea347-refs/heads/master@{#386251}

[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/css3/supports-expected.txt
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/css3/supports.html
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/css/content-property-quote-types.html
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-listing-expected.txt
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
[delete] https://crrev.com/a24314402398d518cf198c2c9a3cace65f5050e3/third_party/WebKit/LayoutTests/fast/css/getComputedStyle/getComputedStyle-content.html
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/css/nested-at-rules-expected.txt
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/css/nested-at-rules.html
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete.html
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/inspector/elements/elements-panel-styles-expected.txt
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/LayoutTests/svg/css/getComputedStyle-listing-expected.txt
[modify] https://crrev.com/7597d46261e696554606f4ed3d0931147cc2d1ba/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Cc: brajkumar@chromium.org
Labels: Needs-Feedback
Tested this issue on Windows 7, Ubuntu 14.04 and Mac OS 10.11.5 using chrome latest M51-51.0.2704.78. Could anyone please confirm is the attached screen-shot is the expected behavior of this issue.

597500.JPG
4.3 KB View Download

Sign in to add a comment