Bug 118447 - Range.getClientRects() not working correctly for partially contained vertically styled text nodes
Summary: Range.getClientRects() not working correctly for partially contained vertical...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-07-06 20:50 PDT by Sam Weinig
Modified: 2013-07-10 17:42 PDT (History)
7 users (show)

See Also:


Attachments
Test Case (1.32 KB, text/html)
2013-07-06 20:50 PDT, Sam Weinig
no flags Details
Potential fix from Mac Murrett (527 bytes, patch)
2013-07-10 10:44 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (4.76 KB, patch)
2013-07-10 11:59 PDT, Sam Weinig
hyatt: review+
sam: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2013-07-06 20:50:56 PDT
Created attachment 206197 [details]
Test Case

Range.getClientRects() is not working correctly for partially contained vertically styled text nodes.  (See attached test case).
Comment 1 Sam Weinig 2013-07-10 10:44:21 PDT
Created attachment 206397 [details]
Potential fix from Mac Murrett
Comment 2 Dave Hyatt 2013-07-10 11:15:30 PDT
Comment on attachment 206397 [details]
Potential fix from Mac Murrett

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

> Source/WebCore/rendering/RenderText.cpp:338
>                  r.setHeight(box->logicalHeight());
>                  r.setY(box->y());
>              } else {
> -                r.setWidth(box->logicalWidth());
> +                r.setWidth(box->logicalHeight());
>                  r.setX(box->x());

Shouldn't this just be using box->width() and box->height()? Seems silly to call logical when you seem to want physical?
Comment 3 Sam Weinig 2013-07-10 11:16:30 PDT
(In reply to comment #2)
> (From update of attachment 206397 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=206397&action=review
> 
> > Source/WebCore/rendering/RenderText.cpp:338
> >                  r.setHeight(box->logicalHeight());
> >                  r.setY(box->y());
> >              } else {
> > -                r.setWidth(box->logicalWidth());
> > +                r.setWidth(box->logicalHeight());
> >                  r.setX(box->x());
> 
> Shouldn't this just be using box->width() and box->height()? Seems silly to call logical when you seem to want physical?

Agreed, I'll try that out.
Comment 4 Sam Weinig 2013-07-10 11:59:42 PDT
Created attachment 206404 [details]
Patch
Comment 5 Dave Hyatt 2013-07-10 12:00:56 PDT
Comment on attachment 206404 [details]
Patch

r=me
Comment 6 Sam Weinig 2013-07-10 16:57:36 PDT
Committed r152554: <http://trac.webkit.org/changeset/152554>
Comment 7 Daniel Bates 2013-07-10 17:42:34 PDT
<rdar://problem/14305675>