Changeset 147087 in webkit


Ignore:
Timestamp:
Mar 28, 2013 2:13:21 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Regression: Crash when selecting Hebrew and numbers in a list
https://bugs.webkit.org/show_bug.cgi?id=111894

Patch by Arpita Bahuguna <a.bah@samsung.com> on 2013-03-28
Reviewed by Ryosuke Niwa.

Source/WebCore:

There is a crash when trying to click/select an anonymous
renderer.

This is a regression due to r143313 which tries to add border/padding
to the computed caret rect in RenderBox::localCaretRect().
The patch calls on the node() method for the corresponding
renderer. For an anonymous renderer though, node() returns
null. Since no check had been added for this, a crash occurs when
caret rect for an anonymous renderer is being computed.

Test: editing/selection/click-on-anonymous-content-crash.html

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::localCaretRect):
Added a check for validating the return from the node() call.

LayoutTests:

  • editing/selection/click-on-anonymous-content-crash-expected.txt: Added.
  • editing/selection/click-on-anonymous-content-crash.html: Added.

Added a testcase for verifying that no crash occurs when trying to
select/click an anonymous renderer, in this case the list marker's
renderer.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147086 r147087  
     12013-03-28  Arpita Bahuguna  <a.bah@samsung.com>
     2
     3        Regression: Crash when selecting Hebrew and numbers in a list
     4        https://bugs.webkit.org/show_bug.cgi?id=111894
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * editing/selection/click-on-anonymous-content-crash-expected.txt: Added.
     9        * editing/selection/click-on-anonymous-content-crash.html: Added.
     10        Added a testcase for verifying that no crash occurs when trying to
     11        select/click an anonymous renderer, in this case the list marker's
     12        renderer.
     13
    1142013-03-28  Mike West  <mkwst@chromium.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r147086 r147087  
     12013-03-28  Arpita Bahuguna  <a.bah@samsung.com>
     2
     3        Regression: Crash when selecting Hebrew and numbers in a list
     4        https://bugs.webkit.org/show_bug.cgi?id=111894
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        There is a crash when trying to click/select an anonymous
     9        renderer.
     10
     11        This is a regression due to r143313 which tries to add border/padding
     12        to the computed caret rect in RenderBox::localCaretRect().
     13        The patch calls on the node() method for the corresponding
     14        renderer. For an anonymous renderer though, node() returns
     15        null. Since no check had been added for this, a crash occurs when
     16        caret rect for an anonymous renderer is being computed.
     17
     18        Test: editing/selection/click-on-anonymous-content-crash.html
     19
     20        * rendering/RenderBox.cpp:
     21        (WebCore::RenderBox::localCaretRect):
     22        Added a check for validating the return from the node() call.
     23
    1242013-03-28  Mike West  <mkwst@chromium.org>
    225
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r146955 r147087  
    39933993    // is needed because we use offsets inside an "atomic" element to represent
    39943994    // positions before and after the element in deprecated editing offsets.
    3995     if (!(editingIgnoresContent(node()) || isTableElement(node()))) {
     3995    if (node() && !(editingIgnoresContent(node()) || isTableElement(node()))) {
    39963996        rect.setX(rect.x() + borderLeft() + paddingLeft());
    39973997        rect.setY(rect.y() + paddingTop() + borderTop());
Note: See TracChangeset for help on using the changeset viewer.