Changeset 127457 in webkit
- Timestamp:
- Sep 4, 2012 4:56:46 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r127451 r127457 1 2012-09-04 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 Allow child-frame content in hit-tests. 4 https://bugs.webkit.org/show_bug.cgi?id=95204 5 6 Reviewed by Antonio Gomes. 7 8 Update exported symbols. 9 10 * Source/autotools/symbols.filter: 11 1 12 2012-09-04 Jinwoo Song <jinwoo7.song@samsung.com> 2 13 -
trunk/LayoutTests/ChangeLog
r127456 r127457 1 2012-09-04 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 Allow child-frame content in hit-tests. 4 https://bugs.webkit.org/show_bug.cgi?id=95204 5 6 Reviewed by Antonio Gomes. 7 Touch-Adjustment test by Kevin Ellis 8 9 Two new tests for hit-testing child frame content. One for testing it as an option to 10 nodesFromRect, and one testing its improvement on touch adjustment on iframe boundaries. 11 12 * fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt: Added. 13 * fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html: Added. 14 * fast/dom/nodesFromRect/resources/child-frame.html: Added. 15 * fast/dom/nodesFromRect/resources/nodesFromRect.js: 16 (check): 17 (checkShadowContent): 18 (checkRect): 19 (nodesFromRectAsString): 20 * touchadjustment/iframe-boundary-expected.txt: Added. 21 * touchadjustment/iframe-boundary.html: Added. 22 * touchadjustment/resources/inner-content-page.html: Added. 23 * touchadjustment/resources/inner-navigation-frame.html: Added. 24 1 25 2012-09-04 Vsevolod Vlasov <vsevik@chromium.org> 2 26 -
trunk/LayoutTests/fast/dom/nodesFromRect/resources/nodesFromRect.js
r122473 r127457 2 2 * Contributors: 3 3 * * Antonio Gomes <tonikitoo@webkit.org> 4 **/ 4 * * Allan Sandfeld Jensen <allan.jensen@nokia.com> 5 **/ 5 6 6 7 function check(x, y, topPadding, rightPadding, bottomPadding, leftPadding, list, doc) … … 12 13 doc = document; 13 14 14 var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, false /* allow shadow content */ );15 var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, false /* allow shadow content */, false /* allow child-frame content */); 15 16 if (!nodes) 16 17 return; … … 46 47 doc = document; 47 48 48 var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, true /* allowShadowContent */ );49 var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, true /* allowShadowContent */, false /* allow child-frame content */); 49 50 if (!nodes) 50 51 return; … … 68 69 } 69 70 71 function checkRect(left, top, width, height, expectedNodeString, doc) 72 { 73 if (!window.internals) 74 return; 75 76 if (height <=0 || width <= 0) 77 return; 78 79 if (!doc) 80 doc = document; 81 82 var topPadding = height / 2; 83 var leftPadding = width / 2; 84 // FIXME: When nodesFromRect is changed to not add 1 to width and height, remove the correction here. 85 var bottomPadding = (height - 1) - topPadding; 86 var rightPadding = (width - 1) - leftPadding; 87 88 var nodeString = nodesFromRectAsString(doc, left + leftPadding, top + topPadding, topPadding, rightPadding, bottomPadding, leftPadding); 89 90 if (nodeString == expectedNodeString) { 91 testPassed("All correct nodes found for rect"); 92 } else { 93 testFailed("NodesFromRect should be [" + expectedNodeString + "] was [" + nodeString + "]"); 94 } 95 } 96 97 function nodesFromRectAsString(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding) 98 { 99 var nodeString = ""; 100 var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, true /* allow shadow content */, true /* allow child-frame content */); 101 if (!nodes) 102 return nodeString; 103 104 for (var i = 0; i < nodes.length; i++) { 105 if (nodes[i].nodeType == 1) { 106 nodeString += nodes[i].nodeName; 107 if (nodes[i].id) 108 nodeString += '#' + nodes[i].id; 109 else if (nodes[i].class) { 110 nodeString += '.' + nodes[i].class; 111 } 112 } else if (nodes[i].nodeType == 3) { 113 nodeString += "'" + nodes[i].data + "'"; 114 } else if (nodes[i].nodeType == 9) { 115 nodeString += "#document"; 116 } else { 117 continue; 118 } 119 if (i + 1 < nodes.length) { 120 nodeString += ", "; 121 } 122 } 123 return nodeString; 124 } 125 70 126 function getCenterFor(element) 71 127 { -
trunk/Source/WebCore/ChangeLog
r127455 r127457 1 2012-09-04 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 Allow child-frame content in hit-tests. 4 https://bugs.webkit.org/show_bug.cgi?id=95204 5 6 Reviewed by Antonio Gomes. 7 8 Refactors how EventHandler::hitTestResultAtPoint handles child-frame content, 9 it is now handled by the hit test itself controlled by the AllowChildFrameContent 10 flag in HitTestRequest. 11 12 Tests: fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html 13 touchadjustment/iframe-boundary.html 14 15 * WebCore.exp.in: 16 * WebCore.order: 17 * dom/Document.cpp: 18 (WebCore::Document::nodesFromRect): 19 * dom/Document.h: 20 (Document): 21 * page/EventHandler.cpp: 22 (WebCore::EventHandler::hitTestResultAtPoint): 23 * rendering/HitTestRequest.h: 24 (WebCore::HitTestRequest::allowChildFrameContent): 25 (WebCore::HitTestRequest::childFrameHitTest): 26 (WebCore::HitTestRequest::testChildFrameScrollBars): 27 * rendering/RenderFrameBase.cpp: 28 (WebCore::RenderFrameBase::nodeAtPoint): 29 (WebCore): 30 * rendering/RenderFrameBase.h: 31 (RenderFrameBase): 32 * rendering/RenderLayer.cpp: 33 (WebCore::RenderLayer::hitTest): 34 * testing/Internals.cpp: 35 (WebCore::Internals::nodesFromRect): 36 * testing/Internals.h: 37 (Internals): 38 * testing/Internals.idl: 39 1 40 2012-09-04 Christophe Dumez <christophe.dumez@intel.com> 2 41 -
trunk/Source/WebCore/WebCore.exp.in
r127280 r127457 1354 1354 __ZNK7WebCore8Document11completeURLERKN3WTF6StringE 1355 1355 __ZNK7WebCore8Document13axObjectCacheEv 1356 __ZNK7WebCore8Document13nodesFromRectEiijjjjbb 1356 __ZNK7WebCore8Document13nodesFromRectEiijjjjbbb 1357 1357 __ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE 1358 1358 __ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE -
trunk/Source/WebCore/WebCore.order
r125484 r127457 22786 22786 __ZNK7WebCore4Node20traversePreviousNodeEPKS0_ 22787 22787 __ZN7WebCore37jsNodeIteratorPrototypeFunctionDetachEPN3JSC9ExecStateE 22788 __ZNK7WebCore8Document13nodesFromRectEiijjjjb 22788 __ZNK7WebCore8Document13nodesFromRectEiijjjjbbb 22789 22789 __ZNK7WebCore8Document17handleZeroPaddingERKNS_14HitTestRequestERNS_13HitTestResultE 22790 22790 __ZN3WTF21ListHashSetTranslatorINS_6RefPtrIN7WebCore4NodeEEELm256ENS_7PtrHashIS4_EEE9translateERPNS_15ListHashSetNodeIS4_Lm256EEERKS4_PNS_24ListHashSetNodeAllocatorIS4_Lm256EEE -
trunk/Source/WebCore/dom/Document.cpp
r127438 r127457 1385 1385 // * making it receive the expading size of each direction separately, 1386 1386 // i.e. nodesFromRect(x, y, topSize, rightSize, bottomSize, leftSize); 1387 PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent ) const1387 PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const 1388 1388 { 1389 1389 // FIXME: Share code between this, elementFromPoint and caretRangeFromPoint. … … 1409 1409 if (allowShadowContent) 1410 1410 type |= HitTestRequest::AllowShadowContent; 1411 if (allowChildFrameContent) 1412 type |= HitTestRequest::AllowChildFrameContent; 1411 1413 1412 1414 HitTestRequest request(type); -
trunk/Source/WebCore/dom/Document.h
r127438 r127457 380 380 * If false, this method returns null for coordinates outside of the viewport. 381 381 */ 382 PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, 383 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent) const; 382 PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY, 383 unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, 384 bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent = false) const; 384 385 Element* elementFromPoint(int x, int y) const; 385 386 PassRefPtr<Range> caretRangeFromPoint(int x, int y); -
trunk/Source/WebCore/page/EventHandler.cpp
r127421 r127457 1050 1050 if (allowShadowContent) 1051 1051 hitType |= HitTestRequest::AllowShadowContent; 1052 if (testScrollbars == ShouldHitTestScrollbars) 1053 hitType |= HitTestRequest::TestChildFrameScrollBars; 1054 // We always need to handle child frame content. 1055 hitType |= HitTestRequest::AllowChildFrameContent; 1056 1052 1057 m_frame->contentRenderer()->hitTest(HitTestRequest(hitType), result); 1053 1058 1054 while (true) {1055 Node* n = result.innerNode();1056 if (!result.isOverWidget() || !n || !n->renderer() || !n->renderer()->isWidget())1057 break;1058 RenderWidget* renderWidget = toRenderWidget(n->renderer());1059 Widget* widget = renderWidget->widget();1060 if (!widget || !widget->isFrameView())1061 break;1062 Frame* frame = static_cast<HTMLFrameElementBase*>(n)->contentFrame();1063 if (!frame || !frame->contentRenderer())1064 break;1065 FrameView* view = static_cast<FrameView*>(widget);1066 LayoutPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(),1067 result.localPoint().y() + view->scrollY() - renderWidget->borderTop() - renderWidget->paddingTop());1068 HitTestResult widgetHitTestResult(widgetPoint, padding.height(), padding.width(), padding.height(), padding.width());1069 frame->contentRenderer()->hitTest(HitTestRequest(hitType), widgetHitTestResult);1070 result = widgetHitTestResult;1071 1072 if (testScrollbars == ShouldHitTestScrollbars) {1073 Scrollbar* eventScrollbar = view->scrollbarAtPoint(roundedIntPoint(point));1074 if (eventScrollbar)1075 result.setScrollbar(eventScrollbar);1076 }1077 }1078 1079 1059 // If our HitTestResult is not visible, then we started hit testing too far down the frame chain. 1080 1060 // Another hit test at the main frame level should get us the correct visible result. -
trunk/Source/WebCore/rendering/HitTestRequest.h
r127421 r127457 36 36 SVGClipContent = 1 << 6, 37 37 TouchEvent = 1 << 7, 38 AllowShadowContent = 1 << 8 38 AllowShadowContent = 1 << 8, 39 AllowChildFrameContent = 1 << 9, 40 ChildFrameHitTest = 1 << 10, 41 TestChildFrameScrollBars = 1 << 11 39 42 }; 40 43 … … 55 58 bool mouseEvent() const { return !touchEvent(); } 56 59 bool allowsShadowContent() const { return m_requestType & AllowShadowContent; } 60 bool allowsChildFrameContent() const { return m_requestType & AllowChildFrameContent; } 61 bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; } 62 bool shouldTestChildFrameScrollBars() const { return m_requestType & TestChildFrameScrollBars; } 57 63 58 64 // Convenience functions -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r127423 r127457 105 105 , m_transformedPoint(other.m_transformedPoint) 106 106 , m_transformedRect(other.m_transformedRect) 107 , m_region(region )107 , m_region(region ? region : other.m_region) 108 108 , m_isRectBased(other.m_isRectBased) 109 109 , m_isRectilinear(other.m_isRectilinear) -
trunk/Source/WebCore/rendering/HitTestResult.h
r127421 r127457 56 56 HitTestLocation(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); 57 57 // Make a copy the HitTestLocation in a new region by applying given offset to internal point and area. 58 HitTestLocation(const HitTestLocation&, const LayoutSize& offset, RenderRegion* );58 HitTestLocation(const HitTestLocation&, const LayoutSize& offset, RenderRegion* = 0); 59 59 HitTestLocation(const HitTestLocation&); 60 60 ~HitTestLocation(); -
trunk/Source/WebCore/rendering/RenderFrameBase.cpp
r117451 r127457 30 30 #include "FrameView.h" 31 31 #include "HTMLFrameElementBase.h" 32 #include "HitTestResult.h" 33 #include "RenderLayer.h" 32 34 #include "RenderView.h" 33 35 … … 105 107 } 106 108 109 bool RenderFrameBase::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action) 110 { 111 if (request.allowsChildFrameContent()) { 112 FrameView* childFrameView = static_cast<FrameView*>(widget()); 113 RenderView* childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->contentRenderer()) : 0; 114 115 if (childRoot) { 116 LayoutPoint adjustedLocation = accumulatedOffset + location(); 117 HitTestLocation newHitTestLocation(locationInContainer, -toLayoutSize(adjustedLocation)); 118 HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildFrameHitTest); 119 120 bool isInsideChildFrame = childRoot->layer()->hitTest(newHitTestRequest, newHitTestLocation, result); 121 if (isInsideChildFrame) 122 return true; 123 124 if (request.shouldTestChildFrameScrollBars()) { 125 // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls, 126 // so we need to test ScrollView scrollbars separately here. 127 // FIXME: Consider if this test could be done unconditionally. 128 Scrollbar* frameScrollbar = childFrameView->scrollbarAtPoint(newHitTestLocation.roundedPoint()); 129 if (frameScrollbar) 130 result.setScrollbar(frameScrollbar); 131 } 132 } 133 } 134 135 return RenderPart::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, action); 107 136 } 137 138 } -
trunk/Source/WebCore/rendering/RenderFrameBase.h
r69437 r127457 37 37 38 38 public: 39 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE; 39 40 void layoutWithFlattening(bool fixedWidth, bool fixedHeight); 40 41 }; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r127421 r127457 3462 3462 // return ourselves. We do this so mouse events continue getting delivered after a drag has 3463 3463 // exited the WebView, and so hit testing over a scrollbar hits the content document. 3464 if ( (request.active() || request.release()) && isRootLayer()) {3464 if (!request.isChildFrameHitTest() && (request.active() || request.release()) && isRootLayer()) { 3465 3465 renderer()->updateHitTestResult(result, toRenderView(renderer())->flipForWritingMode(result.point())); 3466 3466 insideLayer = this; -
trunk/Source/WebCore/testing/Internals.cpp
r126080 r127457 967 967 968 968 PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding, 969 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode& ec) const969 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode& ec) const 970 970 { 971 971 if (!document || !document->frame() || !document->frame()->view()) { … … 974 974 } 975 975 976 return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent );976 return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent, allowChildFrameContent); 977 977 } 978 978 -
trunk/Source/WebCore/testing/Internals.h
r126080 r127457 161 161 162 162 PassRefPtr<NodeList> nodesFromRect(Document*, int x, int y, unsigned topPadding, unsigned rightPadding, 163 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode&) const;163 unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode&) const; 164 164 165 165 void emitInspectorDidBeginFrame(); -
trunk/Source/WebCore/testing/Internals.idl
r126080 r127457 139 139 NodeList nodesFromRect(in Document document, in long x, in long y, 140 140 in unsigned long topPadding, in unsigned long rightPadding, in unsigned long bottomPadding, in unsigned long leftPadding, 141 in boolean ignoreClipping, in boolean allowShadowContent ) raises (DOMException);141 in boolean ignoreClipping, in boolean allowShadowContent, in boolean allowChildFrameContent) raises (DOMException); 142 142 143 143 void emitInspectorDidBeginFrame(); -
trunk/Source/WebKit2/ChangeLog
r127444 r127457 1 2012-09-04 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 Allow child-frame content in hit-tests. 4 https://bugs.webkit.org/show_bug.cgi?id=95204 5 6 Reviewed by Antonio Gomes. 7 8 Update symbols for the Windows build-system. 9 10 * win/WebKit2.def: 11 * win/WebKit2CFLite.def: 12 1 13 2012-09-04 Ryuan Choi <ryuan.choi@samsung.com> 2 14 -
trunk/Source/WebKit2/win/WebKit2.def
r127191 r127457 260 260 ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ 261 261 ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z 262 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0 @Z262 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N00@Z 263 263 ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z 264 264 ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z -
trunk/Source/WebKit2/win/WebKit2CFLite.def
r127191 r127457 254 254 ?utf8@String@WTF@@QBE?AVCString@2@_N@Z 255 255 ?view@Document@WebCore@@QBEPAVFrameView@2@XZ 256 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0 @Z256 ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N00@Z 257 257 ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z 258 258 ?restrictScaleFactorToInitialScaleIfNotUserScalable@WebCore@@YAXAAUViewportAttributes@1@@Z -
trunk/Source/autotools/symbols.filter
r127191 r127457 163 163 _ZN7WebCore22RuntimeEnabledFeatures22isDialogElementEnabledE; 164 164 _ZN7WebCore22RuntimeEnabledFeatures37isAuthorShadowDOMForAnyElementEnabledE; 165 _ZNK7WebCore8Document13nodesFromRectEiijjjjbb ;165 _ZNK7WebCore8Document13nodesFromRectEiijjjjbbb; 166 166 _ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE; 167 167 _ZNK7WebCore6Editor26selectionStartHasMarkerForENS_14DocumentMarker10MarkerTypeEii;
Note: See TracChangeset
for help on using the changeset viewer.