Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/select/option-display-none-computed-style.html

Issue 2095973002: Don't create m_style for option element in display:none subtree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/select/option-display-none-computed-style.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/select/option-display-none-computed-style.html b/third_party/WebKit/LayoutTests/fast/forms/select/option-display-none-computed-style.html
new file mode 100644
index 0000000000000000000000000000000000000000..0e81b570787d869819aa38fa97d654e318144e1d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/forms/select/option-display-none-computed-style.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+ option, optgroup { color: red }
+ .green { color: green }
+</style>
+<div style="display:none">
+ <option id="opt"></option>
+</div>
+<div style="display:none">
+ <optgroup id="optgroup"></optgroup>
+</div>
+<div style="display:none">
+ <optgroup>
+ <option id="optingroup"></option>
+ </optgroup>
+</div>
+<script>
+ test(() => assert_equals(getComputedStyle(opt).color, "rgb(255, 0, 0)", "Option color was not red before change."), "Option color before change.");
+ test(() => assert_equals(getComputedStyle(optgroup).color, "rgb(255, 0, 0)", "Optgroup color was not red before change."), "Optgroup color before change.");
+ test(() => assert_equals(getComputedStyle(optingroup).color, "rgb(255, 0, 0)", "Option in optgroup color was not red before change."), "Option in optgroup color before change.");
+ test(() => {
+ opt.className = "green";
+ assert_equals(getComputedStyle(opt).color, "rgb(0, 128, 0)", "Option color was not green after change.");
+ }, "Option color after class change.");
+ test(() => {
+ optgroup.className = "green";
+ assert_equals(getComputedStyle(optgroup).color, "rgb(0, 128, 0)", "Optgroup color was not green after change.");
+ }, "Optgroup color after class change.");
+ test(() => {
+ optingroup.className = "green";
+ assert_equals(getComputedStyle(optingroup).color, "rgb(0, 128, 0)", "Option in optgroup color was not green after change.");
+ }, "Option in optgroup color after class change.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698