mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix id/class collection from stylesheets
BUG=438036 R=esprehn@chromium.org Review URL: https://codereview.chromium.org/785313002
This commit is contained in:
parent
b6e7ba2dfc
commit
fe9aa27ab5
@ -67,10 +67,10 @@ void RuleFeatureSet::collectFeaturesFromRuleData(const RuleData& ruleData)
|
||||
|
||||
void RuleFeatureSet::collectFeaturesFromSelector(const CSSSelector& selector)
|
||||
{
|
||||
addSelectorFeatures(selector);
|
||||
|
||||
for (const CSSSelector* current = &selector; current; current = current->tagHistory())
|
||||
for (const CSSSelector* current = &selector; current; current = current->tagHistory()) {
|
||||
addSelectorFeatures(*current);
|
||||
collectFeaturesFromSelectorList(current->selectorList());
|
||||
}
|
||||
}
|
||||
|
||||
void RuleFeatureSet::collectFeaturesFromSelectorList(const CSSSelectorList* selectorList)
|
||||
|
||||
6
tests/lowlevel/bug-438036-expected.txt
Normal file
6
tests/lowlevel/bug-438036-expected.txt
Normal file
@ -0,0 +1,6 @@
|
||||
Running 2 tests
|
||||
ok 1 Div width should grow width to 200px
|
||||
ok 2 Div width should grow height to 200px
|
||||
2 tests
|
||||
2 pass
|
||||
0 fail
|
||||
29
tests/lowlevel/bug-438036.sky
Normal file
29
tests/lowlevel/bug-438036.sky
Normal file
@ -0,0 +1,29 @@
|
||||
<sky>
|
||||
<import src="../resources/mocha.sky" />
|
||||
<import src="../resources/chai.sky" />
|
||||
<style>
|
||||
div { width: 100px; height: 100px; background-color: red; }
|
||||
div.wide { width: 200px; }
|
||||
div#high { height: 200px; }
|
||||
</style>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<script>
|
||||
|
||||
describe("Div width", function() {
|
||||
it("should grow width to 200px", function() {
|
||||
var target = document.querySelector('div');
|
||||
|
||||
target.classList.add("wide");
|
||||
assert.equal(getComputedStyle(target).width, "200px");
|
||||
});
|
||||
|
||||
it("should grow height to 200px", function() {
|
||||
var target = document.querySelectorAll('div')[1];
|
||||
|
||||
target.id = 'high';
|
||||
assert.equal(getComputedStyle(target).height, "200px");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</sky>
|
||||
Loading…
x
Reference in New Issue
Block a user