Bug 104775

Summary: Cannot click an element at 2nd line or more inside inline-block in vertical writing mode.
Product: WebKit Reporter: Yuki Sekiguchi <yuki.sekiguchi>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, eric, hyatt, mitz, ojan.autocc, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Reproduced content
none
Patch
none
Patch
none
Patch
none
Patch
none
Rewrite test using js-test-pre.js none

Description Yuki Sekiguchi 2012-12-12 00:45:42 PST
Created attachment 178991 [details]
Reproduced content

We cannot click "click here" in the attached content.

We should be able to click "click here".
Comment 1 Yuki Sekiguchi 2012-12-12 00:52:35 PST
Created attachment 178992 [details]
Patch
Comment 2 Ryosuke Niwa 2012-12-12 11:05:23 PST
Comment on attachment 178992 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=178992&action=review

> Source/WebCore/ChangeLog:9
> +        InlineBox::nodeAtPoint don't consider vertical writing mode.
> +        InlineBox::nodeAtPoint shold flip accumulatedOffset like InlineBox::paint().

Could you elaborate more on what was going on? In particular, it's good to clarify why we need to flip values in accumulatedOffset before passing it to hitTest.
Comment 3 Yuki Sekiguchi 2012-12-13 21:49:11 PST
Created attachment 179414 [details]
Patch
Comment 4 Dean Jackson 2012-12-14 15:36:12 PST
Comment on attachment 179414 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=179414&action=review

I'm making some grammar suggestions. Please don't feel that I'm being overly picky :)

> Source/WebCore/ChangeLog:8
> +        If parent of inline box change writing mode, flipping offset is responsibility of inline box.

"If the parent of an inline box changes writing mode, then the inline box must flip incoming hit point coordinates."

> Source/WebCore/ChangeLog:9
> +        If they don't flip offset, they misunderstand offset because their origin is different from their parent's.

"Otherwise, the coordinate will be misunderstood because the box has a different origin from its parent."

> Source/WebCore/ChangeLog:10
> +        nodeAtPoint() in InlineTextBox and InlineFlowBox flip.

I don't think you need this line.

> Source/WebCore/ChangeLog:12
> +        If InlineBox don't flip its offset, children of InlineBox use wrong offset
> +        because they don't(shouldn't) know that its grand parent changing writing mode.

"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."

> LayoutTests/ChangeLog:8
> +        test that we can click 2nd line inside inline-block in vertical writing mode.

Nit: Test (with uppercase T).
Comment 5 Yuki Sekiguchi 2012-12-16 20:07:13 PST
Created attachment 179683 [details]
Patch
Comment 6 Yuki Sekiguchi 2012-12-16 20:33:36 PST
(In reply to comment #4)
> (From update of attachment 179414 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=179414&action=review
> 
> I'm making some grammar suggestions. Please don't feel that I'm being overly picky :)

I'm sorry to make you review grammar, but thank you.
It is a big help for me as English learner :)

> > Source/WebCore/ChangeLog:8
> > +        If parent of inline box change writing mode, flipping offset is responsibility of inline box.
> 
> "If the parent of an inline box changes writing mode, then the inline box must flip incoming hit point coordinates."
> 
> > Source/WebCore/ChangeLog:9
> > +        If they don't flip offset, they misunderstand offset because their origin is different from their parent's.
> 
> "Otherwise, the coordinate will be misunderstood because the box has a different origin from its parent."
> 
> > Source/WebCore/ChangeLog:10
> > +        nodeAtPoint() in InlineTextBox and InlineFlowBox flip.
> 
> I don't think you need this line.
> 
> > Source/WebCore/ChangeLog:12
> > +        If InlineBox don't flip its offset, children of InlineBox use wrong offset
> > +        because they don't(shouldn't) know that its grand parent changing writing mode.
> 
> "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."
> 
> > LayoutTests/ChangeLog:8
> > +        test that we can click 2nd line inside inline-block in vertical writing mode.
> 
> Nit: Test (with uppercase T).

Applied all suggestions.
Comment 7 Dean Jackson 2012-12-18 15:01:29 PST
Comment on attachment 179683 [details]
Patch

Thanks!
Comment 8 Ryosuke Niwa 2012-12-18 15:09:11 PST
Comment on attachment 179683 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=179683&action=review

> LayoutTests/fast/writing-mode/vertical-inline-block-hittest-expected.txt:2
> +
> +b

This test can benefit from some brief description on what it’s testing.
Comment 9 WebKit Review Bot 2012-12-18 16:03:26 PST
Comment on attachment 179683 [details]
Patch

Clearing flags on attachment: 179683

Committed r138080: <http://trac.webkit.org/changeset/138080>
Comment 10 WebKit Review Bot 2012-12-18 16:03:30 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Yuki Sekiguchi 2012-12-19 21:21:58 PST
Reopening to attach new patch.
Comment 12 Yuki Sekiguchi 2012-12-19 21:22:02 PST
Created attachment 180273 [details]
Patch
Comment 13 Yuki Sekiguchi 2012-12-19 21:28:28 PST
Hi Ryosuke

(In reply to comment #8)
> (From update of attachment 179683 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=179683&action=review
> 
> > LayoutTests/fast/writing-mode/vertical-inline-block-hittest-expected.txt:2
> > +
> > +b
> 
> This test can benefit from some brief description on what it’s testing.

I added the description.

I don't know the rule for this case.
I tentatively request review.
Please correct me, if I’m wrong.
Comment 14 Ryosuke Niwa 2012-12-19 21:35:49 PST
Comment on attachment 180273 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=180273&action=review

> LayoutTests/fast/writing-mode/vertical-inline-block-hittest.html:19
> +    if (hitResult) {
> +        result.innerHTML = 'PASS: We can click "a" element at 2nd line inside inline-block.';
> +    } else {
> +        result.innerHTML = 'FAIL: We cannot hit "a" element at 2nd line inside inline-block.';
> +    }

No curly brackets around single statements. It’ll be also nice to hide the div so that “b” won’t get dumped.
Also you could make a use of js-test-pre.js and just do:
var elementInsideInlineBlockInSecondLine = document.querySelector(‘a’);
shouldBe(“document.elementFromPoint(5, 5)”, "elementInsideInlineBlockInSecondLine");
Comment 15 Yuki Sekiguchi 2012-12-19 22:18:10 PST
Created attachment 180279 [details]
Rewrite test using js-test-pre.js
Comment 16 Ryosuke Niwa 2013-01-24 11:29:50 PST
Has this been landed? Or do we need to land it still?
Comment 17 Yuki Sekiguchi 2013-01-24 16:20:25 PST
(In reply to comment #16)
> Has this been landed? Or do we need to land it still?

Sorry. This patch have not been landed yet.

I worry that win EWS fail to patch files, because the failing files are not changed after they have been created.
Is this linefeed code problem?
Comment 18 Ryosuke Niwa 2013-01-24 16:23:31 PST
(In reply to comment #17)
> (In reply to comment #16)
> > Has this been landed? Or do we need to land it still?
> 
> Sorry. This patch have not been landed yet.
> 
> I worry that win EWS fail to patch files, because the failing files are not changed after they have been created.
> Is this linefeed code problem?

I think Windows bot was just sick. I think you should just land it.
Comment 19 Yuki Sekiguchi 2013-01-24 16:26:57 PST
(In reply to comment #18)
> (In reply to comment #17)
> > (In reply to comment #16)
> > > Has this been landed? Or do we need to land it still?
> > 
> > Sorry. This patch have not been landed yet.
> > 
> > I worry that win EWS fail to patch files, because the failing files are not changed after they have been created.
> > Is this linefeed code problem?
> 
> I think Windows bot was just sick. I think you should just land it.

Thank you.

I added commit‑queue? flag. Could you land this patch?
Comment 20 WebKit Review Bot 2013-01-24 17:04:16 PST
Comment on attachment 180279 [details]
Rewrite test using js-test-pre.js

Clearing flags on attachment: 180279

Committed r140753: <http://trac.webkit.org/changeset/140753>
Comment 21 WebKit Review Bot 2013-01-24 17:04:23 PST
All reviewed patches have been landed.  Closing bug.
Comment 22 Yuki Sekiguchi 2013-01-24 17:12:51 PST
Thanks a lot!