Diff
Modified: trunk/Source/WebCore/ChangeLog (90666 => 90667)
--- trunk/Source/WebCore/ChangeLog 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/ChangeLog 2011-07-08 22:01:17 UTC (rev 90667)
@@ -1,3 +1,43 @@
+2011-07-08 Emil A Eklund <[email protected]>
+
+ Switch pointInContainer and accumulatedOffset to to new layout types
+ https://bugs.webkit.org/show_bug.cgi?id=64112
+
+ Reviewed by Eric Seidel.
+
+ Convert remaining IntPoint versions of the pointInContainer and
+ accumulatedOffset arguments to the new layout abstraction.
+
+ No new tests, no functionality changes.
+
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::addNodeToRectBasedTestResult):
+ * rendering/HitTestResult.h:
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::isPointInOverflowControl):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::pushContentsClip):
+ (WebCore::RenderBox::popContentsClip):
+ * rendering/RenderBox.h:
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
+ * rendering/RenderEmbeddedObject.h:
+ * rendering/RenderLineBoxList.cpp:
+ (WebCore::RenderLineBoxList::hitTest):
+ * rendering/RenderLineBoxList.h:
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::isPointInOverflowControl):
+ * rendering/RenderListBox.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::hitTest):
+ * rendering/RenderObject.h:
+ * rendering/RenderTextControl.cpp:
+ (WebCore::RenderTextControl::hitInnerTextElement):
+ * rendering/RenderTextControl.h:
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::nodeAtPoint):
+
2011-07-07 Ryosuke Niwa <[email protected]>
Move selection related code from RenderTextControl to HTMLTextFormControlElement
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -3936,7 +3936,7 @@
return result;
}
-bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset)
+bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
{
if (!scrollsOverflow())
return false;
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -596,7 +596,7 @@
virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
bool hitTestFloats(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
- virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset);
+ virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
void computeInlinePreferredLogicalWidths();
void computeBlockPreferredLogicalWidths();
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -1102,7 +1102,7 @@
#endif
-bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const IntPoint& accumulatedOffset)
+bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumulatedOffset)
{
if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseSelfOutline || paintInfo.phase == PaintPhaseMask)
return false;
@@ -1128,7 +1128,7 @@
return true;
}
-void RenderBox::popContentsClip(PaintInfo& paintInfo, PaintPhase originalPhase, const IntPoint& accumulatedOffset)
+void RenderBox::popContentsClip(PaintInfo& paintInfo, PaintPhase originalPhase, const LayoutPoint& accumulatedOffset)
{
ASSERT(hasControlClip() || (hasOverflowClip() && !layer()->isSelfPaintingLayer()));
Modified: trunk/Source/WebCore/rendering/RenderBox.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderBox.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -227,7 +227,7 @@
virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); }
virtual LayoutUnit collapsedMarginAfter() const { return marginAfter(); }
- virtual void absoluteRects(Vector<IntRect>&, const IntPoint& accumulatedOffset);
+ virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset);
virtual void absoluteQuads(Vector<FloatQuad>&);
IntRect reflectionBox() const;
@@ -346,8 +346,8 @@
IntRect clipRect(const IntPoint& location);
virtual bool hasControlClip() const { return false; }
virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); }
- bool pushContentsClip(PaintInfo&, const IntPoint& accumulatedOffset);
- void popContentsClip(PaintInfo&, PaintPhase originalPhase, const IntPoint& accumulatedOffset);
+ bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset);
+ void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint& accumulatedOffset);
virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHED(); }
virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -180,7 +180,7 @@
context->drawBidiText(font, run, FloatPoint(labelX, labelY));
}
-bool RenderEmbeddedObject::getReplacementTextGeometry(const IntPoint& accumulatedOffset, FloatRect& contentRect, Path& path, FloatRect& replacementTextRect, Font& font, TextRun& run, float& textWidth)
+bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, Path& path, FloatRect& replacementTextRect, Font& font, TextRun& run, float& textWidth)
{
contentRect = contentBoxRect();
contentRect.moveBy(accumulatedOffset);
Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -68,7 +68,7 @@
void setMissingPluginIndicatorIsPressed(bool);
bool isInMissingPluginIndicator(MouseEvent*);
- bool getReplacementTextGeometry(const IntPoint& accumulatedOffset, FloatRect& contentRect, Path&, FloatRect& replacementTextRect, Font&, TextRun&, float& textWidth);
+ bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, Path&, FloatRect& replacementTextRect, Font&, TextRun&, float& textWidth);
String m_replacementText;
bool m_hasFallbackContent; // FIXME: This belongs on HTMLObjectElement.
Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderLineBoxList.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -274,7 +274,7 @@
}
-bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction) const
+bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction) const
{
if (hitTestAction != HitTestForeground)
return false;
@@ -285,7 +285,7 @@
if (!firstLineBox())
return false;
- IntRect rect = firstLineBox()->isHorizontal() ?
+ LayoutRect rect = firstLineBox()->isHorizontal() ?
IntRect(pointInContainer.x(), pointInContainer.y() - result.topPadding(), 1, result.topPadding() + result.bottomPadding() + 1) :
IntRect(pointInContainer.x() - result.leftPadding(), pointInContainer.y(), result.rightPadding() + result.leftPadding() + 1, 1);
Modified: trunk/Source/WebCore/rendering/RenderLineBoxList.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderLineBoxList.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderLineBoxList.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -64,7 +64,7 @@
void dirtyLinesFromChangedChild(RenderObject* parent, RenderObject* child);
void paint(RenderBoxModelObject*, PaintInfo&, const LayoutPoint&) const;
- bool hitTest(RenderBoxModelObject*, const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction) const;
+ bool hitTest(RenderBoxModelObject*, const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) const;
private:
bool anyLineIntersectsRect(RenderBoxModelObject*, const IntRect&, const IntPoint&, bool usePrintRect = false, int outlineSize = 0) const;
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -439,15 +439,15 @@
}
}
-bool RenderListBox::isPointInOverflowControl(HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset)
+bool RenderListBox::isPointInOverflowControl(HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
{
if (!m_vBar)
return false;
- IntRect vertRect(accumulatedOffset.x() + width() - borderRight() - m_vBar->width(),
- accumulatedOffset.y() + borderTop(),
- m_vBar->width(),
- height() - borderTop() - borderBottom());
+ LayoutRect vertRect(accumulatedOffset.x() + width() - borderRight() - m_vBar->width(),
+ accumulatedOffset.y() + borderTop(),
+ m_vBar->width(),
+ height() - borderTop() - borderBottom());
if (vertRect.contains(pointInContainer)) {
result.setScrollbar(m_vBar.get());
Modified: trunk/Source/WebCore/rendering/RenderListBox.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderListBox.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderListBox.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -68,7 +68,7 @@
virtual void paintObject(PaintInfo&, const LayoutPoint&);
virtual IntRect controlClipRect(const IntPoint&) const;
- virtual bool isPointInOverflowControl(HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset);
+ virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0);
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -2145,7 +2145,7 @@
curr->updateDragState(dragOn);
}
-bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestFilter hitTestFilter)
+bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter hitTestFilter)
{
bool inside = false;
if (hitTestFilter != HitTestSelf) {
Modified: trunk/Source/WebCore/rendering/RenderObject.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderObject.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -548,7 +548,7 @@
void collectDashboardRegions(Vector<DashboardRegionValue>&);
#endif
- bool hitTest(const HitTestRequest&, HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestFilter = HitTestAll);
+ bool hitTest(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTestAll);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
virtual void updateHitTestResult(HitTestResult&, const IntPoint&);
Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderTextControl.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -335,7 +335,7 @@
RenderBlock::computeLogicalHeight();
}
-void RenderTextControl::hitInnerTextElement(HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset)
+void RenderTextControl::hitInnerTextElement(HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset)
{
IntPoint adjustedLocation = accumulatedOffset + location();
HTMLElement* innerText = innerTextElement();
Modified: trunk/Source/WebCore/rendering/RenderTextControl.h (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderTextControl.h 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderTextControl.h 2011-07-08 22:01:17 UTC (rev 90667)
@@ -60,7 +60,7 @@
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
- void hitInnerTextElement(HitTestResult&, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset);
+ void hitInnerTextElement(HitTestResult&, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset);
void forwardEvent(Event*);
int textBlockWidth() const;
Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (90666 => 90667)
--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2011-07-08 21:50:44 UTC (rev 90666)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp 2011-07-08 22:01:17 UTC (rev 90667)
@@ -332,7 +332,7 @@
}
}
-bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const IntPoint& pointInContainer, const IntPoint& accumulatedOffset, HitTestAction hitTestAction)
+bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const LayoutPoint& pointInContainer, const LayoutPoint& accumulatedOffset, HitTestAction hitTestAction)
{
if (!RenderTextControl::nodeAtPoint(request, result, pointInContainer, accumulatedOffset, hitTestAction))
return false;
@@ -343,12 +343,12 @@
// - we hit regions not in any decoration buttons.
HTMLElement* container = containerElement();
if (result.innerNode()->isDescendantOf(innerTextElement()) || result.innerNode() == node() || (container && container == result.innerNode())) {
- IntPoint pointInParent = pointInContainer;
+ LayoutPoint pointInParent = pointInContainer;
if (container && innerBlockElement()) {
if (innerBlockElement()->renderBox())
- pointInParent -= toSize(innerBlockElement()->renderBox()->location());
+ pointInParent -= toLayoutSize(innerBlockElement()->renderBox()->location());
if (container->renderBox())
- pointInParent -= toSize(container->renderBox()->location());
+ pointInParent -= toLayoutSize(container->renderBox()->location());
}
hitInnerTextElement(result, pointInParent, accumulatedOffset);
}