Changeset 17426 in webkit
- Timestamp:
- Oct 29, 2006, 2:07:47 PM (19 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r17425 r17426 1 2006-10-29 Beth Dakin <bdakin@apple.com> 2 3 Rubber stamped by Geoff. 4 5 This is a followup to my HitTestResult checkin. Most of the 6 HitTestResult local variables in the code were named i or info for 7 when the class was named NodeInfo. This patch renames all of these 8 local variables to result. 9 10 * dom/Document.cpp: 11 (WebCore::Document::prepareMouseEvent): 12 * html/HTMLAreaElement.cpp: 13 (WebCore::HTMLAreaElement::mapMouseEvent): 14 * html/HTMLMapElement.cpp: 15 (WebCore::HTMLMapElement::mapMouseEvent): 16 * rendering/EllipsisBox.cpp: 17 (WebCore::EllipsisBox::nodeAtPoint): 18 * rendering/EllipsisBox.h: 19 * rendering/InlineBox.cpp: 20 (WebCore::InlineBox::nodeAtPoint): 21 * rendering/InlineFlowBox.cpp: 22 (WebCore::InlineFlowBox::nodeAtPoint): 23 * rendering/InlineTextBox.cpp: 24 (WebCore::InlineTextBox::nodeAtPoint): 25 * rendering/RenderBlock.cpp: 26 (WebCore::RenderBlock::isPointInScrollbar): 27 (WebCore::RenderBlock::nodeAtPoint): 28 * rendering/RenderBlock.h: 29 * rendering/RenderBox.cpp: 30 (WebCore::RenderBox::nodeAtPoint): 31 * rendering/RenderBox.h: 32 * rendering/RenderFlow.cpp: 33 (WebCore::RenderFlow::hitTestLines): 34 * rendering/RenderFlow.h: 35 * rendering/RenderForeignObject.cpp: 36 (WebCore::RenderForeignObject::nodeAtPoint): 37 * rendering/RenderFrameSet.cpp: 38 (WebCore::RenderFrameSet::nodeAtPoint): 39 * rendering/RenderImage.cpp: 40 (WebCore::RenderImage::nodeAtPoint): 41 * rendering/RenderInline.cpp: 42 (WebCore::RenderInline::nodeAtPoint): 43 * rendering/RenderInline.h: 44 * rendering/RenderLayer.cpp: 45 (WebCore::RenderLayer::autoscroll): 46 (WebCore::RenderLayer::hitTest): 47 (WebCore::RenderLayer::hitTestLayer): 48 (WebCore::RenderLayer::updateHoverActiveState): 49 * rendering/RenderListBox.cpp: 50 (WebCore::RenderListBox::isPointInScrollbar): 51 * rendering/RenderObject.cpp: 52 (WebCore::RenderObject::hitTest): 53 (WebCore::RenderObject::setInnerNode): 54 (WebCore::RenderObject::nodeAtPoint): 55 * rendering/RenderObject.h: 56 * rendering/RenderPath.cpp: 57 (WebCore::RenderPath::nodeAtPoint): 58 * rendering/RenderSVGImage.cpp: 59 (WebCore::RenderSVGImage::nodeAtPoint): 60 * rendering/RenderSVGText.cpp: 61 (WebCore::RenderSVGText::nodeAtPoint): 62 * rendering/RenderTableRow.cpp: 63 (WebCore::RenderTableRow::nodeAtPoint): 64 * rendering/RenderTableRow.h: 65 * rendering/RenderTableSection.cpp: 66 (WebCore::RenderTableSection::nodeAtPoint): 67 * rendering/RenderTableSection.h: 68 * rendering/RenderTextControl.cpp: 69 (WebCore::RenderTextControl::nodeAtPoint): 70 * rendering/RootInlineBox.cpp: 71 (WebCore::RootInlineBox::nodeAtPoint): 72 * rendering/RootInlineBox.h: 73 1 74 2006-10-29 Adam Roben <aroben@apple.com> 2 75 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r17415 r17426 10503 10503 productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; 10504 10504 projectDirPath = ""; 10505 projectRoot = "";10506 10505 targets = ( 10507 10506 93F198A508245E59001E9ABC /* WebCore */, -
trunk/WebCore/dom/Document.cpp
r17405 r17426 1674 1674 1675 1675 assert(renderer()->isRenderView()); 1676 HitTestResult re nderInfo(point, readonly, active, mouseMove);1677 renderer()->layer()->hitTest(re nderInfo);1676 HitTestResult result(point, readonly, active, mouseMove); 1677 renderer()->layer()->hitTest(result); 1678 1678 1679 1679 if (!readonly) 1680 1680 updateRendering(); 1681 1681 1682 bool isOverLink = re nderInfo.URLElement() && !renderInfo.URLElement()->getAttribute(hrefAttr).isNull();1683 return MouseEventWithHitTestResults(event, re nderInfo.innerNode(), renderInfo.scrollbar(), isOverLink);1682 bool isOverLink = result.URLElement() && !result.URLElement()->getAttribute(hrefAttr).isNull(); 1683 return MouseEventWithHitTestResults(event, result.innerNode(), result.scrollbar(), isOverLink); 1684 1684 } 1685 1685 -
trunk/WebCore/html/HTMLAreaElement.cpp
r17399 r17426 70 70 } 71 71 72 bool HTMLAreaElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& info)72 bool HTMLAreaElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& result) 73 73 { 74 74 if (m_lastSize != size) { … … 80 80 return false; 81 81 82 info.setInnerNode(this);83 info.setURLElement(this);82 result.setInnerNode(this); 83 result.setURLElement(this); 84 84 return true; 85 85 } -
trunk/WebCore/html/HTMLMapElement.cpp
r17399 r17426 53 53 } 54 54 55 bool HTMLMapElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& info)55 bool HTMLMapElement::mapMouseEvent(int x, int y, const IntSize& size, HitTestResult& result) 56 56 { 57 57 HTMLAreaElement* defaultArea = 0; … … 63 63 if (!defaultArea) 64 64 defaultArea = areaElt; 65 } else if (areaElt->mapMouseEvent(x, y, size, info))65 } else if (areaElt->mapMouseEvent(x, y, size, result)) 66 66 return true; 67 67 } … … 69 69 70 70 if (defaultArea) { 71 info.setInnerNode(defaultArea);72 info.setURLElement(defaultArea);71 result.setInnerNode(defaultArea); 72 result.setURLElement(defaultArea); 73 73 } 74 74 return defaultArea; -
trunk/WebCore/rendering/EllipsisBox.cpp
r17399 r17426 62 62 } 63 63 64 bool EllipsisBox::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty)64 bool EllipsisBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty) 65 65 { 66 66 tx += m_x; … … 71 71 int mtx = tx + m_width - m_markupBox->xPos(); 72 72 int mty = ty + m_baseline - (m_markupBox->yPos() + m_markupBox->baseline()); 73 if (m_markupBox->nodeAtPoint( info, x, y, mtx, mty)) {74 object()->setInnerNode( info);73 if (m_markupBox->nodeAtPoint(result, x, y, mtx, mty)) { 74 object()->setInnerNode(result); 75 75 return true; 76 76 } … … 78 78 79 79 if (object()->style()->visibility() == VISIBLE && IntRect(tx, ty, m_width, m_height).contains(x, y)) { 80 object()->setInnerNode( info);80 object()->setInnerNode(result); 81 81 return true; 82 82 } -
trunk/WebCore/rendering/EllipsisBox.h
r17399 r17426 39 39 } 40 40 41 virtual void paint(RenderObject::PaintInfo& i, int _tx, int _ty);42 virtual bool nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty);41 virtual void paint(RenderObject::PaintInfo&, int _tx, int _ty); 42 virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty); 43 43 44 44 private: -
trunk/WebCore/rendering/InlineBox.cpp
r17399 r17426 150 150 } 151 151 152 bool InlineBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)152 bool InlineBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty) 153 153 { 154 154 // Hit test all phases of replaced elements atomically, as though the replaced element established its 155 155 // own stacking context. (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1 156 156 // specification.) 157 return object()->hitTest( i, x, y, tx, ty);157 return object()->hitTest(result, x, y, tx, ty); 158 158 } 159 159 -
trunk/WebCore/rendering/InlineFlowBox.cpp
r17399 r17426 524 524 } 525 525 526 bool InlineFlowBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)526 bool InlineFlowBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty) 527 527 { 528 528 // Check children first. 529 529 for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { 530 if (!curr->object()->layer() && curr->nodeAtPoint( i, x, y, tx, ty)) {531 object()->setInnerNode( i);530 if (!curr->object()->layer() && curr->nodeAtPoint(result, x, y, tx, ty)) { 531 object()->setInnerNode(result); 532 532 return true; 533 533 } … … 537 537 IntRect rect(tx + m_x, ty + m_y, m_width, m_height); 538 538 if (object()->style()->visibility() == VISIBLE && rect.contains(x, y)) { 539 object()->setInnerNode( i);539 object()->setInnerNode(result); 540 540 return true; 541 541 } -
trunk/WebCore/rendering/InlineTextBox.cpp
r17399 r17426 221 221 } 222 222 223 bool InlineTextBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)223 bool InlineTextBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty) 224 224 { 225 225 if (isLineBreak()) … … 228 228 IntRect rect(tx + m_x, ty + m_y, m_width, m_height); 229 229 if (m_truncation != cFullTruncation && object()->style()->visibility() == VISIBLE && rect.contains(x, y)) { 230 object()->setInnerNode( i);230 object()->setInnerNode(result); 231 231 return true; 232 232 } -
trunk/WebCore/rendering/RenderBlock.cpp
r17399 r17426 2500 2500 } 2501 2501 2502 bool RenderBlock::isPointInScrollbar(HitTestResult& info, int _x, int _y, int _tx, int _ty)2502 bool RenderBlock::isPointInScrollbar(HitTestResult& result, int _x, int _y, int _tx, int _ty) 2503 2503 { 2504 2504 if (!scrollsOverflow()) … … 2511 2511 height() + borderTopExtra() + borderBottomExtra() - borderTop() - borderBottom() - m_layer->horizontalScrollbarHeight()); 2512 2512 if (vertRect.contains(_x, _y)) { 2513 info.setScrollbar(m_layer->verticalScrollbarWidget());2513 result.setScrollbar(m_layer->verticalScrollbarWidget()); 2514 2514 return true; 2515 2515 } … … 2522 2522 m_layer->horizontalScrollbarHeight()); 2523 2523 if (horizRect.contains(_x, _y)) { 2524 info.setScrollbar(m_layer->horizontaScrollbarWidget());2524 result.setScrollbar(m_layer->horizontaScrollbarWidget()); 2525 2525 return true; 2526 2526 } … … 2530 2530 } 2531 2531 2532 bool RenderBlock::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)2532 bool RenderBlock::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 2533 2533 { 2534 2534 bool inlineFlow = isInlineFlow(); … … 2553 2553 } 2554 2554 2555 if (isPointInScrollbar( info, _x, _y, tx, ty)) {2555 if (isPointInScrollbar(result, _x, _y, tx, ty)) { 2556 2556 if (hitTestAction == HitTestBlockBackground) { 2557 setInnerNode( info);2557 setInnerNode(result); 2558 2558 return true; 2559 2559 } … … 2568 2568 if (childrenInline() && !isTable()) { 2569 2569 // We have to hit-test our line boxes. 2570 if (hitTestLines( info, _x, _y, scrolledX, scrolledY, hitTestAction)) {2571 setInnerNode( info);2570 if (hitTestLines(result, _x, _y, scrolledX, scrolledY, hitTestAction)) { 2571 setInnerNode(result); 2572 2572 return true; 2573 2573 } … … 2581 2581 // FIXME: We have to skip over inline flows, since they can show up inside RenderTables at the moment (a demoted inline <form> for example). If we ever implement a 2582 2582 // table-specific hit-test method (which we should do for performance reasons anyway), then we can remove this check. 2583 if (!child->layer() && !child->isFloating() && !child->isInlineFlow() && child->nodeAtPoint( info, _x, _y, scrolledX, scrolledY, childHitTest)) {2584 setInnerNode( info);2583 if (!child->layer() && !child->isFloating() && !child->isInlineFlow() && child->nodeAtPoint(result, _x, _y, scrolledX, scrolledY, childHitTest)) { 2584 setInnerNode(result); 2585 2585 return true; 2586 2586 } … … 2597 2597 DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); 2598 2598 for (it.toLast(); (o = it.current()); --it) 2599 if (!o->noPaint && !o->node->layer() && o->node->hitTest( info, _x, _y,2599 if (!o->noPaint && !o->node->layer() && o->node->hitTest(result, _x, _y, 2600 2600 scrolledX + o->left + o->node->marginLeft() - o->node->xPos(), 2601 2601 scrolledY + o->startY + o->node->marginTop() - o->node->yPos())) { 2602 setInnerNode( info);2602 setInnerNode(result); 2603 2603 return true; 2604 2604 } … … 2610 2610 IntRect boundsRect(tx, ty - topExtra, m_width, m_height + topExtra + borderBottomExtra()); 2611 2611 if (style()->visibility() == VISIBLE && boundsRect.contains(_x, _y)) { 2612 setInnerNode( info);2612 setInnerNode(result); 2613 2613 return true; 2614 2614 } -
trunk/WebCore/rendering/RenderBlock.h
r17399 r17426 199 199 int leftOffset(int y) const { return leftRelOffset(y, leftOffset(), true); } 200 200 201 virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, 202 HitTestAction hitTestAction); 203 204 virtual bool isPointInScrollbar(HitTestResult& info, int x, int y, int tx, int ty); 201 virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction hitTestAction); 202 203 virtual bool isPointInScrollbar(HitTestResult&, int x, int y, int tx, int ty); 205 204 206 205 virtual VisiblePosition positionForCoordinates(int x, int y); -
trunk/WebCore/rendering/RenderBox.cpp
r17399 r17426 255 255 256 256 // Hit Testing 257 bool RenderBox::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action)257 bool RenderBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action) 258 258 { 259 259 tx += m_x; … … 266 266 // table-specific hit-test method (which we should do for performance reasons anyway), 267 267 // then we can remove this check. 268 if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint( info, x, y, tx, ty, action)) {269 setInnerNode( info);268 if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(result, x, y, tx, ty, action)) { 269 setInnerNode(result); 270 270 return true; 271 271 } … … 275 275 // foreground phase (which is true for replaced elements like images). 276 276 if (action == HitTestForeground && IntRect(tx, ty, m_width, m_height).contains(x, y)) { 277 setInnerNode( info);277 setInnerNode(result); 278 278 return true; 279 279 } -
trunk/WebCore/rendering/RenderBox.h
r17399 r17426 43 43 44 44 virtual void setStyle(RenderStyle*); 45 virtual void paint(PaintInfo& i, int _tx, int _ty);46 virtual bool nodeAtPoint(HitTestResult& i, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction);45 virtual void paint(PaintInfo&, int _tx, int _ty); 46 virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction); 47 47 48 48 virtual void destroy(); -
trunk/WebCore/rendering/RenderFlow.cpp
r17399 r17426 417 417 } 418 418 419 bool RenderFlow::hitTestLines(HitTestResult& i, int x, int y, int tx, int ty, HitTestAction hitTestAction)419 bool RenderFlow::hitTestLines(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction) 420 420 { 421 421 if (hitTestAction != HitTestForeground) … … 442 442 for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevFlowBox()) { 443 443 if (y >= ty + curr->root()->topOverflow() && y < ty + curr->root()->bottomOverflow()) { 444 bool inside = curr->nodeAtPoint( i, x, y, tx, ty);444 bool inside = curr->nodeAtPoint(result, x, y, tx, ty); 445 445 if (inside) { 446 setInnerNode( i);446 setInnerNode(result); 447 447 return true; 448 448 } -
trunk/WebCore/rendering/RenderFlow.h
r17399 r17426 76 76 virtual void dirtyLineBoxes(bool fullLayout, bool isRootLineBox = false); 77 77 78 void paintLines(PaintInfo& i, int _tx, int _ty);79 bool hitTestLines(HitTestResult& i, int x, int y, int tx, int ty, HitTestAction hitTestAction);78 void paintLines(PaintInfo&, int _tx, int _ty); 79 bool hitTestLines(HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 80 80 81 81 virtual IntRect getAbsoluteRepaintRect(); -
trunk/WebCore/rendering/RenderForeignObject.cpp
r17399 r17426 119 119 } 120 120 121 bool RenderForeignObject::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction hitTestAction)121 bool RenderForeignObject::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction) 122 122 { 123 123 AffineTransform totalTransform = absoluteTransform(); … … 125 125 double localX, localY; 126 126 totalTransform.invert().map(x, y, &localX, &localY); 127 return RenderBlock::nodeAtPoint( info, (int)localX, (int)localY, tx, ty, hitTestAction);127 return RenderBlock::nodeAtPoint(result, (int)localX, (int)localY, tx, ty, hitTestAction); 128 128 } 129 129 -
trunk/WebCore/rendering/RenderFrameSet.cpp
r17399 r17426 76 76 } 77 77 78 bool RenderFrameSet::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,78 bool RenderFrameSet::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, 79 79 HitTestAction hitTestAction) 80 80 { … … 82 82 return false; 83 83 84 bool inside = RenderContainer::nodeAtPoint( info, _x, _y, _tx, _ty, hitTestAction) ||84 bool inside = RenderContainer::nodeAtPoint(result, _x, _y, _tx, _ty, hitTestAction) || 85 85 m_resizing || canResize(_x, _y); 86 if (inside && element() && !element()->noResize() && ! info.readonly() && !info.innerNode()) {87 info.setInnerNode(element());88 info.setInnerNonSharedNode(element());86 if (inside && element() && !element()->noResize() && !result.readonly() && !result.innerNode()) { 87 result.setInnerNode(element()); 88 result.setInnerNonSharedNode(element()); 89 89 } 90 90 -
trunk/WebCore/rendering/RenderImage.cpp
r17399 r17426 312 312 } 313 313 314 bool RenderImage::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)315 { 316 bool inside = RenderReplaced::nodeAtPoint( info, _x, _y, _tx, _ty, hitTestAction);314 bool RenderImage::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 315 { 316 bool inside = RenderReplaced::nodeAtPoint(result, _x, _y, _tx, _ty, hitTestAction); 317 317 318 318 if (inside && element()) { … … 323 323 if (map) { 324 324 // we're a client side image map 325 inside = map->mapMouseEvent(_x - tx, _y - ty, IntSize(contentWidth(), contentHeight()), info);326 info.setInnerNonSharedNode(element());325 inside = map->mapMouseEvent(_x - tx, _y - ty, IntSize(contentWidth(), contentHeight()), result); 326 result.setInnerNonSharedNode(element()); 327 327 } 328 328 } -
trunk/WebCore/rendering/RenderInline.cpp
r17399 r17426 336 336 } 337 337 338 bool RenderInline::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,338 bool RenderInline::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, 339 339 HitTestAction hitTestAction) 340 340 { 341 return hitTestLines( info, _x, _y, _tx, _ty, hitTestAction);341 return hitTestLines(result, _x, _y, _tx, _ty, hitTestAction); 342 342 } 343 343 -
trunk/WebCore/rendering/RenderInline.h
r17399 r17426 58 58 virtual void layout() {} // Do nothing for layout() 59 59 60 virtual void paint(PaintInfo& i, int tx, int ty);60 virtual void paint(PaintInfo&, int tx, int ty); 61 61 62 virtual bool nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, 63 HitTestAction hitTestAction); 62 virtual bool nodeAtPoint(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction); 64 63 65 64 virtual void calcMinMaxWidth(); -
trunk/WebCore/rendering/RenderLayer.cpp
r17402 r17426 866 866 867 867 if (currentFrame->mouseDownMayStartSelect()) { 868 HitTestResult re nderInfo(currentPos, true, false, true);869 if (hitTest(re nderInfo)) {870 VisiblePosition pos(re nderInfo.innerNode()->renderer()->positionForPoint(currentPos));868 HitTestResult result(currentPos, true, false, true); 869 if (hitTest(result)) { 870 VisiblePosition pos(result.innerNode()->renderer()->positionForPoint(currentPos)); 871 871 currentFrame->updateSelectionForMouseDragOverPosition(pos); 872 872 } … … 1472 1472 } 1473 1473 1474 bool RenderLayer::hitTest(HitTestResult& info)1474 bool RenderLayer::hitTest(HitTestResult& result) 1475 1475 { 1476 1476 renderer()->document()->updateLayout(); … … 1479 1479 boundsRect.intersect(frameVisibleRect(renderer())); 1480 1480 1481 RenderLayer* insideLayer = hitTestLayer(this, info, boundsRect);1481 RenderLayer* insideLayer = hitTestLayer(this, result, boundsRect); 1482 1482 1483 1483 // Now determine if the result is inside an anchor; make sure an image map wins if 1484 1484 // it already set URLElement and only use the innermost. 1485 Node* node = info.innerNode();1485 Node* node = result.innerNode(); 1486 1486 while (node) { 1487 if (node->isLink() && ! info.URLElement())1488 info.setURLElement(static_cast<Element*>(node));1487 if (node->isLink() && !result.URLElement()) 1488 result.setURLElement(static_cast<Element*>(node)); 1489 1489 node = node->parentNode(); 1490 1490 } 1491 1491 1492 1492 // Next set up the correct :hover/:active state along the new chain. 1493 updateHoverActiveState( info);1493 updateHoverActiveState(result); 1494 1494 1495 1495 // Now return whether we were inside this layer (this will always be true for the root … … 1498 1498 } 1499 1499 1500 RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, HitTestResult& info, const IntRect& hitTestRect)1500 RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, HitTestResult& result, const IntRect& hitTestRect) 1501 1501 { 1502 1502 // Calculate the clip rects we should use. … … 1519 1519 if (m_posZOrderList) { 1520 1520 for (int i = m_posZOrderList->size() - 1; i >= 0; --i) { 1521 insideLayer = m_posZOrderList->at(i)->hitTestLayer(rootLayer, info, hitTestRect);1521 insideLayer = m_posZOrderList->at(i)->hitTestLayer(rootLayer, result, hitTestRect); 1522 1522 if (insideLayer) 1523 1523 return insideLayer; … … 1528 1528 if (m_overflowList) { 1529 1529 for (int i = m_overflowList->size() - 1; i >= 0; --i) { 1530 insideLayer = m_overflowList->at(i)->hitTestLayer(rootLayer, info, hitTestRect);1530 insideLayer = m_overflowList->at(i)->hitTestLayer(rootLayer, result, hitTestRect); 1531 1531 if (insideLayer) 1532 1532 return insideLayer; … … 1535 1535 1536 1536 // Next we want to see if the mouse pos is inside the child RenderObjects of the layer. 1537 if (fgRect.contains( info.point()) &&1538 renderer()->hitTest( info, info.point().x(), info.point().y(),1537 if (fgRect.contains(result.point()) && 1538 renderer()->hitTest(result, result.point().x(), result.point().y(), 1539 1539 layerBounds.x() - renderer()->xPos(), 1540 1540 layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), HitTestDescendants)) { … … 1543 1543 // the content in the layer has an element. So just walk up 1544 1544 // the tree. 1545 if (! info.innerNode()) {1545 if (!result.innerNode()) { 1546 1546 for (RenderObject *r = renderer(); r != NULL; r = r->parent()) { 1547 1547 if (r->element()) { 1548 info.setInnerNode(r->element());1548 result.setInnerNode(r->element()); 1549 1549 break; 1550 1550 } … … 1552 1552 } 1553 1553 1554 if (! info.innerNonSharedNode()) {1554 if (!result.innerNonSharedNode()) { 1555 1555 for (RenderObject *r = renderer(); r != NULL; r = r->parent()) { 1556 1556 if (r->element()) { 1557 info.setInnerNonSharedNode(r->element());1557 result.setInnerNonSharedNode(r->element()); 1558 1558 break; 1559 1559 } … … 1566 1566 if (m_negZOrderList) { 1567 1567 for (int i = m_negZOrderList->size() - 1; i >= 0; --i) { 1568 insideLayer = m_negZOrderList->at(i)->hitTestLayer(rootLayer, info, hitTestRect);1568 insideLayer = m_negZOrderList->at(i)->hitTestLayer(rootLayer, result, hitTestRect); 1569 1569 if (insideLayer) 1570 1570 return insideLayer; … … 1576 1576 // contain the point so mouse move events keep getting delivered when dragging outside the 1577 1577 // window. 1578 if (bgRect.contains( info.point()) &&1579 renderer()->hitTest( info, info.point().x(), info.point().y(),1578 if (bgRect.contains(result.point()) && 1579 renderer()->hitTest(result, result.point().x(), result.point().y(), 1580 1580 layerBounds.x() - renderer()->xPos(), 1581 1581 layerBounds.y() - renderer()->yPos() + m_object->borderTopExtra(), … … 1585 1585 // We didn't hit any layer. However if the mouse is down, we must always at least be inside 1586 1586 // the render view. 1587 if ( info.active() && renderer()->isRenderView()) {1588 renderer()->setInnerNode( info);1587 if (result.active() && renderer()->isRenderView()) { 1588 renderer()->setInnerNode(result); 1589 1589 return this; 1590 1590 } … … 1830 1830 } 1831 1831 1832 void RenderLayer::updateHoverActiveState(HitTestResult& info)1833 { 1834 // We don't update :hover/:active state when the infois marked as readonly.1835 if ( info.readonly())1832 void RenderLayer::updateHoverActiveState(HitTestResult& result) 1833 { 1834 // We don't update :hover/:active state when the result is marked as readonly. 1835 if (result.readonly()) 1836 1836 return; 1837 1837 … … 1840 1840 1841 1841 Node* activeNode = doc->activeNode(); 1842 if (activeNode && ! info.active()) {1842 if (activeNode && !result.active()) { 1843 1843 // We are clearing the :active chain because the mouse has been released. 1844 1844 for (RenderObject* curr = activeNode->renderer(); curr; curr = curr->parent()) { … … 1848 1848 doc->setActiveNode(0); 1849 1849 } else { 1850 Node* newActiveNode = info.innerNode();1851 if (!activeNode && newActiveNode && info.active()) {1850 Node* newActiveNode = result.innerNode(); 1851 if (!activeNode && newActiveNode && result.active()) { 1852 1852 // We are setting the :active chain and freezing it. If future moves happen, they 1853 1853 // will need to reference this chain. … … 1864 1864 // :hover/:active to only apply to elements that are in the :active chain that we froze 1865 1865 // at the time the mouse went down. 1866 bool mustBeInActiveChain = info.active() && info.mouseMove();1866 bool mustBeInActiveChain = result.active() && result.mouseMove(); 1867 1867 1868 1868 // Check to see if the hovered node has changed. If not, then we don't need to 1869 1869 // do anything. 1870 1870 Node* oldHoverNode = doc->hoverNode(); 1871 Node* newHoverNode = info.innerNode();1871 Node* newHoverNode = result.innerNode(); 1872 1872 1873 1873 // Update our current hover node. … … 1894 1894 for (RenderObject* curr = newHoverObj; curr; curr = curr->hoverAncestor()) { 1895 1895 if (curr->element() && !curr->isText() && (!mustBeInActiveChain || curr->element()->inActiveChain())) { 1896 curr->element()->setActive( info.active());1896 curr->element()->setActive(result.active()); 1897 1897 curr->element()->setHovered(true); 1898 1898 } -
trunk/WebCore/rendering/RenderListBox.cpp
r17399 r17426 327 327 } 328 328 329 bool RenderListBox::isPointInScrollbar(HitTestResult& info, int _x, int _y, int _tx, int _ty)329 bool RenderListBox::isPointInScrollbar(HitTestResult& result, int _x, int _y, int _tx, int _ty) 330 330 { 331 331 if (!m_vBar) … … 338 338 339 339 if (vertRect.contains(_x, _y)) { 340 info.setScrollbar(m_vBar->isWidget() ? static_cast<PlatformScrollbar*>(m_vBar) : 0);340 result.setScrollbar(m_vBar->isWidget() ? static_cast<PlatformScrollbar*>(m_vBar) : 0); 341 341 return true; 342 342 } -
trunk/WebCore/rendering/RenderObject.cpp
r17405 r17426 2535 2535 } 2536 2536 2537 bool RenderObject::hitTest(HitTestResult& info, int x, int y, int tx, int ty, HitTestFilter hitTestFilter)2537 bool RenderObject::hitTest(HitTestResult& result, int x, int y, int tx, int ty, HitTestFilter hitTestFilter) 2538 2538 { 2539 2539 bool inside = false; 2540 2540 if (hitTestFilter != HitTestSelf) { 2541 2541 // First test the foreground layer (lines and inlines). 2542 inside = nodeAtPoint( info, x, y, tx, ty, HitTestForeground);2542 inside = nodeAtPoint(result, x, y, tx, ty, HitTestForeground); 2543 2543 2544 2544 // Test floats next. 2545 2545 if (!inside) 2546 inside = nodeAtPoint( info, x, y, tx, ty, HitTestFloat);2546 inside = nodeAtPoint(result, x, y, tx, ty, HitTestFloat); 2547 2547 2548 2548 // Finally test to see if the mouse is in the background (within a child block's background). 2549 2549 if (!inside) 2550 inside = nodeAtPoint( info, x, y, tx, ty, HitTestChildBlockBackgrounds);2550 inside = nodeAtPoint(result, x, y, tx, ty, HitTestChildBlockBackgrounds); 2551 2551 } 2552 2552 2553 2553 // See if the mouse is inside us but not any of our descendants 2554 2554 if (hitTestFilter != HitTestDescendants && !inside) 2555 inside = nodeAtPoint( info, x, y, tx, ty, HitTestBlockBackground);2555 inside = nodeAtPoint(result, x, y, tx, ty, HitTestBlockBackground); 2556 2556 2557 2557 return inside; 2558 2558 } 2559 2559 2560 void RenderObject::setInnerNode(HitTestResult& info)2561 { 2562 if ( info.innerNode())2560 void RenderObject::setInnerNode(HitTestResult& result) 2561 { 2562 if (result.innerNode()) 2563 2563 return; 2564 2564 … … 2573 2573 2574 2574 if (node) { 2575 info.setInnerNode(node);2576 if (! info.innerNonSharedNode())2577 info.setInnerNonSharedNode(node);2578 } 2579 } 2580 2581 bool RenderObject::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty,2575 result.setInnerNode(node); 2576 if (!result.innerNonSharedNode()) 2577 result.setInnerNonSharedNode(node); 2578 } 2579 } 2580 2581 bool RenderObject::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, 2582 2582 HitTestAction hitTestAction) 2583 2583 { -
trunk/WebCore/rendering/RenderObject.h
r17399 r17426 501 501 }; 502 502 503 bool hitTest(HitTestResult& info, int x, int y, int tx, int ty, HitTestFilter hitTestFilter = HitTestAll); 504 virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, 505 HitTestAction hitTestAction); 506 void setInnerNode(HitTestResult& info); 503 bool hitTest(HitTestResult&, int x, int y, int tx, int ty, HitTestFilter hitTestFilter = HitTestAll); 504 virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 505 void setInnerNode(HitTestResult&); 507 506 508 507 virtual VisiblePosition positionForCoordinates(int x, int y); -
trunk/WebCore/rendering/RenderPath.cpp
r17399 r17426 284 284 } 285 285 286 bool RenderPath::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)286 bool RenderPath::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 287 287 { 288 288 // We only draw in the forground phase, so we only hit-test then. … … 296 296 if ((hitRules.canHitStroke && (style()->svgStyle()->hasStroke() || !hitRules.requireStroke) && strokeContains(hitPoint, hitRules.requireStroke)) 297 297 || (hitRules.canHitFill && (style()->svgStyle()->hasFill() || !hitRules.requireFill) && fillContains(hitPoint, hitRules.requireFill))) { 298 setInnerNode( info);298 setInnerNode(result); 299 299 return true; 300 300 } -
trunk/WebCore/rendering/RenderSVGImage.cpp
r17399 r17426 206 206 } 207 207 208 bool RenderSVGImage::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)208 bool RenderSVGImage::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 209 209 { 210 210 AffineTransform totalTransform = absoluteTransform(); … … 212 212 double localX, localY; 213 213 totalTransform.invert().map(_x + _tx, _y + _ty, &localX, &localY); 214 return RenderImage::nodeAtPoint( info, (int)localX, (int)localY, 0, 0, hitTestAction);214 return RenderImage::nodeAtPoint(result, (int)localX, (int)localY, 0, 0, hitTestAction); 215 215 } 216 216 -
trunk/WebCore/rendering/RenderSVGText.cpp
r17399 r17426 96 96 } 97 97 98 bool RenderSVGText::nodeAtPoint(HitTestResult& info, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)98 bool RenderSVGText::nodeAtPoint(HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction) 99 99 { 100 100 AffineTransform totalTransform = absoluteTransform(); 101 101 double localX, localY; 102 102 totalTransform.invert().map(_x, _y, &localX, &localY); 103 return RenderBlock::nodeAtPoint( info, (int)localX, (int)localY, _tx, _ty, hitTestAction);103 return RenderBlock::nodeAtPoint(result, (int)localX, (int)localY, _tx, _ty, hitTestAction); 104 104 } 105 105 -
trunk/WebCore/rendering/RenderTableRow.cpp
r17399 r17426 139 139 140 140 // Hit Testing 141 bool RenderTableRow::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action)141 bool RenderTableRow::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action) 142 142 { 143 143 // Table rows cannot ever be hit tested. Effectively they do not exist. … … 148 148 // table-specific hit-test method (which we should do for performance reasons anyway), 149 149 // then we can remove this check. 150 if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint( info, x, y, tx, ty, action)) {151 setInnerNode( info);150 if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(result, x, y, tx, ty, action)) { 151 setInnerNode(result); 152 152 return true; 153 153 } -
trunk/WebCore/rendering/RenderTableRow.h
r17399 r17426 46 46 virtual void layout(); 47 47 virtual IntRect getAbsoluteRepaintRect(); 48 virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action);48 virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 49 49 50 50 // The only time rows get a layer is when they have transparency. -
trunk/WebCore/rendering/RenderTableSection.cpp
r17399 r17426 987 987 988 988 // Hit Testing 989 bool RenderTableSection::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action)989 bool RenderTableSection::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction action) 990 990 { 991 991 // Table sections cannot ever be hit tested. Effectively they do not exist. … … 999 999 // table-specific hit-test method (which we should do for performance reasons anyway), 1000 1000 // then we can remove this check. 1001 if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint( info, x, y, tx, ty, action)) {1002 setInnerNode( info);1001 if (!child->layer() && !child->isInlineFlow() && child->nodeAtPoint(result, x, y, tx, ty, action)) { 1002 setInnerNode(result); 1003 1003 return true; 1004 1004 } -
trunk/WebCore/rendering/RenderTableSection.h
r17399 r17426 112 112 virtual RenderObject* removeChildNode(RenderObject* child); 113 113 114 virtual bool nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction action);114 virtual bool nodeAtPoint(HitTestResult&, int x, int y, int tx, int ty, HitTestAction); 115 115 116 116 // this gets a cell grid data structure. changing the number of -
trunk/WebCore/rendering/RenderTextControl.cpp
r17399 r17426 346 346 } 347 347 348 bool RenderTextControl::nodeAtPoint(HitTestResult& info, int x, int y, int tx, int ty, HitTestAction hitTestAction)348 bool RenderTextControl::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction) 349 349 { 350 350 // If we're within the text control, we want to act as if we've hit the inner div, incase the point 351 351 // was on the control but not on the div (see Radar 4617841). 352 if (RenderFlexibleBox::nodeAtPoint( info, x, y, tx, ty, hitTestAction)) {353 info.setInnerNode(m_div.get());352 if (RenderFlexibleBox::nodeAtPoint(result, x, y, tx, ty, hitTestAction)) { 353 result.setInnerNode(m_div.get()); 354 354 return true; 355 355 } -
trunk/WebCore/rendering/RootInlineBox.cpp
r17399 r17426 143 143 } 144 144 145 bool RootInlineBox::nodeAtPoint(HitTestResult& i, int x, int y, int tx, int ty)145 bool RootInlineBox::nodeAtPoint(HitTestResult& result, int x, int y, int tx, int ty) 146 146 { 147 147 if (m_ellipsisBox && object()->style()->visibility() == VISIBLE) { 148 if (m_ellipsisBox->nodeAtPoint( i, x, y, tx, ty)) {149 object()->setInnerNode( i);148 if (m_ellipsisBox->nodeAtPoint(result, x, y, tx, ty)) { 149 object()->setInnerNode(result); 150 150 return true; 151 151 } 152 152 } 153 return InlineFlowBox::nodeAtPoint( i, x, y, tx, ty);153 return InlineFlowBox::nodeAtPoint(result, x, y, tx, ty); 154 154 } 155 155 -
trunk/WebCore/rendering/RootInlineBox.h
r17399 r17426 89 89 EllipsisBox* ellipsisBox() const { return m_ellipsisBox; } 90 90 91 void paintEllipsisBox(RenderObject::PaintInfo& i, int _tx, int _ty) const; 92 bool hitTestEllipsisBox(HitTestResult& info, int _x, int _y, int _tx, int _ty, 93 HitTestAction hitTestAction, bool inBox); 91 void paintEllipsisBox(RenderObject::PaintInfo&, int _tx, int _ty) const; 92 bool hitTestEllipsisBox(HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction, bool); 94 93 95 94 virtual void clearTruncation();
Note:
See TracChangeset
for help on using the changeset viewer.