Title: [113645] trunk/Source/WebCore
- Revision
- 113645
- Author
- [email protected]
- Date
- 2012-04-09 17:03:01 -0700 (Mon, 09 Apr 2012)
Log Message
Prepare html classes for sub-pixel LayoutUnits
https://bugs.webkit.org/show_bug.cgi?id=83491
Reviewed by Eric Seidel.
This patch brings the entire HTML folder up to the current state of the subpixellayout branch. Adding
an intValue flavor of Length that maps to the current value function was also necessary to get us
there. See https://trac.webkit.org/wiki/LayoutUnit and the descriptions below for details.
No new tests. No change in behavior.
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::scrollAmount): Fixes a compiler error when length returns a float, as
we intend it to do when switching to sub-pixel layout.
* html/ImageDocument.cpp:
(WebCore::ImageDocumentParser::finish): imageSize is always integral.
* platform/Length.h:
(WebCore::Length::Length): Added a constructor that takes a FractionalLayoutUnit.
(Length):
(WebCore::Length::intValue): Currently maps directly to Length::value, but the current logic of value
will be migrated here when value is changed to return a float.
(WebCore::Length::setValue): Added a variant that takes a FractionalLayoutUnit.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (113644 => 113645)
--- trunk/Source/WebCore/ChangeLog 2012-04-10 00:01:02 UTC (rev 113644)
+++ trunk/Source/WebCore/ChangeLog 2012-04-10 00:03:01 UTC (rev 113645)
@@ -1,3 +1,28 @@
+2012-04-09 Levi Weintraub <[email protected]>
+
+ Prepare html classes for sub-pixel LayoutUnits
+ https://bugs.webkit.org/show_bug.cgi?id=83491
+
+ Reviewed by Eric Seidel.
+
+ This patch brings the entire HTML folder up to the current state of the subpixellayout branch. Adding
+ an intValue flavor of Length that maps to the current value function was also necessary to get us
+ there. See https://trac.webkit.org/wiki/LayoutUnit and the descriptions below for details.
+
+ No new tests. No change in behavior.
+
+ * html/HTMLMarqueeElement.cpp:
+ (WebCore::HTMLMarqueeElement::scrollAmount): Fixes a compiler error when length returns a float, as
+ we intend it to do when switching to sub-pixel layout.
+ * html/ImageDocument.cpp:
+ (WebCore::ImageDocumentParser::finish): imageSize is always integral.
+ * platform/Length.h:
+ (WebCore::Length::Length): Added a constructor that takes a FractionalLayoutUnit.
+ (Length):
+ (WebCore::Length::intValue): Currently maps directly to Length::value, but the current logic of value
+ will be migrated here when value is changed to return a float.
+ (WebCore::Length::setValue): Added a variant that takes a FractionalLayoutUnit.
+
2012-04-09 Andrew Lo <[email protected]>
[BlackBerry] requestAnimationFrame performance choppy & inconsistent
Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.cpp (113644 => 113645)
--- trunk/Source/WebCore/html/HTMLMarqueeElement.cpp 2012-04-10 00:01:02 UTC (rev 113644)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.cpp 2012-04-10 00:03:01 UTC (rev 113645)
@@ -125,7 +125,7 @@
{
bool ok;
int scrollAmount = fastGetAttribute(scrollamountAttr).toInt(&ok);
- return ok && scrollAmount >= 0 ? scrollAmount : RenderStyle::initialMarqueeIncrement().value();
+ return ok && scrollAmount >= 0 ? scrollAmount : RenderStyle::initialMarqueeIncrement().intValue();
}
void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionCode& ec)
Modified: trunk/Source/WebCore/html/ImageDocument.cpp (113644 => 113645)
--- trunk/Source/WebCore/html/ImageDocument.cpp 2012-04-10 00:01:02 UTC (rev 113644)
+++ trunk/Source/WebCore/html/ImageDocument.cpp 2012-04-10 00:03:01 UTC (rev 113645)
@@ -155,7 +155,7 @@
// Report the natural image size in the page title, regardless of zoom
// level.
- LayoutSize size = cachedImage->imageSizeForRenderer(document()->imageElement()->renderer(), 1.0f);
+ IntSize size = cachedImage->imageSizeForRenderer(document()->imageElement()->renderer(), 1.0f);
if (size.width()) {
// Compute the title, we use the decoded filename of the resource, falling
// back on the (decoded) hostname if there is no path.
Modified: trunk/Source/WebCore/platform/Length.h (113644 => 113645)
--- trunk/Source/WebCore/platform/Length.h 2012-04-10 00:01:02 UTC (rev 113644)
+++ trunk/Source/WebCore/platform/Length.h 2012-04-10 00:03:01 UTC (rev 113645)
@@ -24,6 +24,7 @@
#define Length_h
#include "AnimationUtilities.h"
+#include "LayoutTypes.h"
#include <wtf/Assertions.h>
#include <wtf/FastAllocBase.h>
#include <wtf/Forward.h>
@@ -55,6 +56,11 @@
{
}
+ Length(FractionalLayoutUnit v, LengthType t, bool q = false)
+ : m_floatValue(v.toFloat()), m_quirk(q), m_type(t), m_isFloat(true)
+ {
+ }
+
Length(float v, LengthType t, bool q = false)
: m_floatValue(v), m_quirk(q), m_type(t), m_isFloat(true)
{
@@ -112,6 +118,13 @@
return getIntValue();
}
+ // FIXME: When we switch to sub-pixel layout, value will return float by default, and this will inherit
+ // the current implementation of value().
+ int intValue() const
+ {
+ return value();
+ }
+
float percent() const
{
ASSERT(type() == Percent);
@@ -151,6 +164,13 @@
m_isFloat = true;
}
+ void setValue(LengthType t, FractionalLayoutUnit value)
+ {
+ m_type = t;
+ m_floatValue = value;
+ m_isFloat = true;
+ }
+
void setValue(float value)
{
*this = Length(value, Fixed);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes