Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Shadows don't support viewport units
https://bugs.webkit.org/show_bug.cgi?id=119649

Reviewed by Darin Adler.

Source/WebCore:

We don't yet support viewport units in shadows, so
fail parsing if we see one. The bug to fix this
completely is: https://webkit.org/b/119650

Test: fast/css/shadow-viewport-units.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseShadow): Fail if we get one of
vh, vw, vmin, vmax.

LayoutTests:

Test that exercises a viewport unit in text-shadow to make sure we don't parse it.

* fast/css/shadow-viewport-units-expected.txt: Added.
* fast/css/shadow-viewport-units.html: Added.


Canonical link: https://commits.webkit.org/137638@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grorg committed Aug 12, 2013
1 parent 56cd24d commit 4a082b7
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
12 changes: 12 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
2013-08-12 Dean Jackson <dino@apple.com>

Shadows don't support viewport units
https://bugs.webkit.org/show_bug.cgi?id=119649

Reviewed by Darin Adler.

Test that exercises a viewport unit in text-shadow to make sure we don't parse it.

* fast/css/shadow-viewport-units-expected.txt: Added.
* fast/css/shadow-viewport-units.html: Added.

2013-08-12 Allan Sandfeld Jensen <allan.jensen@digia.com>

[Qt] Add Support for canvas blend modes
Expand Down
1 change: 1 addition & 0 deletions LayoutTests/fast/css/shadow-viewport-units-expected.txt
@@ -0,0 +1 @@
PASS: No shadow style
18 changes: 18 additions & 0 deletions LayoutTests/fast/css/shadow-viewport-units.html
@@ -0,0 +1,18 @@
<style>
#a { text-shadow: 0px 0px 0vh black; } /* Should be invalid - we don't yet support viewport units in shadow */
</style>
<div id="a"></div>
<script>
window.addEventListener("load", function () {
if (window.testRunner)
testRunner.dumpAsText();

var a = document.getElementById("a");
var output = document.createElement("p");
document.body.appendChild(output);
if (window.getComputedStyle(a).textShadow == "none")
output.innerText = "PASS: No shadow style";
else
output.innerText = "FAIL: Shadow style: " + window.getComputedStyle(a).textShadow;
}, false);
</script>
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
2013-08-12 Dean Jackson <dino@apple.com>

Shadows don't support viewport units
https://bugs.webkit.org/show_bug.cgi?id=119649

Reviewed by Darin Adler.

We don't yet support viewport units in shadows, so
fail parsing if we see one. The bug to fix this
completely is: https://webkit.org/b/119650

Test: fast/css/shadow-viewport-units.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseShadow): Fail if we get one of
vh, vw, vmin, vmax.

2013-08-12 peavo@outlook.com <peavo@outlook.com>

[Curl] Cookie is not set when url string is unicode.
Expand Down
7 changes: 7 additions & 0 deletions Source/WebCore/css/CSSParser.cpp
Expand Up @@ -6541,6 +6541,13 @@ PassRefPtr<CSSValueList> CSSParser::parseShadow(CSSParserValueList* valueList, C
if (!context.allowLength())
return 0;

// We don't support viewport units for shadow values.
if (val->unit == CSSPrimitiveValue::CSS_VW
|| val->unit == CSSPrimitiveValue::CSS_VH
|| val->unit == CSSPrimitiveValue::CSS_VMIN
|| val->unit == CSSPrimitiveValue::CSS_VMAX)
return 0;

// Blur radius must be non-negative.
if (context.allowBlur && !validUnit(val, FLength | FNonNeg, CSSStrictMode))
return 0;
Expand Down

0 comments on commit 4a082b7

Please sign in to comment.