Commit 7414a7cd authored by mrowe@apple.com's avatar mrowe@apple.com

2008-06-22 Robert Blaut <webkit@blaut.biz>

        Reviewed by Darin Adler.

        Fix https://bugs.webkit.org/show_bug.cgi?id=19520
        Bug 19520: WebKit incorrectly accepts hidden as the value of outline-style

        Test: fast/css/outline-hidden-illegal-value.html

        * css/CSSParser.cpp:
        (WebCore::CSSParser::parseValue):
        * rendering/RenderFlow.cpp:
        (WebCore::RenderFlow::paintOutline):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::paintOutline):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::outlineWidth):
        (WebCore::RenderStyle::outlineOffset):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4b3f8c55
2008-06-22 Robert Blaut <webkit@blaut.biz>
Reviewed by Darin Adler.
Test for https://bugs.webkit.org/show_bug.cgi?id=19520
Bug 19520: WebKit incorrectly accepts hidden as the value of outline-style
* fast/css/outline-hidden-illegal-value-expected.txt: Added.
* fast/css/outline-hidden-illegal-value.html: Added.
2008-06-21 David Kilzer <ddkilzer@apple.com>
Bug 7931: Escaped elements within a textarea block can cause the textarea box to be closed prematurely
A test case for bug 19520 - "outline-style: hidden" should be ignored.
This line should have a green border.
TEST PASSED.
<!doctype html>
<title>outline-style: illegal hidden value</title>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<style>
p { margin: 2em; outline: .5em solid lime; outline-style: hidden }
</style>
<div>A test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=19520">bug 19520 - "outline-style: hidden" should be ignored</a>.</div>
<p>This line should have a green border.</p>
<script>
var x = document.getElementsByTagName("p")[0];
if (document.defaultView.getComputedStyle(x,null).getPropertyValue("outline-style") == "solid")
document.write("<div>TEST PASSED.</div>");
else
document.write("<div>TEST FAILED.</div>");
</script>
2008-06-22 Robert Blaut <webkit@blaut.biz>
Reviewed by Darin Adler.
Fix https://bugs.webkit.org/show_bug.cgi?id=19520
Bug 19520: WebKit incorrectly accepts hidden as the value of outline-style
Test: fast/css/outline-hidden-illegal-value.html
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* rendering/RenderFlow.cpp:
(WebCore::RenderFlow::paintOutline):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::paintOutline):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::outlineWidth):
(WebCore::RenderStyle::outlineOffset):
2008-06-22 Jonathon Jongsma <jonathon.jongsma@collabora.co.uk>
Reviewed by Dan Bernstein.
......@@ -689,11 +689,11 @@ bool CSSParser::parseValue(int propId, bool important)
valid_primitive = true;
break;
case CSSPropertyOutlineStyle: // <border-style> | auto | inherit
if (id == CSSValueAuto) {
case CSSPropertyOutlineStyle: // (<border-style> except hidden) | auto | inherit
if (id == CSSValueAuto || id == CSSValueNone || (id >= CSSValueInset && id <= CSSValueDouble))
valid_primitive = true;
break;
} // Fall through!
break;
case CSSPropertyBorderTopStyle: //// <border-style> | inherit
case CSSPropertyBorderRightStyle: // Defined as: none | hidden | dotted | dashed |
case CSSPropertyBorderBottomStyle: // solid | double | groove | ridge | inset | outset
......
......@@ -767,7 +767,7 @@ void RenderFlow::paintOutline(GraphicsContext* graphicsContext, int tx, int ty)
graphicsContext->clearFocusRing();
}
if (style()->outlineStyleIsAuto() || style()->outlineStyle() <= BHIDDEN)
if (style()->outlineStyleIsAuto() || style()->outlineStyle() == BNONE)
return;
Vector<IntRect> rects;
......
......@@ -1791,7 +1791,7 @@ void RenderObject::paintOutline(GraphicsContext* graphicsContext, int tx, int ty
}
}
if (style->outlineStyleIsAuto() || style->outlineStyle() <= BHIDDEN)
if (style->outlineStyleIsAuto() || style->outlineStyle() == BNONE)
return;
tx -= offset;
......
......@@ -1874,7 +1874,7 @@ public:
unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
unsigned short outlineWidth() const {
if (background->m_outline.style() == BNONE || background->m_outline.style() == BHIDDEN)
if (background->m_outline.style() == BNONE)
return 0;
return background->m_outline.width;
}
......@@ -2025,7 +2025,7 @@ public:
BindingURI* bindingURIs() const { return rareNonInheritedData->bindingURI; }
#endif
int outlineOffset() const {
if (background->m_outline.style() == BNONE || background->m_outline.style() == BHIDDEN)
if (background->m_outline.style() == BNONE)
return 0;
return background->m_outline._offset;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment