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

Issue 648495 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature

Blocking:
issue 545318


Show other hotlists

Hotlists containing this issue:
style-dev-current


Sign in to add a comment

Typed CSSOM: Make ComputedStylePropertyMap::get return computed style values

Project Member Reported by rjwright@chromium.org, Sep 20 2016

Issue description

ComputedStylePropertyMap::get should return computed style values, not resolved style values.

First patch is here https://codereview.chromium.org/2312293003. It deletes the stopgap implementation, and thus regresses some tests.
 

Comment 1 by meade@chromium.org, Oct 11 2016

Blocking: 545318
Status: Started (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Jan 27 2017

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

commit 738869d74b447a741a2e8a5cb95f5c49e12459f0
Author: rjwright <rjwright@chromium.org>
Date: Fri Jan 27 19:17:18 2017

[CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths

Makes Typed CSSOM Computed StylePropertyMap values reflect computed
style values instead of resolved style values (as are returned by
getComputedStyle) for some length-type properties (top, left, bottom,
right, width, & height).

For all other properties we get a value from
ComputedStyleCSSValueMapping::get, and convert it to a CSSStyleValue
using StyleValueFactory. These values may have undergone zoom-
adjustment and other alterations in ComputedStyleCSSValueMapping. I
may do a follow-up patch to add an option to
ComputedStyleCSSValueMapping::get for retrieving raw values.

We considered returning an CSSUnsupportedValue object (with cssText
from ComputedStyleCSSValueMapping) for unsupported properties. However
the custom paint code is already relying on this API, and changing to
CSSUnsupportedValues broke some of their layout tests. I've decided to
leave the CSSStyleValues in place for now as a best approximation to
true computed style.

BUG= 648495 

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

[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html
[add] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/LayoutTests/typedcssom/computedstyle/pseudo-elements.html
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/LayoutTests/typedcssom/computedstyle/width.html
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.cpp
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/CSSCalcLength.h
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.cpp
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/CSSKeywordValue.h
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.cpp
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMap.h
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/FilteredComputedStylePropertyMapTest.cpp
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/core/css/cssom/WindowGetComputedStyle.h
[modify] https://crrev.com/738869d74b447a741a2e8a5cb95f5c49e12459f0/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.cpp

Labels: Update-Monthly

Comment 5 by meade@chromium.org, Feb 13 2017

Cc: rjwright@chromium.org
 Issue 663861  has been merged into this issue.
Project Member

Comment 6 by bugdroid1@chromium.org, Feb 15 2017

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

commit 2d511bceabaa2c2a7e53dea20277cb45e08255f5
Author: rjwright <rjwright@chromium.org>
Date: Wed Feb 15 05:39:17 2017

[Typed CSSOM] Support line height in ComputedStylePropertyMap

Line height is represented as a Length in ComputedStyle, but the Length value is used to encode what are actually number and keyword values. So it has to be handled as a special case.

Depends on https://codereview.chromium.org/2403423002/.

BUG= 648495 

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

[add] https://crrev.com/2d511bceabaa2c2a7e53dea20277cb45e08255f5/third_party/WebKit/LayoutTests/typedcssom/computedstyle/line-height.html
[modify] https://crrev.com/2d511bceabaa2c2a7e53dea20277cb45e08255f5/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, May 12 2017

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

commit 7f86224d3bc34aa39ea8cdd21ec590b6e2954806
Author: rjwright <rjwright@chromium.org>
Date: Fri May 12 08:41:24 2017

[Typed CSSOM]New design for computed styles which includes custom properties

Adds support for getting computed style values for custom properties from Typed CSSOM.

Changes the way we get computed styles for normal CSS properties in Typed CSSOM. Previously we hand-rolled CSStyleValues using values retrieved from ComputedStyle. Now we are getting computed style values via ComputedStyleCSSValueMapping::get (which apparently returns raw computed style values when passed a nullptr LayoutObject) and turning them into CSSStyleValues via StyleValueFactory.

Small tidy-up in StylePropertyMapReadOnly.

This CL has two outstanding test failures that will be resolved in followup CLs. Custom property behavior in InlineStylePropertyMap also needs tests, which will be added in a followup CL.

BUG= 648495 

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

[modify] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/LayoutTests/typedcssom/computedstyle/computedStylePropertyMap.html
[add] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/LayoutTests/typedcssom/computedstyle/custom-properties-expected.txt
[add] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/LayoutTests/typedcssom/computedstyle/custom-properties.html
[modify] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/LayoutTests/typedcssom/computedstyle/line-height.html
[add] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/LayoutTests/typedcssom/computedstyle/resources/1x1-green.png
[modify] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp
[modify] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h
[modify] https://crrev.com/7f86224d3bc34aa39ea8cdd21ec590b6e2954806/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadonly.cpp

Labels: -Update-Monthly
Owner: shend@chromium.org
Darren, I am not sure of the status of this one. It was blocked on spec when I was working on it last. Feel free to close.

Comment 10 by shend@chromium.org, Jan 19 2018

Status: Fixed (was: Started)
Hmm, the current code just does:

     CSSProperty::Get(property_id).CSSValueFromComputedStyle

which would already get the computed value I think.

Sign in to add a comment