Title: [92349] trunk/Source/WebCore
- Revision
- 92349
- Author
- [email protected]
- Date
- 2011-08-03 21:40:11 -0700 (Wed, 03 Aug 2011)
Log Message
Clean up value clamping in CSSStyleSelector.
https://bugs.webkit.org/show_bug.cgi?id=65588
Reviewed by Darin Adler.
No new tests / trivial code cleanup only.
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
Replace (unsigned int)primitiveValue->getDoubleValue() with primtiveValue->getValue<unsigned>() for correct clamping.
Replace clampToInteger(primitiveValue->getDoubleValue()) with primitiveValue->getIntValue().
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (92348 => 92349)
--- trunk/Source/WebCore/ChangeLog 2011-08-04 04:38:32 UTC (rev 92348)
+++ trunk/Source/WebCore/ChangeLog 2011-08-04 04:40:11 UTC (rev 92349)
@@ -1,3 +1,17 @@
+2011-08-03 Luke Macpherson <[email protected]>
+
+ Clean up value clamping in CSSStyleSelector.
+ https://bugs.webkit.org/show_bug.cgi?id=65588
+
+ Reviewed by Darin Adler.
+
+ No new tests / trivial code cleanup only.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ Replace (unsigned int)primitiveValue->getDoubleValue() with primtiveValue->getValue<unsigned>() for correct clamping.
+ Replace clampToInteger(primitiveValue->getDoubleValue()) with primitiveValue->getIntValue().
+
2011-08-03 Kent Tamura <[email protected]>
Fix incorrect checks for HTMLMediaElement
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (92348 => 92349)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-08-04 04:38:32 UTC (rev 92348)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-08-04 04:40:11 UTC (rev 92349)
@@ -4537,13 +4537,13 @@
HANDLE_INHERIT_AND_INITIAL(boxFlexGroup, BoxFlexGroup)
if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
return; // Error case.
- m_style->setBoxFlexGroup((unsigned int)(primitiveValue->getDoubleValue()));
+ m_style->setBoxFlexGroup(primitiveValue->getValue<unsigned>());
return;
case CSSPropertyWebkitBoxOrdinalGroup:
HANDLE_INHERIT_AND_INITIAL(boxOrdinalGroup, BoxOrdinalGroup)
if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
return; // Error case.
- m_style->setBoxOrdinalGroup((unsigned int)(primitiveValue->getDoubleValue()));
+ m_style->setBoxOrdinalGroup(primitiveValue->getValue<unsigned>());
return;
case CSSPropertyBoxSizing:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(boxSizing, BoxSizing);
@@ -4699,7 +4699,7 @@
return;
case CSSPropertyWebkitContentOrder:
HANDLE_INHERIT_AND_INITIAL(regionIndex, RegionIndex);
- m_style->setRegionIndex(clampToInteger(primitiveValue->getDoubleValue()));
+ m_style->setRegionIndex(primitiveValue->getIntValue());
return;
case CSSPropertyWebkitRegionOverflow:
HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(regionOverflow, RegionOverflow);
@@ -6449,8 +6449,7 @@
// This is a quirk that should go away when 3d transforms are finalized.
double val = firstValue->getDoubleValue();
ok = val >= 0;
- val = clampToPositiveInteger(val);
- p = Length(static_cast<int>(val), Fixed);
+ p = Length(clampToPositiveInteger(val), Fixed);
}
if (!ok)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes