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

Issue 633745 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

@apply does not calculated variable value correctly

Project Member Reported by dfreedm@chromium.org, Aug 2 2016

Issue description

Version: Version 54.0.2816.4 canary
OS: OS X

What steps will reproduce the problem?
(1) Load http://jsbin.com/weruduzafi/edit?html,output

What is the expected output?
One red 'X' with 5px solid black border and one blue 'X' with no border

What do you see instead?
One red 'X' and one blue 'X' with a 5px solid black border.


Please use labels and text to provide additional information.

 

Comment 1 by shans@chromium.org, Aug 2 2016

Labels: -Pri-3 Pri-2
Owner: timloh@chromium.org
Status: Assigned (was: Untriaged)
(note: should be border, not background in provided test case - use http://jsbin.com/tonadecuja/3/edit?html,output instead)

Expected: a black border and a dotted orange border.
Observed: either two black borders or two dotted orange borders.


Components: Blink>CSS
Looks like bad caching, probably the MatchedPropertiesCache (I think we added a flag for custom properties to handle a similar issue previously).
Labels: -Hotlist-Toolkit Hotlist-Polymer
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 9 2016

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

commit da555331c0bea26738d4c1ffe0b5fae8a706370b
Author: timloh <timloh@chromium.org>
Date: Tue Aug 09 05:06:20 2016

Elements using @apply shouldn't use the MatchedPropertiesCache

This patch disables the MatchedPropertiesCache on elements which use
@apply rules. We re-use the same flag as for when variables are
referenced from non-inherited properties because this is fundamentally
the same issue.

For elements with MatchedProperties in the cache but a different parent
ComputedStyle than is cached, we copy non-inherited properties directly
from the cache and apply only inherited properties. This doesn't work
when a non-inherited property depends on a parent's property and we
already disable this optimisation when a non-inherited property is set
to inherit or a variable reference. Similarly, using @apply can make
a non-inherited property depend on a parent's property by having the
@apply'd variable be inherited and setting a non-inherited property
with the rule.

BUG= 633745 

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

[add] https://crrev.com/da555331c0bea26738d4c1ffe0b5fae8a706370b/third_party/WebKit/LayoutTests/fast/css/atapply/at-apply-identical-aside-from-inherited.html
[modify] https://crrev.com/da555331c0bea26738d4c1ffe0b5fae8a706370b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
[modify] https://crrev.com/da555331c0bea26738d4c1ffe0b5fae8a706370b/third_party/WebKit/Source/core/css/resolver/StyleResolver.h
[modify] https://crrev.com/da555331c0bea26738d4c1ffe0b5fae8a706370b/third_party/WebKit/Source/core/style/ComputedStyle.h

Status: Fixed (was: Assigned)

Sign in to add a comment