Changeset 138080 in webkit


Ignore:
Timestamp:
Dec 18, 2012 4:02:18 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Cannot click an element at 2nd line or more inside inline-block in vertical writing mode.
https://bugs.webkit.org/show_bug.cgi?id=104775

Patch by Yuki Sekiguchi <yuki.sekiguchi@access-company.com> on 2012-12-18
Reviewed by Dean Jackson.

Source/WebCore:

If the parent of an inline box changes writing mode, then the inline box must flip incoming hit point coordinates.
Otherwise, the coordinate will be misunderstood because the box has a different origin from its parent.
If the InlineBox doesn't flip its offset, its children will use the wrong offset
because they don't know their grandparent changed writing modes.
InlineBox::nodeAtPoint should flip accumulatedOffset like InlineBox::paint().

Test: fast/writing-mode/vertical-inline-block-hittest.html

  • rendering/InlineBox.cpp:

(WebCore::InlineBox::nodeAtPoint):

LayoutTests:

Test that we can click 2nd line inside inline-block in vertical writing mode.

  • fast/writing-mode/vertical-inline-block-hittest-expected.txt: Added.
  • fast/writing-mode/vertical-inline-block-hittest.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138076 r138080  
     12012-12-18  Yuki Sekiguchi  <yuki.sekiguchi@access-company.com>
     2
     3        Cannot click an element at 2nd line or more inside inline-block in vertical writing mode.
     4        https://bugs.webkit.org/show_bug.cgi?id=104775
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test that we can click 2nd line inside inline-block in vertical writing mode.
     9
     10        * fast/writing-mode/vertical-inline-block-hittest-expected.txt: Added.
     11        * fast/writing-mode/vertical-inline-block-hittest.html: Added.
     12
    1132012-12-18  Simon Fraser  <simon.fraser@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r138076 r138080  
     12012-12-18  Yuki Sekiguchi  <yuki.sekiguchi@access-company.com>
     2
     3        Cannot click an element at 2nd line or more inside inline-block in vertical writing mode.
     4        https://bugs.webkit.org/show_bug.cgi?id=104775
     5
     6        Reviewed by Dean Jackson.
     7
     8        If the parent of an inline box changes writing mode, then the inline box must flip incoming hit point coordinates.
     9        Otherwise, the coordinate will be misunderstood because the box has a different origin from its parent.
     10        If the InlineBox doesn't flip its offset, its children will use the wrong offset
     11        because they don't know their grandparent changed writing modes.
     12        InlineBox::nodeAtPoint should flip accumulatedOffset like InlineBox::paint().
     13
     14        Test: fast/writing-mode/vertical-inline-block-hittest.html
     15
     16        * rendering/InlineBox.cpp:
     17        (WebCore::InlineBox::nodeAtPoint):
     18
    1192012-12-18  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r137589 r138080  
    250250    // own stacking context.  (See Appendix E.2, section 6.4 on inline block/table elements in the CSS2.1
    251251    // specification.)
    252     return renderer()->hitTest(request, result, locationInContainer, accumulatedOffset);
     252    LayoutPoint childPoint = accumulatedOffset;
     253    if (parent()->renderer()->style()->isFlippedBlocksWritingMode()) // Faster than calling containingBlock().
     254        childPoint = renderer()->containingBlock()->flipForWritingModeForChild(toRenderBox(renderer()), childPoint);
     255   
     256    return renderer()->hitTest(request, result, locationInContainer, childPoint);
    253257}
    254258
Note: See TracChangeset for help on using the changeset viewer.