Bug 88049 - Layout not updated after setting -webkit-line-clamp to none
Summary: Layout not updated after setting -webkit-line-clamp to none
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-06-01 00:01 PDT by mitz
Modified: 2012-06-01 07:14 PDT (History)
3 users (show)

See Also:


Attachments
Mark blocks for layout and clear truncation when line-clamp changes to none (5.45 KB, patch)
2012-06-01 00:16 PDT, mitz
inferno: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2012-06-01 00:01:35 PDT
<rdar://problem/11407365>

Changing -webkit-line-clamp dynamically from a number or percentage value to none doesn’t remove clamping. Patch forthcoming.
Comment 1 mitz 2012-06-01 00:16:26 PDT
Created attachment 145222 [details]
Mark blocks for layout and clear truncation when line-clamp changes to none
Comment 2 Abhishek Arya 2012-06-01 00:58:06 PDT
Comment on attachment 145222 [details]
Mark blocks for layout and clear truncation when line-clamp changes to none

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

> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:153
> +void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const RenderStyle *newStyle)

* on the wrong side.

> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:987
> +void RenderDeprecatedFlexibleBox::clearLineClamp()

nit: Can this code be shared with http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp&exact_package=chromium&q=markPositionedObjectsForLayout&type=cs&l=883 to avoid duplication.

> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:995
> +            || (child->style()->height().isAuto() && child->isBlockFlow())) {

Do we want to use logicalHeight here ?

> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:996
> +            child->setChildNeedsLayout(true);

I think we just need to MarkOnlyThis in the second argument.
Comment 3 Abhishek Arya 2012-06-01 01:03:43 PDT
Comment on attachment 145222 [details]
Mark blocks for layout and clear truncation when line-clamp changes to none

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

> Source/WebCore/ChangeLog:14
> +        children for layout and clears trunaction from blocks.

typo 'trunacation'
Comment 4 mitz 2012-06-01 01:18:28 PDT
Comment on attachment 145222 [details]
Mark blocks for layout and clear truncation when line-clamp changes to none

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

Thanks for the review!

>> Source/WebCore/ChangeLog:14
>> +        children for layout and clears trunaction from blocks.
> 
> typo 'trunacation'

I am going to fix this.

>> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:153
>> +void RenderDeprecatedFlexibleBox::styleWillChange(StyleDifference diff, const RenderStyle *newStyle)
> 
> * on the wrong side.

Oops! I will fix this.

>> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:995
>> +            || (child->style()->height().isAuto() && child->isBlockFlow())) {
> 
> Do we want to use logicalHeight here ?

I don’t think RenderDeprecatedFlexibleBox was ever made writing-mode aware. More importantly, this code follows the logic in applyLineClamp().

>> Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:996
>> +            child->setChildNeedsLayout(true);
> 
> I think we just need to MarkOnlyThis in the second argument.

MarkOnlyThis is only useful during layout, when you don’t want to re-dirty the ancestors. clearLineClamp() is not called during layout, so MarkOnlyThis is not necessary and using it would introduce risk of creating a subtree that needs layout and never gets it.
Comment 5 Abhishek Arya 2012-06-01 01:21:46 PDT
Sounds good. Thanks for the patch.
Comment 6 mitz 2012-06-01 07:14:32 PDT
Fixed in <http://trac.webkit.org/r119227>.