Ignore:
Timestamp:
Sep 26, 2013, 7:02:27 PM (12 years ago)
Author:
Antti Koivisto
Message:

Move m_style to RenderElement
https://bugs.webkit.org/show_bug.cgi?id=121936

Source/WebCore:

Reviewed by Andreas Kling.

Text renderers always have the same style as their parent. They can get their style via the parent pointer
rather than having a member of their own.

This shrinks RenderText by a pointer.

  • dom/PseudoElement.cpp:

(WebCore::PseudoElement::didRecalcStyle):

Text renderers have no independent style. No need to set it.

  • editing/ApplyBlockElementCommand.cpp:
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::addChildToAnonymousColumnBlocks):

Avoid getting style from text child before it is added to tree.

(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::createFirstLetterRenderer):

  • rendering/RenderButton.cpp:

(WebCore::RenderButton::styleDidChange):
(WebCore::RenderButton::setText):

  • rendering/RenderCombineText.cpp:

(WebCore::RenderCombineText::styleDidChange):

Don't set text style anymore.

  • rendering/RenderElement.cpp:

(WebCore::RenderElement::RenderElement):
(WebCore::RenderElement::setStyle):

Notify child text renderers of style change.

(WebCore::RenderElement::setAnimatableStyle):
(WebCore::RenderElement::setPseudoStyle):

Push down to RenderElement, remove text branches.

(WebCore::RenderElement::addChild):

Notify text renderers of style change when added to tree.

(WebCore::RenderElement::propagateStyleToAnonymousChildren):

  • rendering/RenderElement.h:

(WebCore::RenderElement::style):
(WebCore::RenderElement::setStyleInternal):

Move m_style from RenderObject.

(WebCore::RenderObject::style):

Inline this in RenderElement.h instead of making it virtual.

  • rendering/RenderInline.cpp:

(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::styleDidChange):

Tighten typing to call RenderElement::setStyle.

(WebCore::RenderInline::clippedOverflowRectForRepaint):

Change assert. This can get legitimately called during layout for the first letter renderers.
This was previously avoided by luck.

  • rendering/RenderMenuList.cpp:

(WebCore::RenderMenuList::styleDidChange):
(WebCore::RenderMenuList::setText):

Don't set text style anymore.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::RenderObject):
(WebCore::RenderObject::containingBlock):
(WebCore::RenderObject::drawLineForBoxSide):
(WebCore::RenderObject::hasEntirelyFixedBackground):
(WebCore::RenderObject::container):
(WebCore::RenderObject::cachedFirstLineStyle):

Switch to style(), avoid unnecessary repetition.
Move code out.

  • rendering/RenderObject.h:


Move functions to RenderElement.

(WebCore::RenderObject::isBeforeContent):
(WebCore::RenderObject::isAfterContent):

Avoid accessing style for text renderers as these are called before the renderer
is added to tree.

(WebCore::RenderObject::setNeedsPositionedMovementLayout):

  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
(WebCore::RenderRegion::setObjectStyleInRegion):

  • rendering/RenderSearchField.cpp:

(WebCore::RenderSearchField::updateCancelButtonVisibility):

  • rendering/RenderText.cpp:
  • rendering/RenderText.h:


Remove setStyle.

(WebCore::RenderText::style):

Get style from parent.

  • rendering/mathml/RenderMathMLOperator.cpp:

(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::createGlyph):

  • rendering/style/ContentData.cpp:

(WebCore::TextContentData::createRenderer):
(WebCore::CounterContentData::createRenderer):
(WebCore::QuoteContentData::createRenderer):

Pseudo style for RenderText subclasses comes from parent without any explicit setting.

  • style/StyleResolveTree.cpp:

(WebCore::Style::createTextRendererIfNeeded):
(WebCore::Style::resolveLocal):
(WebCore::Style::updateTextStyle):
(WebCore::Style::resolveShadowTree):
(WebCore::Style::resolveTree):

No need to set or update text renderer style separately.

LayoutTests:

Reviewed by Andreas Kling.

Progressions from text style updating correctly in all cases.

  • compositing/contents-opaque/hidden-with-visible-text-expected.txt:
  • compositing/contents-opaque/visibility-hidden-expected.txt:


Can't figure out why these progress but they do. The new rendering (showing nothing)
is correct and matches Firefox.

  • platform/mac/svg/custom/SVGPoint-matrixTransform-expected.txt:
  • platform/mac/svg/custom/getTransformToElement-expected.txt:
  • platform/mac/svg/custom/text-ctm-expected.txt:
  • platform/mac/svg/custom/text-hit-test-expected.txt:
  • platform/mac/svg/text/append-text-node-to-tspan-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.