| Index: Source/core/layout/LayoutObject.cpp
|
| diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
|
| index 600d9b8d40123ecc948d3ef9fb1d0242c5b25479..7da791064129b9a475b0c41dfa96a1fbc870e903 100644
|
| --- a/Source/core/layout/LayoutObject.cpp
|
| +++ b/Source/core/layout/LayoutObject.cpp
|
| @@ -760,7 +760,7 @@ void LayoutObject::markContainerChainForLayout(bool scheduleRelayout, LayoutObje
|
| LayoutObject* container = object->container();
|
| if (!container && !object->isLayoutView())
|
| return;
|
| - if (!last->isTextOrSVGChild() && last->style()->hasOutOfFlowPosition()) {
|
| + if (!last->isSVGChild() && last->style()->hasOutOfFlowPosition()) {
|
| bool willSkipRelativelyPositionedInlines = !object->isLayoutBlock() || object->isAnonymousBlock();
|
| // Skip relatively positioned inlines and anonymous blocks to get to the enclosing LayoutBlock.
|
| while (object && (!object->isLayoutBlock() || object->isAnonymousBlock()))
|
| @@ -816,7 +816,7 @@ void LayoutObject::checkBlockPositionedObjectsNeedLayout()
|
| void LayoutObject::setPreferredLogicalWidthsDirty(MarkingBehavior markParents)
|
| {
|
| m_bitfields.setPreferredLogicalWidthsDirty(true);
|
| - if (markParents == MarkContainerChain && (isText() || !style()->hasOutOfFlowPosition()))
|
| + if (markParents == MarkContainerChain && !style()->hasOutOfFlowPosition())
|
| invalidateContainerPreferredLogicalWidths();
|
| }
|
|
|
| @@ -850,7 +850,6 @@ inline void LayoutObject::invalidateContainerPreferredLogicalWidths()
|
| LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const
|
| {
|
| ASSERT(!paintInvalidationContainerSkipped || !*paintInvalidationContainerSkipped);
|
| - ASSERT(!isText());
|
| ASSERT(style()->position() == FixedPosition);
|
|
|
| LayoutObject* ancestor = parent();
|
| @@ -868,9 +867,9 @@ LayoutBlock* LayoutObject::containingBlock() const
|
| LayoutObject* o = parent();
|
| if (!o && isLayoutScrollbarPart())
|
| o = toLayoutScrollbarPart(this)->layoutObjectOwningScrollbar();
|
| - if (!isTextOrSVGChild() && m_style->position() == FixedPosition)
|
| + if (!isSVGChild() && m_style->position() == FixedPosition)
|
| return containerForFixedPosition();
|
| - if (!isTextOrSVGChild() && m_style->position() == AbsolutePosition) {
|
| + if (!isSVGChild() && m_style->position() == AbsolutePosition) {
|
| while (o) {
|
| // For relpositioned inlines, we return the nearest non-anonymous enclosing block. We don't try
|
| // to return the inline itself. This allows us to avoid having a positioned objects
|
| @@ -1580,6 +1579,8 @@ Color LayoutObject::selectionBackgroundColor() const
|
| if (!isSelectable())
|
| return Color::transparent;
|
|
|
| + if ((!node() || node()->isTextNode()) && parent())
|
| + return parent()->selectionBackgroundColor();
|
| if (RefPtr<ComputedStyle> pseudoStyle = getUncachedPseudoStyleFromParentOrShadowHost())
|
| return resolveColor(*pseudoStyle, CSSPropertyBackgroundColor).blendWithWhite();
|
| return frame()->selection().isFocusedAndActive() ?
|
| @@ -1594,6 +1595,8 @@ Color LayoutObject::selectionColor(int colorProperty) const
|
| if (!isSelectable() || (frame()->view()->paintBehavior() & PaintBehaviorSelectionOnly))
|
| return resolveColor(colorProperty);
|
|
|
| + if ((!node() || node()->isTextNode()) && parent())
|
| + return parent()->selectionColor(colorProperty);
|
| if (RefPtr<ComputedStyle> pseudoStyle = getUncachedPseudoStyleFromParentOrShadowHost())
|
| return resolveColor(*pseudoStyle, colorProperty);
|
| if (!LayoutTheme::theme().supportsSelectionForegroundColors())
|
| @@ -1647,16 +1650,14 @@ StyleDifference LayoutObject::adjustStyleDifference(StyleDifference diff) const
|
|
|
| // If transform changed, and the layer does not paint into its own separate backing, then we need to invalidate paints.
|
| if (diff.transformChanged()) {
|
| - // Text nodes share style with their parents but transforms don't apply to them,
|
| - // hence the !isText() check.
|
| - if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()->hasStyleDeterminedDirectCompositingReasons()))
|
| + if (!hasLayer() || !toLayoutBoxModelObject(this)->layer()->hasStyleDeterminedDirectCompositingReasons())
|
| diff.setNeedsPaintInvalidationLayer();
|
| }
|
|
|
| // If opacity or zIndex changed, and the layer does not paint into its own separate backing, then we need to invalidate paints (also
|
| // ignoring text nodes)
|
| if (diff.opacityChanged() || diff.zIndexChanged()) {
|
| - if (!isText() && (!hasLayer() || !toLayoutBoxModelObject(this)->layer()->hasStyleDeterminedDirectCompositingReasons()))
|
| + if (!hasLayer() || !toLayoutBoxModelObject(this)->layer()->hasStyleDeterminedDirectCompositingReasons())
|
| diff.setNeedsPaintInvalidationLayer();
|
| }
|
|
|
| @@ -1694,24 +1695,8 @@ StyleDifference LayoutObject::adjustStyleDifference(StyleDifference diff) const
|
| void LayoutObject::setPseudoStyle(PassRefPtr<ComputedStyle> pseudoStyle)
|
| {
|
| ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFTER || pseudoStyle->styleType() == FIRST_LETTER);
|
| -
|
| - // FIXME: We should consider just making all pseudo items use an inherited style.
|
| -
|
| - // Images are special and must inherit the pseudoStyle so the width and height of
|
| - // the pseudo element doesn't change the size of the image. In all other cases we
|
| - // can just share the style.
|
| - //
|
| - // Quotes are also LayoutInline, so we need to create an inherited style to avoid
|
| - // getting an inline with positioning or an invalid display.
|
| - //
|
| - if (isImage() || isQuote()) {
|
| - RefPtr<ComputedStyle> style = ComputedStyle::create();
|
| - style->inheritFrom(*pseudoStyle);
|
| - setStyle(style.release());
|
| - return;
|
| - }
|
| -
|
| - setStyle(pseudoStyle);
|
| + RefPtr<ComputedStyle> style = ComputedStyle::createWithInheritableProperties(*pseudoStyle);
|
| + setStyle(style.release());
|
| }
|
|
|
| void LayoutObject::markContainingBlocksForOverflowRecalc()
|
| @@ -2345,7 +2330,7 @@ LayoutObject* LayoutObject::container(const LayoutBoxModelObject* paintInvalidat
|
| // computePositionedLogicalHeight have to use container().
|
| LayoutObject* o = parent();
|
|
|
| - if (isTextOrSVGChild())
|
| + if (isSVGChild())
|
| return o;
|
|
|
| EPosition pos = m_style->position();
|
|
|