From 31de067e43615ce9657315497dcb5ea9c62bbd5a Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Wed, 21 Jan 2015 17:00:06 -0800 Subject: [PATCH] Don't store a RuleFeatureSet on ScopedStyleResolver. Instead lets just iterate the list of sheets and ask each one questions. This shouldn't be much slower since most widgets only have one sheet anyway. I also moved the media query matching to the sheet collection. We weren't correctly matching them since we only guarded the feature set, not the addition to the list of active sheets. R=abarth@chromium.org, ojan@chromium.org Review URL: https://codereview.chromium.org/858423002 --- .../tests/styles/media-queries-expected.txt | 6 ++++ .../flutter/tests/styles/media-queries.sky | 29 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 engine/src/flutter/tests/styles/media-queries-expected.txt create mode 100644 engine/src/flutter/tests/styles/media-queries.sky diff --git a/engine/src/flutter/tests/styles/media-queries-expected.txt b/engine/src/flutter/tests/styles/media-queries-expected.txt new file mode 100644 index 0000000000..9e40216011 --- /dev/null +++ b/engine/src/flutter/tests/styles/media-queries-expected.txt @@ -0,0 +1,6 @@ +Running 2 tests +ok 1 Media queries should allow sheets to apply when they match +ok 2 Media queries should cause sheets to be skipped when they do not match +2 tests +2 pass +0 fail diff --git a/engine/src/flutter/tests/styles/media-queries.sky b/engine/src/flutter/tests/styles/media-queries.sky new file mode 100644 index 0000000000..4b220b9477 --- /dev/null +++ b/engine/src/flutter/tests/styles/media-queries.sky @@ -0,0 +1,29 @@ + + + + + +
Should not be red.
+ + + +
Should be red.
+ + +