Changeset 128006 in webkit
- Timestamp:
- Sep 9, 2012, 5:29:21 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128005 r128006 1 2012-09-09 Emil A Eklund <eae@chromium.org> 2 3 Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect 4 https://bugs.webkit.org/show_bug.cgi?id=81413 5 6 Reviewed by David Hyatt. 7 8 Rename Node::getRect and getPixelSnappedRect to boundingBox and 9 pixelSnappedBoundingBox respectively. 10 11 Remove overridden getRect method from ContainerNode as it calculates the 12 same rect as the Node implementation but in a more complicated and 13 error-prone way. Also remove the getUpperLeftCorner/getLowerRightCorner 14 support functions as they are no longer needed. 15 16 No new tests, no change in functionality. 17 18 * accessibility/AccessibilitySlider.cpp: 19 (WebCore::AccessibilitySliderThumb::elementRect): 20 Update to call boundingBox. 21 22 * dom/ContainerNode.cpp: 23 * dom/ContainerNode.h: 24 Remove overridden getRect method and the getUpperLeftCorner/ 25 getLowerRightCorner support methods . 26 27 * dom/Element.cpp: 28 (WebCore::Element::scrollIntoView): 29 (WebCore::Element::scrollIntoViewIfNeeded): 30 (WebCore::Element::updateFocusAppearance): 31 Update to call boundingBox. 32 33 * dom/Node.h: 34 * dom/Node.cpp: 35 (WebCore::Node::boundingBox): 36 Rename getRect to boundingBox. 37 38 (WebCore::Node::pixelSnappedBoundingBox): 39 Rename getPixelSnappedRect to pixelSnappedBoundingBox. 40 41 * html/ColorInputType.cpp: 42 (WebCore::ColorInputType::elementRectRelativeToRootView): 43 * html/ValidationMessage.cpp: 44 (WebCore::ValidationMessage::buildBubbleTree): 45 * html/shadow/CalendarPickerElement.cpp: 46 (WebCore::CalendarPickerElement::openPopup): 47 * html/shadow/TextControlInnerElements.cpp: 48 (WebCore::InputFieldSpeechButtonElement::startSpeechInput): 49 * page/FrameView.cpp: 50 (WebCore::FrameView::scrollElementToRect): 51 (WebCore::FrameView::scrollToAnchor): 52 * page/SpatialNavigation.cpp: 53 (WebCore::nodeRectInAbsoluteCoordinates): 54 Update to call boundingBox/pixelSnappedBoundingBox. 55 1 56 2012-09-09 Christopher Cameron <ccameron@chromium.org> 2 57 -
trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp
r123428 r128006 178 178 if (!sliderRenderer || !sliderRenderer->isSlider()) 179 179 return LayoutRect(); 180 return sliderThumbElementOf(sliderRenderer->node())-> getRect();180 return sliderThumbElementOf(sliderRenderer->node())->boundingBox(); 181 181 } 182 182 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r127534 r128006 721 721 } 722 722 723 bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const724 {725 if (!renderer())726 return false;727 // What is this code really trying to do?728 RenderObject *o = renderer();729 RenderObject *p = o;730 731 if (!o->isInline() || o->isReplaced()) {732 point = o->localToAbsolute(FloatPoint(), false, true);733 return true;734 }735 736 // find the next text/image child, to get a position737 while (o) {738 p = o;739 if (o->firstChild())740 o = o->firstChild();741 else if (o->nextSibling())742 o = o->nextSibling();743 else {744 RenderObject *next = 0;745 while (!next && o->parent()) {746 o = o->parent();747 next = o->nextSibling();748 }749 o = next;750 751 if (!o)752 break;753 }754 ASSERT(o);755 756 if (!o->isInline() || o->isReplaced()) {757 point = o->localToAbsolute(FloatPoint(), false, true);758 return true;759 }760 761 if (p->node() && p->node() == this && o->isText() && !o->isBR() && !toRenderText(o)->firstTextBox()) {762 // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor763 } else if ((o->isText() && !o->isBR()) || o->isReplaced()) {764 point = FloatPoint();765 if (o->isText() && toRenderText(o)->firstTextBox()) {766 point.move(toRenderText(o)->linesBoundingBox().x(),767 toRenderText(o)->firstTextBox()->root()->lineTop());768 } else if (o->isBox()) {769 RenderBox* box = toRenderBox(o);770 point.moveBy(box->location());771 }772 point = o->container()->localToAbsolute(point, false, true);773 return true;774 }775 }776 777 // If the target doesn't have any children or siblings that could be used to calculate the scroll position, we must be778 // at the end of the document. Scroll to the bottom. FIXME: who said anything about scrolling?779 if (!o && document()->view()) {780 point = FloatPoint(0, document()->view()->contentsHeight());781 return true;782 }783 return false;784 }785 786 bool ContainerNode::getLowerRightCorner(FloatPoint& point) const787 {788 if (!renderer())789 return false;790 791 RenderObject* o = renderer();792 if (!o->isInline() || o->isReplaced()) {793 RenderBox* box = toRenderBox(o);794 point = o->localToAbsolute(LayoutPoint(box->size()), false, true);795 return true;796 }797 798 // find the last text/image child, to get a position799 while (o) {800 if (o->lastChild())801 o = o->lastChild();802 else if (o->previousSibling())803 o = o->previousSibling();804 else {805 RenderObject* prev = 0;806 while (!prev) {807 o = o->parent();808 if (!o)809 return false;810 prev = o->previousSibling();811 }812 o = prev;813 }814 ASSERT(o);815 if (o->isText() || o->isReplaced()) {816 point = FloatPoint();817 if (o->isText()) {818 RenderText* text = toRenderText(o);819 IntRect linesBox = text->linesBoundingBox();820 if (!linesBox.maxX() && !linesBox.maxY())821 continue;822 point.moveBy(linesBox.maxXMaxYCorner());823 } else {824 RenderBox* box = toRenderBox(o);825 point.moveBy(box->frameRect().maxXMaxYCorner());826 }827 point = o->container()->localToAbsolute(point, false, true);828 return true;829 }830 }831 return true;832 }833 834 LayoutRect ContainerNode::getRect() const835 {836 FloatPoint upperLeft, lowerRight;837 bool foundUpperLeft = getUpperLeftCorner(upperLeft);838 bool foundLowerRight = getLowerRightCorner(lowerRight);839 840 // If we've found one corner, but not the other,841 // then we should just return a point at the corner that we did find.842 if (foundUpperLeft != foundLowerRight) {843 if (foundUpperLeft)844 lowerRight = upperLeft;845 else846 upperLeft = lowerRight;847 }848 849 return enclosingLayoutRect(FloatRect(upperLeft, lowerRight.expandedTo(upperLeft) - upperLeft));850 }851 852 723 void ContainerNode::setFocus(bool received) 853 724 { -
trunk/Source/WebCore/dom/ContainerNode.h
r127593 r128006 76 76 virtual void attach() OVERRIDE; 77 77 virtual void detach() OVERRIDE; 78 virtual LayoutRect getRect() const OVERRIDE;79 78 virtual void setFocus(bool = true) OVERRIDE; 80 79 virtual void setActive(bool active = true, bool pause = false) OVERRIDE; … … 132 131 133 132 static void dispatchPostAttachCallbacks(); 134 135 bool getUpperLeftCorner(FloatPoint&) const;136 bool getLowerRightCorner(FloatPoint&) const;137 133 138 134 Node* m_firstChild; -
trunk/Source/WebCore/dom/Element.cpp
r127706 r128006 284 284 return; 285 285 286 LayoutRect bounds = getRect();286 LayoutRect bounds = boundingBox(); 287 287 // Align to the top / bottom and to the closest edge. 288 288 if (alignToTop) … … 299 299 return; 300 300 301 LayoutRect bounds = getRect();301 LayoutRect bounds = boundingBox(); 302 302 if (centerIfNeeded) 303 303 renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded); … … 1640 1640 } 1641 1641 } else if (renderer() && !renderer()->isWidget()) 1642 renderer()->scrollRectToVisible( getRect());1642 renderer()->scrollRectToVisible(boundingBox()); 1643 1643 } 1644 1644 -
trunk/Source/WebCore/dom/Node.cpp
r127869 r128006 797 797 } 798 798 799 LayoutRect Node:: getRect() const799 LayoutRect Node::boundingBox() const 800 800 { 801 801 if (renderer()) -
trunk/Source/WebCore/dom/Node.h
r127228 r128006 402 402 403 403 virtual bool shouldUseInputMethod(); 404 virtual LayoutRect getRect() const;405 IntRect getPixelSnappedRect() const { return pixelSnappedIntRect(getRect()); }404 virtual LayoutRect boundingBox() const; 405 IntRect pixelSnappedBoundingBox() const { return pixelSnappedIntRect(boundingBox()); } 406 406 LayoutRect renderRect(bool* isReplaced); 407 407 IntRect pixelSnappedRenderRect(bool* isReplaced) { return pixelSnappedIntRect(renderRect(isReplaced)); } -
trunk/Source/WebCore/html/ColorInputType.cpp
r124299 r128006 209 209 IntRect ColorInputType::elementRectRelativeToRootView() const 210 210 { 211 return element()->document()->view()->contentsToRootView(element()-> getPixelSnappedRect());211 return element()->document()->view()->contentsToRootView(element()->pixelSnappedBoundingBox()); 212 212 } 213 213 -
trunk/Source/WebCore/html/ValidationMessage.cpp
r123713 r128006 147 147 ASSERT(!ec); 148 148 host->document()->updateLayout(); 149 adjustBubblePosition(host-> getRect(), m_bubble.get());149 adjustBubblePosition(host->boundingBox(), m_bubble.get()); 150 150 151 151 RefPtr<HTMLDivElement> clipper = HTMLDivElement::create(doc); -
trunk/Source/WebCore/html/shadow/CalendarPickerElement.cpp
r127558 r128006 139 139 else 140 140 parameters.step = step.toDouble(); 141 parameters.anchorRectInRootView = document()->view()->contentsToRootView(hostInput()-> getPixelSnappedRect());141 parameters.anchorRectInRootView = document()->view()->contentsToRootView(hostInput()->pixelSnappedBoundingBox()); 142 142 parameters.currentValue = input->value(); 143 143 // FIXME: parameters.suggestionValues and suggestionLabels will be used when we support datalist. -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r126359 r128006 426 426 AtomicString language = input->computeInheritedLanguage(); 427 427 String grammar = input->getAttribute(webkitgrammarAttr); 428 IntRect rect = document()->view()->contentsToRootView( getPixelSnappedRect());428 IntRect rect = document()->view()->contentsToRootView(pixelSnappedBoundingBox()); 429 429 if (speechInput()->startRecognition(m_listenerId, rect, language, grammar, document()->securityOrigin())) 430 430 setState(Recording); -
trunk/Source/WebCore/page/FrameView.cpp
r127783 r128006 1744 1744 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 1745 1745 1746 LayoutRect bounds = element-> getRect();1746 LayoutRect bounds = element->boundingBox(); 1747 1747 int centeringOffsetX = (rect.width() - bounds.width()) / 2; 1748 1748 int centeringOffsetY = (rect.height() - bounds.height()) / 2; … … 2342 2342 LayoutRect rect; 2343 2343 if (anchorNode != m_frame->document()) 2344 rect = anchorNode-> getRect();2344 rect = anchorNode->boundingBox(); 2345 2345 2346 2346 // Scroll nested layers and frames to reveal the anchor. -
trunk/Source/WebCore/page/SpatialNavigation.cpp
r120832 r128006 523 523 if (node->isDocumentNode()) 524 524 return frameRectInAbsoluteCoordinates(static_cast<Document*>(node)->frame()); 525 LayoutRect rect = rectToAbsoluteCoordinates(node->document()->frame(), node-> getRect());525 LayoutRect rect = rectToAbsoluteCoordinates(node->document()->frame(), node->boundingBox()); 526 526 527 527 // For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating -
trunk/Source/WebCore/page/TouchDisambiguation.cpp
r127876 r128006 59 59 continue; 60 60 } 61 result.unite( pixelSnappedIntRect(node->getRect()));61 result.unite(node->pixelSnappedBoundingBox()); 62 62 node = node->traverseNextNode(eventNode); 63 63 } -
trunk/Source/WebKit/chromium/ChangeLog
r127995 r128006 1 2012-09-09 Emil A Eklund <eae@chromium.org> 2 3 Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect 4 https://bugs.webkit.org/show_bug.cgi?id=81413 5 6 Reviewed by David Hyatt. 7 8 Update WebViewImpl to call boundingBox/pixelSnappedBoundingBox. 9 10 * src/WebViewImpl.cpp: 11 (WebKit::WebViewImpl::computeBlockBounds): 12 (WebKit::WebViewImpl::applyAutofillSuggestions): 13 (WebKit::WebViewImpl::refreshAutofillPopup): 14 1 15 2012-09-09 James Robinson <jamesr@chromium.org> 2 16 … … 16925 16939 (WebKit::WebAccessibilityObject::ariaLiveRegionRelevant): 16926 16940 (WebKit::WebAccessibilityObject::ariaLiveRegionStatus): 16927 (WebKit::WebAccessibilityObject::boundingBox Rect):16941 (WebKit::WebAccessibilityObject::boundingBox): 16928 16942 (WebKit::WebAccessibilityObject::estimatedLoadingProgress): 16929 16943 (WebKit::WebAccessibilityObject::helpText): -
trunk/Source/WebKit/chromium/src/LinkHighlight.cpp
r127952 r128006 150 150 151 151 bool pathHasChanged = false; 152 FloatRect boundingRect = m_node-> getPixelSnappedRect();152 FloatRect boundingRect = m_node->pixelSnappedBoundingBox(); 153 153 154 154 // FIXME: If we ever use a more sophisticated highlight path, we'll need -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r127952 r128006 1017 1017 // Return the bounding box in the window coordinate system. 1018 1018 if (node) { 1019 IntRect rect = node->Node:: getPixelSnappedRect();1019 IntRect rect = node->Node::pixelSnappedBoundingBox(); 1020 1020 Frame* frame = node->document()->frame(); 1021 1021 return frame->view()->contentsToWindow(rect); … … 3308 3308 } else { 3309 3309 m_autofillPopupShowing = true; 3310 m_autofillPopup->showInRect(focusedNode-> getPixelSnappedRect(), focusedNode->ownerDocument()->view(), 0);3310 m_autofillPopup->showInRect(focusedNode->pixelSnappedBoundingBox(), focusedNode->ownerDocument()->view(), 0); 3311 3311 } 3312 3312 } … … 3616 3616 } 3617 3617 3618 WebRect newWidgetRect = m_autofillPopup->refresh(focusedWebCoreNode()-> getPixelSnappedRect());3618 WebRect newWidgetRect = m_autofillPopup->refresh(focusedWebCoreNode()->pixelSnappedBoundingBox()); 3619 3619 // Let's resize the backing window if necessary. 3620 3620 WebPopupMenuImpl* popupMenu = static_cast<WebPopupMenuImpl*>(m_autofillPopup->client()); -
trunk/Source/WebKit/efl/ChangeLog
r127958 r128006 1 2012-09-09 Emil A Eklund <eae@chromium.org> 2 3 Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect 4 https://bugs.webkit.org/show_bug.cgi?id=81413 5 6 Reviewed by David Hyatt. 7 8 Update ewk_frame to call pixelSnappedBoundingBox. 9 10 * ewk/ewk_frame.cpp: 11 (ewk_frame_focused_element_geometry_get): 12 1 13 2012-09-07 Benjamin Poulain <bpoulain@apple.com> 2 14 -
trunk/Source/WebKit/efl/ewk/ewk_frame.cpp
r127876 r128006 899 899 if (!focusedNode) 900 900 return false; 901 WebCore::IntRect nodeRect = focusedNode-> getPixelSnappedRect();901 WebCore::IntRect nodeRect = focusedNode->pixelSnappedBoundingBox(); 902 902 if (x) 903 903 *x = nodeRect.x(); -
trunk/Source/WebKit/gtk/ChangeLog
r127889 r128006 1 2012-09-09 Emil A Eklund <eae@chromium.org> 2 3 Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect 4 https://bugs.webkit.org/show_bug.cgi?id=81413 5 6 Reviewed by David Hyatt. 7 8 Update ChromeClientGtk and webkitwebview to call pixelSnappedBoundingBox. 9 10 * WebCoreSupport/ChromeClientGtk.cpp: 11 (WebKit::ChromeClient::mouseDidMoveOverElement): 12 * webkit/webkitwebview.cpp: 13 (getLocationForKeyboardGeneratedContextMenu): 14 (webkit_web_view_query_tooltip): 15 1 16 2012-09-07 Martin Robinson <mrobinson@igalia.com> 2 17 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r127757 r128006 787 787 Frame* frame = node->document()->frame(); 788 788 FrameView* view = frame ? frame->view() : 0; 789 m_webView->priv->tooltipArea = view ? view->contentsToWindow(node-> getPixelSnappedRect()) : IntRect();789 m_webView->priv->tooltipArea = view ? view->contentsToWindow(node->pixelSnappedBoundingBox()) : IntRect(); 790 790 } else 791 791 m_webView->priv->tooltipArea = IntRect(); -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r127070 r128006 428 428 || (selection->selection().isCaret() && !selection->selection().isContentEditable())) { 429 429 if (Node* focusedNode = getFocusedNode(frame)) 430 return focusedNode-> getPixelSnappedRect().location();430 return focusedNode->pixelSnappedBoundingBox().location(); 431 431 432 432 // There was no selection and no focused node, so just put the context … … 1609 1609 if (!title.isEmpty()) { 1610 1610 if (FrameView* view = coreFrame->view()) { 1611 GdkRectangle area = view->contentsToWindow(node-> getPixelSnappedRect());1611 GdkRectangle area = view->contentsToWindow(node->pixelSnappedBoundingBox()); 1612 1612 gtk_tooltip_set_tip_area(tooltip, &area); 1613 1613 } -
trunk/Source/WebKit/qt/Api/qwebelement.cpp
r127238 r128006 547 547 if (!m_element) 548 548 return QRect(); 549 return m_element-> getPixelSnappedRect();549 return m_element->pixelSnappedBoundingBox(); 550 550 } 551 551 … … 1455 1455 view->updateLayoutAndStyleIfNeededRecursive(); 1456 1456 1457 IntRect rect = e-> getPixelSnappedRect();1457 IntRect rect = e->pixelSnappedBoundingBox(); 1458 1458 1459 1459 if (rect.size().isEmpty()) -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r127876 r128006 1578 1578 continue; 1579 1579 1580 IntRect currentElementBoundingRect = currentElement-> getPixelSnappedRect();1580 IntRect currentElementBoundingRect = currentElement->pixelSnappedBoundingBox(); 1581 1581 currentElementBoundingRect.intersect(touchRect); 1582 1582 -
trunk/Source/WebKit/qt/ChangeLog
r127876 r128006 1 2012-09-09 Emil A Eklund <eae@chromium.org> 2 3 Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect 4 https://bugs.webkit.org/show_bug.cgi?id=81413 5 6 Reviewed by David Hyatt. 7 8 Update qwebelement and qwebpage to call pixelSnappedBoundingBox. 9 10 * Api/qwebelement.cpp: 11 (QWebElement::geometry): 12 (QWebElement::render): 13 * Api/qwebpage.cpp: 14 (QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch): 15 1 16 2012-09-07 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 17 -
trunk/Source/WebKit2/ChangeLog
r128003 r128006 1 2012-09-09 Emil A Eklund <eae@chromium.org> 2 3 Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect 4 https://bugs.webkit.org/show_bug.cgi?id=81413 5 6 Reviewed by David Hyatt. 7 8 Update WebPage to call pixelSnappedBoundingBox. 9 10 * WebProcess/WebPage/WebPage.cpp: 11 (WebKit::WebPage::editorState): 12 1 13 2012-09-08 Sam Weinig <sam@webkit.org> 2 14 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r127956 r128006 516 516 517 517 if (selectionRoot) 518 result.editorRect = frame->view()->contentsToWindow(selectionRoot-> getPixelSnappedRect());518 result.editorRect = frame->view()->contentsToWindow(selectionRoot->pixelSnappedBoundingBox()); 519 519 520 520 RefPtr<Range> range;
Note:
See TracChangeset
for help on using the changeset viewer.