summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderInline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderInline.cpp')
-rw-r--r--Source/WebCore/rendering/RenderInline.cpp60
1 files changed, 44 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp
index 239aba370..9f71ff15f 100644
--- a/Source/WebCore/rendering/RenderInline.cpp
+++ b/Source/WebCore/rendering/RenderInline.cpp
@@ -40,7 +40,9 @@
#include "TransformState.h"
#include "VisiblePosition.h"
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#include <wtf/TemporaryChange.h>
+
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
#include "Frame.h"
#endif
@@ -118,9 +120,9 @@ RenderInline* RenderInline::inlineElementContinuation() const
return toRenderBlock(continuation)->inlineElementContinuation();
}
-void RenderInline::updateBoxModelInfoFromStyle()
+void RenderInline::updateFromStyle()
{
- RenderBoxModelObject::updateBoxModelInfoFromStyle();
+ RenderBoxModelObject::updateFromStyle();
setInline(true); // Needed for run-ins, since run-in is considered a block display type.
@@ -167,11 +169,18 @@ void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
// need to pass its style on to anyone else.
RenderStyle* newStyle = style();
RenderInline* continuation = inlineElementContinuation();
- for (RenderInline* currCont = continuation; currCont; currCont = currCont->inlineElementContinuation()) {
- RenderBoxModelObject* nextCont = currCont->continuation();
- currCont->setContinuation(0);
- currCont->setStyle(newStyle);
- currCont->setContinuation(nextCont);
+ {
+ TemporaryChange<bool> enableAfter(RenderObjectChildList::s_enableUpdateBeforeAfterContent, false);
+ RenderInline* nextInlineElementCont = 0;
+ for (RenderInline* currCont = continuation; currCont; currCont = nextInlineElementCont) {
+ nextInlineElementCont = currCont->inlineElementContinuation();
+ // We need to update :after content for the last continuation in the chain.
+ RenderObjectChildList::s_enableUpdateBeforeAfterContent = !nextInlineElementCont;
+ RenderBoxModelObject* nextCont = currCont->continuation();
+ currCont->setContinuation(0);
+ currCont->setStyle(newStyle);
+ currCont->setContinuation(nextCont);
+ }
}
// If an inline's in-flow positioning has changed then any descendant blocks will need to change their in-flow positioning accordingly.
@@ -960,7 +969,7 @@ LayoutRect RenderInline::linesVisualOverflowBoundingBox() const
return rect;
}
-LayoutRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const
+LayoutRect RenderInline::clippedOverflowRectForRepaint(RenderLayerModelObject* repaintContainer) const
{
// Only run-ins are allowed in here during layout.
ASSERT(!view() || !view()->layoutStateEnabled() || isRunIn());
@@ -1011,7 +1020,7 @@ LayoutRect RenderInline::clippedOverflowRectForRepaint(RenderBoxModelObject* rep
return repaintRect;
}
-LayoutRect RenderInline::rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const
+LayoutRect RenderInline::rectWithOutlineForRepaint(RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
{
LayoutRect r(RenderBoxModelObject::rectWithOutlineForRepaint(repaintContainer, outlineWidth));
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
@@ -1021,7 +1030,7 @@ LayoutRect RenderInline::rectWithOutlineForRepaint(RenderBoxModelObject* repaint
return r;
}
-void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect& rect, bool fixed) const
+void RenderInline::computeRectForRepaint(RenderLayerModelObject* repaintContainer, LayoutRect& rect, bool fixed) const
{
if (RenderView* v = view()) {
// LayoutState is only valid for root-relative repainting
@@ -1103,7 +1112,7 @@ LayoutSize RenderInline::offsetFromContainer(RenderObject* container, const Layo
return offset;
}
-void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags mode, bool* wasFixed) const
+void RenderInline::mapLocalToContainer(RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
{
if (repaintContainer == this)
return;
@@ -1155,7 +1164,7 @@ void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, T
o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
}
-const RenderObject* RenderInline::pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
+const RenderObject* RenderInline::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
{
ASSERT(ancestorToStopAt != this);
@@ -1525,13 +1534,14 @@ void RenderInline::paintOutlineForLine(GraphicsContext* graphicsContext, const L
antialias);
}
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(DRAGGABLE_REGION)
+void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
{
// Convert the style regions to absolute coordinates.
if (style()->visibility() != VISIBLE)
return;
+#if ENABLE(DASHBOARD_SUPPORT)
const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
unsigned i, count = styleRegions.size();
for (i = 0; i < count; i++) {
@@ -1541,7 +1551,7 @@ void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
LayoutUnit w = linesBoundingBox.width();
LayoutUnit h = linesBoundingBox.height();
- DashboardRegionValue region;
+ AnnotatedRegionValue region;
region.label = styleRegion.label;
region.bounds = LayoutRect(linesBoundingBox.x() + styleRegion.offset.left().value(),
linesBoundingBox.y() + styleRegion.offset.top().value(),
@@ -1566,6 +1576,24 @@ void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
regions.append(region);
}
+#else // ENABLE(DRAGGABLE_REGION)
+ if (style()->getDraggableRegionMode() == DraggableRegionNone)
+ return;
+
+ AnnotatedRegionValue region;
+ region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
+ region.bounds = linesBoundingBox();
+
+ RenderObject* container = containingBlock();
+ if (!container)
+ container = this;
+
+ FloatPoint absPos = container->localToAbsolute();
+ region.bounds.setX(absPos.x() + region.bounds.x());
+ region.bounds.setY(absPos.y() + region.bounds.y());
+
+ regions.append(region);
+#endif
}
#endif