[Webkit-unassigned] [Bug 21925] li or div with float and text-transform wraps unexpectedly when dynamically updating inner span

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 2 04:47:34 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=21925





--- Comment #6 from Mikhail <mirogozhin at gmail.com>  2012-03-02 04:47:34 PST ---
Created an attachment (id=129881)
 --> (https://bugs.webkit.org/attachment.cgi?id=129881&action=review)
do not mark dirty if has no parent

The bug occurs when width of container node is not recalculated after text-transformed node is appended to it.

This happened because setPreferredLogicalWidthsDirty is called twice when text is css-transformed, and when it called first time TextRender has no parent yet. When text is not transformed there is one call.
Extra call is occurs during after calling setText in RenderText.cpp, RenderText::styleDidChange:
204        if (needsResetText || oldTransform != newStyle->textTransform() || oldSecurity != newStyle->textSecurity()) {
205            if (RefPtr<StringImpl> textToTransform = originalText())
206                setText(textToTransform.release(), true);
207        }

#0  WebCore::RenderObject::setPreferredLogicalWidthsDirty (this=0x81e0fcc, 
#1  0xb5d0f42a in WebCore::RenderObject::setNeedsLayoutAndPrefWidthsRecalc (
#2  0xb6252ee6 in WebCore::RenderText::setText (this=0x81e0fcc, text=..., 


First time setPreferredLogicalWidthsDirty() is called on RenderText when it has no parent renderer, so invalidateContainerPreferredLogicalWidths() cannot mark container for recalculating width.
Next time when setPreferredLogicalWidthsDirty() is called (this time after addChild()) invalidateContainerPreferredLogicalWidths() isn't called because dirty flag was set previous time.

It can be fixed by resetting width-dirty flag if RenderObject has no parent,
in invalidateContainerPreferredLogicalWidths call. See patch.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list