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

Unified Diff: LayoutTests/svg/css/rect-system-color.xhtml

Issue 700843006: Don't require getPropertyCSSValue in svg tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
Index: LayoutTests/svg/css/rect-system-color.xhtml
diff --git a/LayoutTests/svg/css/rect-system-color.xhtml b/LayoutTests/svg/css/rect-system-color.xhtml
index 3cfd702f00ec4b762b09324905e4e2525464e031..4d291d6686923ccf99a822442def1c889bbcffc8 100644
--- a/LayoutTests/svg/css/rect-system-color.xhtml
+++ b/LayoutTests/svg/css/rect-system-color.xhtml
@@ -8,37 +8,17 @@
<div id="console"/>
<script><![CDATA[
SVG_NS = 'http://www.w3.org/2000/svg';
-var color1, color2;
-var systemColorRed, systemColorGreen, systemColorBlue;
+var computedStyleText, computedStyleDiv;
function checkSystemColor(id1, id2, systemColor)
{
var textElement = document.getElementById(id1);
- var computedStyleText = textElement.ownerDocument.defaultView.getComputedStyle(textElement);
+ computedStyleText = textElement.ownerDocument.defaultView.getComputedStyle(textElement);
var divElement = document.getElementById(id2);
- var computedStyleDiv = divElement.ownerDocument.defaultView.getComputedStyle(divElement);
-
- color1 = computedStyleText.getPropertyValue('fill');
- var re = new RegExp("rgba?\\(([^, ]*), ([^, ]*), ([^, ]*)(?:, )?([^, ]*)\\)");
- color1Components = re.exec(color1);
-
- color2 = computedStyleDiv.getPropertyCSSValue('color').getRGBColorValue();
-
- systemColorRed = color2.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
- systemColorGreen = color2.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
- systemColorBlue = color2.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
+ computedStyleDiv = divElement.ownerDocument.defaultView.getComputedStyle(divElement);
debug('Testing system color' + systemColor);
-
- shouldBe("parseInt(color1Components[1])", "systemColorRed");
- shouldBe("parseInt(color1Components[2])", "systemColorGreen");
- shouldBe("parseInt(color1Components[3])", "systemColorBlue");
-
- color1 = computedStyleText.getPropertyValue('stroke');
- color1Components = re.exec(color1);
-
- shouldBe("parseInt(color1Components[1])", "systemColorRed");
- shouldBe("parseInt(color1Components[2])", "systemColorGreen");
- shouldBe("parseInt(color1Components[3])", "systemColorBlue");
+ shouldBe("computedStyleText.fill", "computedStyleDiv.color");
+ shouldBe("computedStyleText.stroke", "computedStyleDiv.color");
}
description('Test that fill and stroke properties accept system colors');
« no previous file with comments | « LayoutTests/svg/css/glyph-orientation-rounding-test-expected.txt ('k') | LayoutTests/svg/css/rect-system-color-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698