diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-01-16 15:35:50 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-01-16 15:58:22 +0100 |
commit | e38a1d437eedc84d89e6daafea050fb3ed6a2273 (patch) | |
tree | 9b6895238b04dee78f59afe0f9c889b2f0d0409d | |
parent | 83a5436e1a97b908f3089c3c8ef51f604989ef69 (diff) |
Avoid crash on root elements with display:none
We expect elements returned by hit-testing to have actual renderObjects,
but that may not be the case if the root element is declared display:none,
since the root element is always considered hit if nothing else is, and
display: none elements have no renderObjects.
Task-number: QTBUG-43882
Change-Id: I526615d401bf09b30e2b6994dcdad3b2373cef5a
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
-rw-r--r-- | Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp index dafb0e287..f4d7f0572 100644 --- a/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QWebFrameAdapter.cpp @@ -837,7 +837,7 @@ QWebHitTestResultPrivate::QWebHitTestResultPrivate(const WebCore::HitTestResult innerNode->ref(); innerNonSharedNode = hitTest.innerNonSharedNode(); innerNonSharedNode->ref(); - boundingRect = innerNonSharedNode ? innerNonSharedNode->renderer()->absoluteBoundingBoxRect() : IntRect(); + boundingRect = (innerNonSharedNode && innerNonSharedNode->renderer())? innerNonSharedNode->renderer()->absoluteBoundingBoxRect() : IntRect(); WebCore::Image *img = hitTest.image(); if (img) { QPixmap* pix = img->nativeImageForCurrentFrame(); |