-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not scope cache elements with media rules, :host(), or :host-conte…
…xt() selectors Mark style rules in parsing rather than runtime to make sure scope'd bitmask is consistent. Add tests for cache coherency. Fixes #3696
- Loading branch information
Showing
7 changed files
with
288 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"globals": { | ||
"assert": true, | ||
"sinon": true, | ||
"WCT": true | ||
"WCT": true, | ||
"fixture": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Media Query and Caching</title> | ||
<link rel="import" href="../../polymer.html"> | ||
</head> | ||
|
||
<body> | ||
<dom-module id="my-element"> | ||
<template> | ||
<style> | ||
:root { | ||
--color: orange; | ||
} | ||
|
||
@media(max-width: 800px) { | ||
:root { | ||
--color: green; | ||
} | ||
} | ||
|
||
div { | ||
height: 50px; | ||
width: 50px; | ||
background: var(--color); | ||
color: var(--text-color); | ||
} | ||
|
||
:host { | ||
display: block; | ||
background: blue; | ||
height: 100px; | ||
--text-color: white; | ||
} | ||
|
||
@media(max-width: 800px) { | ||
:host { | ||
background: red; | ||
} | ||
} | ||
|
||
:host([foo]) { | ||
--text-color: black; | ||
} | ||
|
||
:host-context([bar]) { | ||
--text-color: lightgray; | ||
} | ||
</style> | ||
<div>text</div> | ||
</template> | ||
<script> | ||
Polymer({ | ||
is: 'my-element' | ||
}); | ||
</script> | ||
</dom-module> | ||
<div bar> | ||
<my-element foo></my-element> | ||
</div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.