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

Unified Diff: WebCore/css/CSSPrimitiveValue.cpp

Issue 1549001: Merge 56663 - CSSPrimitiveValue::setFloatValue/setStringValue should throw an... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/WebKit/249/
Patch Set: Created 10 years, 9 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 | « LayoutTests/fast/dom/setPrimitiveValue-exceptions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/css/CSSPrimitiveValue.cpp
===================================================================
--- WebCore/css/CSSPrimitiveValue.cpp (revision 42928)
+++ WebCore/css/CSSPrimitiveValue.cpp (working copy)
@@ -479,15 +479,13 @@
{
ec = 0;
- // FIXME: check if property supports this type
- if (m_type > CSS_DIMENSION) {
- ec = SYNTAX_ERR;
+ if (m_type < CSS_NUMBER || m_type > CSS_DIMENSION || unitType < CSS_NUMBER || unitType > CSS_DIMENSION) {
+ ec = INVALID_ACCESS_ERR;
return;
}
cleanup();
- //if(m_type > CSS_DIMENSION) throw DOMException(INVALID_ACCESS_ERR);
m_value.num = floatValue;
m_type = unitType;
}
@@ -570,10 +568,8 @@
{
ec = 0;
- //if(m_type < CSS_STRING) throw DOMException(INVALID_ACCESS_ERR);
- //if(m_type > CSS_ATTR) throw DOMException(INVALID_ACCESS_ERR);
- if (m_type < CSS_STRING || m_type > CSS_ATTR) {
- ec = SYNTAX_ERR;
+ if (m_type < CSS_STRING || m_type > CSS_ATTR || stringType < CSS_STRING || stringType > CSS_ATTR) {
+ ec = INVALID_ACCESS_ERR;
return;
}
« no previous file with comments | « LayoutTests/fast/dom/setPrimitiveValue-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698