Changeset 58362 in webkit
- Timestamp:
- Apr 27, 2010 5:55:06 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r58360 r58362 1 2010-04-27 Jens Alfke <snej@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 [Chromium] Add some notifications and an accessor to WebKit API 6 https://bugs.webkit.org/show_bug.cgi?id=37625 7 8 * dom/Node.cpp: 9 (WebCore::Node::hasNonEmptyBoundingBox): New method. 10 * dom/Node.h: 11 * html/HTMLAnchorElement.cpp: 12 (WebCore::HTMLAnchorElement::isKeyboardFocusable): Moved part of method into new Node method 13 1 14 2010-04-27 Jochen Eisinger <jochen@chromium.org> 2 15 -
trunk/WebCore/dom/Node.cpp
r57839 r58362 763 763 } 764 764 765 bool Node::hasNonEmptyBoundingBox() const 766 { 767 // Before calling absoluteRects, check for the common case where the renderer 768 // is non-empty, since this is a faster check and almost always returns true. 769 RenderBoxModelObject* box = renderBoxModelObject(); 770 if (!box) 771 return false; 772 if (!box->borderBoundingBox().isEmpty()) 773 return true; 774 775 Vector<IntRect> rects; 776 FloatPoint absPos = renderer()->localToAbsolute(); 777 renderer()->absoluteRects(rects, absPos.x(), absPos.y()); 778 size_t n = rects.size(); 779 for (size_t i = 0; i < n; ++i) 780 if (!rects[i].isEmpty()) 781 return true; 782 783 return false; 784 } 785 765 786 void Node::setNeedsStyleRecalc(StyleChangeType changeType) 766 787 { -
trunk/WebCore/dom/Node.h
r57809 r58362 312 312 virtual IntRect getRect() const; 313 313 314 // Returns true if the node has a non-empty bounding box in layout. 315 // This does not 100% guarantee the user can see it, but is pretty close. 316 // Note: This method only works properly after layout has occurred. 317 bool hasNonEmptyBoundingBox() const; 318 314 319 virtual void recalcStyle(StyleChange = NoChange) { } 315 320 -
trunk/WebCore/html/HTMLAnchorElement.cpp
r56128 r58362 103 103 return false; 104 104 105 if (!renderer() || !renderer()->isBoxModelObject()) 106 return false; 107 108 // Before calling absoluteRects, check for the common case where the renderer 109 // is non-empty, since this is a faster check and almost always returns true. 110 RenderBoxModelObject* box = toRenderBoxModelObject(renderer()); 111 if (!box->borderBoundingBox().isEmpty()) 112 return true; 113 114 Vector<IntRect> rects; 115 FloatPoint absPos = renderer()->localToAbsolute(); 116 renderer()->absoluteRects(rects, absPos.x(), absPos.y()); 117 size_t n = rects.size(); 118 for (size_t i = 0; i < n; ++i) 119 if (!rects[i].isEmpty()) 120 return true; 121 122 return false; 105 return hasNonEmptyBoundingBox(); 123 106 } 124 107 -
trunk/WebKit/chromium/ChangeLog
r58358 r58362 1 2010-04-27 Jens Alfke <snej@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 [Chromium] Add some notifications and an accessor to WebKit API 6 https://bugs.webkit.org/show_bug.cgi?id=37625 7 8 * public/WebFrameClient.h: 9 (WebKit::WebFrameClient::didFirstLayout): 10 (WebKit::WebFrameClient::didFirstVisuallyNonEmptyLayout): 11 * public/WebNode.h: 12 * src/FrameLoaderClientImpl.cpp: 13 (WebKit::FrameLoaderClientImpl::dispatchDidFirstLayout): 14 (WebKit::FrameLoaderClientImpl::dispatchDidFirstVisuallyNonEmptyLayout): 15 * src/WebElement.cpp: 16 * src/WebNode.cpp: 17 (WebKit::WebNode::hasNonEmptyBoundingBox): 18 1 19 2010-04-27 Darin Fisher <darin@chromium.org> 2 20 -
trunk/WebKit/chromium/public/WebFrameClient.h
r58358 r58362 294 294 // Geometry notifications ---------------------------------------------- 295 295 296 // The frame's document finished the initial layout of a page. 297 virtual void didFirstLayout(WebFrame*) { } 298 299 // The frame's document finished the initial non-empty layout of a page. 300 virtual void didFirstVisuallyNonEmptyLayout(WebFrame*) { } 301 296 302 // The size of the content area changed. 297 303 virtual void didChangeContentsSize(WebFrame*, const WebSize&) { } -
trunk/WebKit/chromium/public/WebNode.h
r57158 r58362 102 102 WEBKIT_API WebNodeList getElementsByTagName(const WebString&) const; 103 103 104 // Returns true if the node has a non-empty bounding box in layout. 105 // This does not 100% guarantee the user can see it, but is pretty close. 106 // Note: This method only works properly after layout has occurred. 107 WEBKIT_API bool hasNonEmptyBoundingBox() const; 108 104 109 // Deprecated. Use to() instead. 105 110 template<typename T> T toElement() -
trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp
r58358 r58362 790 790 void FrameLoaderClientImpl::dispatchDidFirstLayout() 791 791 { 792 if (m_webFrame->client()) 793 m_webFrame->client()->didFirstLayout(m_webFrame); 792 794 } 793 795 794 796 void FrameLoaderClientImpl::dispatchDidFirstVisuallyNonEmptyLayout() 795 797 { 796 // FIXME: called when webkit finished layout of a page that was visually non-empty.797 // All resources have not necessarily finished loading.798 if (m_webFrame->client()) 799 m_webFrame->client()->didFirstVisuallyNonEmptyLayout(m_webFrame); 798 800 } 799 801 -
trunk/WebKit/chromium/src/WebElement.cpp
r56637 r58362 33 33 34 34 #include "Element.h" 35 #include "RenderBoxModelObject.h" 36 #include "RenderObject.h" 35 37 #include <wtf/PassRefPtr.h> 36 38 -
trunk/WebKit/chromium/src/WebNode.cpp
r57158 r58362 179 179 } 180 180 181 bool WebNode::hasNonEmptyBoundingBox() const 182 { 183 return m_private->hasNonEmptyBoundingBox(); 184 } 185 181 186 WebNode::WebNode(const PassRefPtr<Node>& node) 182 187 : m_private(node)
Note: See TracChangeset
for help on using the changeset viewer.