Diff
Modified: branches/subpixellayout/Source/WebCore/dom/Document.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/dom/Document.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/dom/Document.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -1159,9 +1159,9 @@
return 0;
float zoomFactor = frame->pageZoomFactor();
- IntPoint point = roundedIntPoint(FloatPoint(x * zoomFactor + frameView->scrollX(), y * zoomFactor + frameView->scrollY()));
+ LayoutPoint point = LayoutPoint(x * zoomFactor + frameView->scrollX(), y * zoomFactor + frameView->scrollY());
- if (!frameView->visibleContentRect().contains(point))
+ if (!frameView->visibleContentRect().contains(roundedIntPoint(point)))
return 0;
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
Modified: branches/subpixellayout/Source/WebCore/dom/MouseRelatedEvent.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/dom/MouseRelatedEvent.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/dom/MouseRelatedEvent.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -208,14 +208,14 @@
{
if (!m_hasCachedRelativePosition)
computeRelativePosition();
- return m_offsetLocation.x();
+ return m_offsetLocation.x().round();
}
int MouseRelatedEvent::offsetY()
{
if (!m_hasCachedRelativePosition)
computeRelativePosition();
- return m_offsetLocation.y();
+ return m_offsetLocation.y().round();
}
int MouseRelatedEvent::pageX() const
Modified: branches/subpixellayout/Source/WebCore/platform/Length.h (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/platform/Length.h 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/platform/Length.h 2011-11-17 22:36:28 UTC (rev 100679)
@@ -87,6 +87,10 @@
return getFloatValue();
}
+ int intValue() const {
+ return getIntValue();
+ }
+
float percent() const
{
ASSERT(type() == Percent);
Modified: branches/subpixellayout/Source/WebCore/rendering/RenderLayer.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/RenderLayer.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderLayer.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -3041,9 +3041,9 @@
{
renderer()->document()->updateLayout();
- LayoutRect hitTestArea = renderer()->view()->documentRect();
+ IntRect hitTestArea = renderer()->view()->documentRect();
if (!request.ignoreClipping())
- hitTestArea.intersect(frameVisibleRect(renderer()));
+ hitTestArea.intersect(enclosingIntRect(frameVisibleRect(renderer())));
RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestArea, result.point(), false);
if (!insideLayer) {
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -82,7 +82,7 @@
if (info.context->paintingDisabled() || info.phase != PaintPhaseForeground)
return;
- LayoutPoint adjustedPaintOffset = paintOffset + location();
+ IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location());
GraphicsContextStateSaver stateSaver(*info.context);
@@ -90,22 +90,22 @@
info.context->setStrokeStyle(SolidStroke);
info.context->setStrokeColor(Color(0, 0, 255), ColorSpaceSRGB);
- info.context->drawLine(adjustedPaintOffset, LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y()));
- info.context->drawLine(LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y()), LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + offsetHeight()));
- info.context->drawLine(LayoutPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + offsetHeight()), LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + offsetHeight()));
- info.context->drawLine(adjustedPaintOffset, LayoutPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + offsetHeight()));
+ info.context->drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y()));
+ info.context->drawLine(IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y()), IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + offsetHeight()));
+ info.context->drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + offsetHeight()), IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + offsetHeight()));
+ info.context->drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + offsetHeight()));
int topStart = paddingTop();
info.context->setStrokeColor(Color(0, 255, 0), ColorSpaceSRGB);
- info.context->drawLine(LayoutPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + topStart), LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + topStart));
+ info.context->drawLine(IngPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + topStart), IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + topStart));
- int baseline = baselinePosition(AlphabeticBaseline, true, HorizontalLine);
+ int baseline = baselinePosition(AlphabeticBaseline, true, HorizontalLine).round();
info.context->setStrokeColor(Color(255, 0, 0), ColorSpaceSRGB);
- info.context->drawLine(LayoutPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + baseline), LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + baseline));
+ info.context->drawLine(IntPoint(adjustedPaintOffset.x(), adjustedPaintOffset.y() + baseline), IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y() + baseline));
}
#endif // ENABLE(DEBUG_MATH_LAYOUT)
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -140,7 +140,7 @@
if (!firstChild() ||!m_lineThickness)
return;
- LayoutUnit verticalOffset = 0;
+ int verticalOffset = 0;
// The children are always RenderMathMLBlock instances
if (firstChild()->isRenderMathMLBlock()) {
int adjustForThickness = m_lineThickness > 1 ? int(m_lineThickness / 2) : 1;
@@ -153,7 +153,7 @@
verticalOffset = numerator->offsetHeight();
}
- LayoutPoint adjustedPaintOffset = paintOffset + location();
+ IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location());
adjustedPaintOffset.setY(adjustedPaintOffset.y() + verticalOffset);
GraphicsContextStateSaver stateSaver(*info.context);
@@ -162,7 +162,7 @@
info.context->setStrokeStyle(SolidStroke);
info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), ColorSpaceSRGB);
- info.context->drawLine(roundedIntPoint(adjustedPaintOffset), roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y())));
+ info.context->drawLine(adjustedPaintOffset, IntPoint(adjustedPaintOffset.x() + offsetWidth(), adjustedPaintOffset.y()));
}
LayoutUnit RenderMathMLFraction::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -337,7 +337,7 @@
LayoutUnit RenderMathMLOperator::baselinePosition(FontBaseline, bool firstLine, LineDirectionMode lineDirection, LinePositionMode linePositionMode) const
{
if (m_isStacked)
- return m_stretchHeight * 2 / 3 - (m_stretchHeight - static_cast<LayoutUnit>(m_stretchHeight / gOperatorExpansion)) / 2;
+ return m_stretchHeight * 2 / 3 - (m_stretchHeight - static_cast<int>(m_stretchHeight / gOperatorExpansion)) / 2;
return RenderBlock::baselinePosition(AlphabeticBaseline, firstLine, lineDirection, linePositionMode);
}
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -104,17 +104,17 @@
if (!firstChild() || !lastChild())
return;
- LayoutPoint adjustedPaintOffset = paintOffset + location();
+ IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location());
RenderBoxModelObject* indexBox = toRenderBoxModelObject(lastChild());
- LayoutUnit maxHeight = indexBox->offsetHeight();
+ int maxHeight = indexBox->offsetHeight();
// default to the font size in pixels if we're empty
if (!maxHeight)
maxHeight = style()->fontSize();
- LayoutUnit width = indexBox->offsetWidth();
+ int width = indexBox->offsetWidth();
- LayoutUnit indexWidth = 0;
+ int indexWidth = 0;
RenderObject* current = firstChild();
while (current != lastChild()) {
if (current->isBoxModelObject()) {
@@ -139,10 +139,10 @@
width += topStartShift;
int rootPad = static_cast<int>(gRootPadding * style()->fontSize());
- LayoutUnit start = adjustedPaintOffset.x() + indexWidth + gRadicalLeftMargin + style()->paddingLeft().value() - rootPad;
- adjustedPaintOffset.setY(adjustedPaintOffset.y() + style()->paddingTop().value() - rootPad);
+ int start = adjustedPaintOffset.x() + indexWidth + gRadicalLeftMargin + style()->paddingLeft().intValue() - rootPad;
+ adjustedPaintOffset.setY(adjustedPaintOffset.y() + style()->paddingTop().intValue() - rootPad);
- FloatPoint topStart(start - topStartShift, paintOffset.y());
+ FloatPoint topStart(start - topStartShift, adjustedPaintOffset.y());
FloatPoint bottomLeft(start - gRadicalBottomPointXPos * frontWidth , adjustedPaintOffset.y() + maxHeight + gRadicalBasePad);
FloatPoint topLeft(start - gRadicalTopLeftPointXPos * frontWidth , adjustedPaintOffset.y() + gRadicalTopLeftPointYPos * maxHeight);
FloatPoint leftEnd(start - frontWidth , topLeft.y() + gRadicalLeftEndYShift * style()->fontSize());
@@ -199,7 +199,7 @@
if (!firstChild() || !lastChild())
return;
- LayoutUnit maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();
+ int maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();
RenderObject* current = lastChild()->firstChild();
if (current)
@@ -209,17 +209,17 @@
maxHeight = style()->fontSize();
// Base height above which the shape of the root changes
- LayoutUnit thresholdHeight = static_cast<LayoutUnit>(gThresholdBaseHeight * style()->fontSize());
- LayoutUnit topStartShift = 0;
+ int thresholdHeight = static_cast<int>(gThresholdBaseHeight * style()->fontSize());
+ int topStartShift = 0;
if (maxHeight > thresholdHeight && thresholdHeight) {
float shift = (maxHeight - thresholdHeight) / static_cast<float>(thresholdHeight);
if (shift > 1.)
shift = 1.0f;
- LayoutUnit frontWidth = static_cast<LayoutUnit>(style()->fontSize() * gRadicalWidth);
- topStartShift = static_cast<LayoutUnit>(gRadicalBottomPointXPos * frontWidth * shift);
+ int frontWidth = static_cast<int>(style()->fontSize() * gRadicalWidth);
+ topStartShift = static_cast<int>(gRadicalBottomPointXPos * frontWidth * shift);
- style()->setPaddingBottom(Length(static_cast<LayoutUnit>(gRootBottomPadding * style()->fontSize()), Fixed));
+ style()->setPaddingBottom(Length(static_cast<int>(gRootBottomPadding * style()->fontSize()), Fixed));
}
// Positioning of the index
@@ -230,13 +230,13 @@
if (!indexBox)
return;
- LayoutUnit indexShift = indexBox->offsetWidth() + topStartShift;
- LayoutUnit radicalHeight = static_cast<LayoutUnit>((1 - gRadicalTopLeftPointYPos) * maxHeight);
- LayoutUnit rootMarginTop = radicalHeight + style()->paddingBottom().value() + indexBox->offsetHeight() - (maxHeight + static_cast<LayoutUnit>(gRootPadding * style()->fontSize()));
+ int indexShift = indexBox->offsetWidth() + topStartShift;
+ int radicalHeight = static_cast<int>((1 - gRadicalTopLeftPointYPos) * maxHeight);
+ int rootMarginTop = radicalHeight + style()->paddingBottom().value() + indexBox->offsetHeight() - (maxHeight + static_cast<int>(gRootPadding * style()->fontSize()));
style()->setPaddingLeft(Length(indexShift, Fixed));
if (rootMarginTop > 0)
- style()->setPaddingTop(Length(rootMarginTop + static_cast<LayoutUnit>(gRootPadding * style()->fontSize()), Fixed));
+ style()->setPaddingTop(Length(rootMarginTop + static_cast<int>(gRootPadding * style()->fontSize()), Fixed));
setNeedsLayout(true);
setPreferredLogicalWidthsDirty(true, false);
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -66,12 +66,12 @@
{
RenderBlock::layout();
- LayoutUnit maxHeight = 0;
+ int maxHeight = 0;
int childCount = 0;
int operatorCount = 0;
// Calculate the non-operator max height of the row.
- LayoutUnit operatorHeight = 0;
+ int operatorHeight = 0;
for (RenderObject* current = firstChild(); current; current = current->nextSibling()) {
childCount++;
if (current->isRenderMathMLBlock()) {
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -73,10 +73,10 @@
if (info.context->paintingDisabled())
return;
- LayoutPoint adjustedPaintOffset = paintOffset + location();
+ IntPoint adjustedPaintOffset = roundedIntPoint(paintOffset + location());
- LayoutUnit maxHeight = 0;
- LayoutUnit width = 0;
+ int maxHeight = 0;
+ int width = 0;
RenderObject* current = firstChild();
while (current) {
if (current->isBoxModelObject()) {
@@ -160,7 +160,7 @@
void RenderMathMLSquareRoot::layout()
{
- LayoutUnit maxHeight = 0;
+ int maxHeight = 0;
RenderObject* current = firstChild();
while (current) {
@@ -179,8 +179,8 @@
maxHeight = style()->fontSize();
- if (maxHeight > static_cast<LayoutUnit>(gThresholdBaseHeight * style()->fontSize()))
- style()->setPaddingBottom(Length(static_cast<LayoutUnit>(gRootBottomPadding * style()->fontSize()), Fixed));
+ if (maxHeight > static_cast<int>(gThresholdBaseHeight * style()->fontSize()))
+ style()->setPaddingBottom(Length(static_cast<int>(gRootBottomPadding * style()->fontSize()), Fixed));
RenderBlock::layout();
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -162,15 +162,15 @@
if (m_kind == SubSup) {
if (RenderObject* base = firstChild()) {
- LayoutUnit maxHeight = 0;
+ int maxHeight = 0;
RenderObject* current = base->firstChild();
while (current) {
- LayoutUnit height = getBoxModelObjectHeight(current);
+ int height = getBoxModelObjectHeight(current);
if (height > maxHeight)
maxHeight = height;
current = current->nextSibling();
}
- LayoutUnit heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : LayoutUnit(0);
+ int heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;
if (heightDiff < 0)
heightDiff = 0;
base->style()->setPaddingTop(Length(heightDiff, Fixed));
@@ -197,7 +197,7 @@
if (m_scripts && base && base->isBoxModelObject()) {
RenderBoxModelObject* box = toRenderBoxModelObject(base);
- LayoutUnit topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;
+ int topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;
// FIXME: The last bit of this calculation should be more exact. Why is the 2-3px scaled for zoom necessary?
// The baseline is top spacing of the base + the baseline of the base + adjusted space for zoom
Modified: branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp (100678 => 100679)
--- branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp 2011-11-17 22:34:55 UTC (rev 100678)
+++ branches/subpixellayout/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp 2011-11-17 22:36:28 UTC (rev 100679)
@@ -159,7 +159,7 @@
if (!over->firstChild() || !over->firstChild()->isBoxModelObject())
break;
- LayoutUnit overSpacing = static_cast<LayoutUnit>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine)));
+ int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine)));
// base row wrapper
base = over->nextSibling();
@@ -181,7 +181,7 @@
// base row wrapper
base = firstChild();
if (base) {
- LayoutUnit baseHeight = getOffsetHeight(base);
+ int baseHeight = getOffsetHeight(base);
// actual base
base = base->firstChild();
if (!base || !base->isBoxModelObject())
@@ -189,7 +189,7 @@
// FIXME: We need to look at the space between a single maximum height of
// the line boxes and the baseline and squeeze them together
- LayoutUnit underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine);
+ int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine);
// adjust the base's intrusion into the under
RenderObject* under = lastChild();
@@ -210,7 +210,7 @@
// FIXME: bases that ascend higher than the line box intrude into the over
if (!over->firstChild() || !over->firstChild()->isBoxModelObject())
break;
- LayoutUnit overSpacing = static_cast<LayoutUnit>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine)));
+ int overSpacing = static_cast<int>(gOverSpacingAdjustment * (getOffsetHeight(over) - toRenderBoxModelObject(over->firstChild())->baselinePosition(AlphabeticBaseline, true, HorizontalLine)));
// base row wrapper
base = over->nextSibling();
@@ -222,7 +222,7 @@
// We need to calculate the baseline of the base versus the start of the under block and
// adjust the placement of the under block.
- LayoutUnit baseHeight = getOffsetHeight(base);
+ int baseHeight = getOffsetHeight(base);
// actual base
base = base->firstChild();
if (!base || !base->isBoxModelObject())
@@ -230,7 +230,7 @@
// FIXME: We need to look at the space between a single maximum height of
// the line boxes and the baseline and squeeze them together
- LayoutUnit underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine);
+ int underSpacing = baseHeight - toRenderBoxModelObject(base)->baselinePosition(AlphabeticBaseline, true, HorizontalLine);
RenderObject* under = lastChild();
if (under && under->firstChild() && under->firstChild()->isRenderInline() && underSpacing > 0)
@@ -274,7 +274,7 @@
// FIXME: Where is the extra 2-3px adjusted for zoom coming from?
float zoomFactor = style()->effectiveZoom();
- baseline += static_cast<LayoutUnit>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
+ baseline += static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
return baseline;
}