Bug 47841 - Rework baselinePosition and lineHeight to be writing-mode-aware.
Summary: Rework baselinePosition and lineHeight to be writing-mode-aware.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks: 46123
  Show dependency treegraph
 
Reported: 2010-10-18 11:48 PDT by Dave Hyatt
Modified: 2010-10-19 12:42 PDT (History)
3 users (show)

See Also:


Attachments
Patch (65.50 KB, patch)
2010-10-18 11:51 PDT, Dave Hyatt
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hyatt 2010-10-18 11:48:47 PDT
Rework baselinePosition and lineHeight to be writing-mode-aware.
Comment 1 Dave Hyatt 2010-10-18 11:51:19 PDT
Created attachment 71067 [details]
Patch
Comment 2 mitz 2010-10-18 12:21:55 PDT
Comment on attachment 71067 [details]
Patch

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

> WebCore/rendering/InlineBox.h:25
>  #include "RenderBoxModelObject.h"
> +#include "RenderBR.h"

R comes before o.

> WebCore/rendering/RenderBlock.cpp:5139
> +        bool ignoreBaseline = (layer() && (layer()->marquee() || (direction == HorizontalLine ? (layer()->verticalScrollbar() || layer()->scrollYOffset() != 0)
> +            : (layer()->horizontalScrollbar() || layer()->scrollXOffset() != 0)))) || isWritingModeRoot();
> +        int baselinePos = ignoreBaseline ? -1 : lastLineBoxBaseline();
> +        
> +        int bottomOfContent = direction == HorizontalLine ? borderTop() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWidth();
> +        if (baselinePos != -1 && baselinePos <= bottomOfContent)
> +            return direction == HorizontalLine ? marginTop() + baselinePos : marginRight() + baselinePos;
> +            
> +        return RenderBox::baselinePosition(firstLine, direction, linePositionMode);

I think you can easily get rid of the -1 and just use the boolean.

> WebCore/rendering/RenderBlock.cpp:5179
> +            const Font& f = style(true)->font();

I prefer firstLineStyle() here, so people don’t have to guess what 'true' means.

> WebCore/rendering/RenderBlock.cpp:5196
> +            const Font& f = style(true)->font();

Ditto

> WebCore/rendering/RenderSlider.cpp:158
> +int RenderSlider::baselinePosition(bool /*firstLine*/, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const

Don’t need the 2nd and 3rd commented-out parameter names.
Comment 3 Dave Hyatt 2010-10-19 11:45:18 PDT
Fixed in r70072.
Comment 4 WebKit Review Bot 2010-10-19 12:42:19 PDT
http://trac.webkit.org/changeset/70072 might have broken SnowLeopard Intel Release (Tests)