Changeset 173737 in webkit


Ignore:
Timestamp:
Sep 18, 2014, 3:31:43 PM (11 years ago)
Author:
Simon Fraser
Message:

Avoid divide by zero when we get an empty rect while snapshotting a node
https://bugs.webkit.org/show_bug.cgi?id=136932
rdar://problem/18383473

Reviewed by Dean Jackson.

renderer()->paintingRootRect() can return an empty rect for some inline configurations,
for example an <a> containing a floated <span>

When this occurs, avoid a divide by zero and return a null snapshot image.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::snapshotNode):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r173726 r173737  
     12014-09-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Avoid divide by zero when we get an empty rect while snapshotting a node
     4        https://bugs.webkit.org/show_bug.cgi?id=136932
     5        rdar://problem/18383473
     6
     7        Reviewed by Dean Jackson.
     8       
     9        renderer()->paintingRootRect() can return an empty rect for some inline configurations,
     10        for example an <a> containing a floated <span>
     11       
     12        When this occurs, avoid a divide by zero and return a null snapshot image.
     13
     14        * WebProcess/WebPage/WebPage.cpp:
     15        (WebKit::WebPage::snapshotNode):
     16
    1172014-09-18  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r173710 r173737  
    17131713    LayoutRect topLevelRect;
    17141714    IntRect snapshotRect = snappedIntRect(node.renderer()->paintingRootRect(topLevelRect));
     1715    if (snapshotRect.isEmpty())
     1716        return nullptr;
    17151717
    17161718    double scaleFactor = 1;
Note: See TracChangeset for help on using the changeset viewer.