summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/rendering')
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/CounterNode.cpp12
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/HitTestResult.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/HitTestResult.h1
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp41
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp25
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h3
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBR.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp19
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderBox.h2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderCounter.cpp25
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderImage.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp102
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderInline.h5
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp32
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayer.h6
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.cpp32
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.h6
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderLayerCompositor.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderListBox.h2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderMedia.cpp1
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderMediaControls.cpp15
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.cpp304
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.h46
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp19
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderObject.h2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderPartObject.cpp10
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderSlider.cpp18
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.h2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.h1
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.mm174
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp188
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp51
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderThemeMac.h2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderThemeSafari.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp28
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.h17
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp11
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/RenderWidget.h3
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/SVGRenderSupport.cpp5
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/RenderStyle.h3
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/RenderStyleConstants.h1
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.cpp5
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.h8
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.cpp19
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.h32
-rw-r--r--src/3rdparty/webkit/WebCore/rendering/style/StyleBackgroundData.cpp2
51 files changed, 814 insertions, 514 deletions
diff --git a/src/3rdparty/webkit/WebCore/rendering/CounterNode.cpp b/src/3rdparty/webkit/WebCore/rendering/CounterNode.cpp
index 22a11b9781..f546abb113 100644
--- a/src/3rdparty/webkit/WebCore/rendering/CounterNode.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/CounterNode.cpp
@@ -63,11 +63,17 @@ void CounterNode::recount()
for (CounterNode* c = this; c; c = c->m_nextSibling) {
int oldCount = c->m_countInParent;
int newCount = c->computeCountInParent();
- c->m_countInParent = newCount;
if (oldCount == newCount)
break;
- if (c->m_renderer->isCounter())
- c->m_renderer->setNeedsLayoutAndPrefWidthsRecalc();
+ c->m_countInParent = newCount;
+ // m_renderer contains the parent of the render node
+ // corresponding to a CounterNode. Let's find the counter
+ // child and make this re-layout.
+ for (RenderObject* o = c->m_renderer->firstChild(); o; o = o->nextSibling())
+ if (!o->documentBeingDestroyed() && o->isCounter()) {
+ o->setNeedsLayoutAndPrefWidthsRecalc();
+ break;
+ }
}
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/HitTestResult.cpp b/src/3rdparty/webkit/WebCore/rendering/HitTestResult.cpp
index 0aaddc9fd0..50933c6d49 100644
--- a/src/3rdparty/webkit/WebCore/rendering/HitTestResult.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/HitTestResult.cpp
@@ -123,17 +123,6 @@ Frame* HitTestResult::targetFrame() const
return frame->tree()->find(m_innerURLElement->target());
}
-IntRect HitTestResult::boundingBox() const
-{
- if (m_innerNonSharedNode) {
- RenderObject* renderer = m_innerNonSharedNode->renderer();
- if (renderer)
- return renderer->absoluteBoundingBoxRect();
- }
-
- return IntRect();
-}
-
bool HitTestResult::isSelected() const
{
if (!m_innerNonSharedNode)
@@ -246,7 +235,7 @@ IntRect HitTestResult::imageRect() const
{
if (!image())
return IntRect();
- return m_innerNonSharedNode->renderBox()->absoluteContentBox();
+ return m_innerNonSharedNode->renderBox()->absoluteContentQuad().enclosingBoundingBox();
}
KURL HitTestResult::absoluteImageURL() const
diff --git a/src/3rdparty/webkit/WebCore/rendering/HitTestResult.h b/src/3rdparty/webkit/WebCore/rendering/HitTestResult.h
index f29ca41950..25e10585c5 100644
--- a/src/3rdparty/webkit/WebCore/rendering/HitTestResult.h
+++ b/src/3rdparty/webkit/WebCore/rendering/HitTestResult.h
@@ -63,7 +63,6 @@ public:
void setIsOverWidget(bool b) { m_isOverWidget = b; }
Frame* targetFrame() const;
- IntRect boundingBox() const;
bool isSelected() const;
String spellingToolTip(TextDirection&) const;
String replacedString() const;
diff --git a/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp b/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
index 599129b340..baea956bc0 100644
--- a/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/InlineFlowBox.cpp
@@ -429,7 +429,7 @@ void InlineFlowBox::computeLogicalBoxHeights(int& maxPositionTop, int& maxPositi
}
lineHeight = baseline + baselineToBottom;
} else if (parentLineHeight.isPercent()) {
- lineHeight = parentLineHeight.calcMinValue(curr->renderer()->style()->fontSize());
+ lineHeight = parentLineHeight.calcMinValue(curr->renderer()->style()->fontSize(), true);
baseline = 0;
for (size_t i = 0; i < usedFonts.size(); ++i) {
int halfLeading = (lineHeight - usedFonts[i]->ascent() - usedFonts[i]->descent()) / 2;
@@ -578,28 +578,23 @@ void InlineFlowBox::computeVerticalOverflow(int lineTop, int lineBottom, bool st
topVisualOverflow = min(curr->y() + childOverflowTop, topVisualOverflow);
bottomVisualOverflow = max(curr->y() + text->height() + childOverflowBottom, bottomVisualOverflow);
- } else {
- // Only include overflow from inline flows and replaced inlines if they do not paint themselves.
- bool childIsSelfPainting = curr->boxModelObject()->hasSelfPaintingLayer();
- if (curr->renderer()->isRenderInline()) {
- InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
- flow->computeVerticalOverflow(lineTop, lineBottom, strictMode);
- if (!childIsSelfPainting) {
- topLayoutOverflow = min(topLayoutOverflow, flow->topLayoutOverflow());
- bottomLayoutOverflow = max(bottomLayoutOverflow, flow->bottomLayoutOverflow());
- topVisualOverflow = min(topVisualOverflow, flow->topVisualOverflow());
- bottomVisualOverflow = max(bottomVisualOverflow, flow->bottomVisualOverflow());
- }
- } else if (!childIsSelfPainting){
- RenderBox* box = toRenderBox(curr->renderer());
- int boxY = curr->y();
- int childTopOverflow = box->hasOverflowClip() ? 0 : box->topLayoutOverflow();
- int childBottomOverflow = box->hasOverflowClip() ? curr->height() : box->bottomLayoutOverflow();
- topLayoutOverflow = min(boxY + childTopOverflow, topLayoutOverflow);
- bottomLayoutOverflow = max(boxY + childBottomOverflow, bottomLayoutOverflow);
- topVisualOverflow = min(boxY + box->topVisualOverflow(), topVisualOverflow);
- bottomVisualOverflow = max(boxY + box->bottomVisualOverflow(), bottomVisualOverflow);
- }
+ } else if (curr->renderer()->isRenderInline()) {
+ InlineFlowBox* flow = static_cast<InlineFlowBox*>(curr);
+ flow->computeVerticalOverflow(lineTop, lineBottom, strictMode);
+ topLayoutOverflow = min(topLayoutOverflow, flow->topLayoutOverflow());
+ bottomLayoutOverflow = max(bottomLayoutOverflow, flow->bottomLayoutOverflow());
+ topVisualOverflow = min(topVisualOverflow, flow->topVisualOverflow());
+ bottomVisualOverflow = max(bottomVisualOverflow, flow->bottomVisualOverflow());
+ } else if (!curr->boxModelObject()->hasSelfPaintingLayer()){
+ // Only include overflow from replaced inlines if they do not paint themselves.
+ RenderBox* box = toRenderBox(curr->renderer());
+ int boxY = curr->y();
+ int childTopOverflow = box->hasOverflowClip() ? 0 : box->topLayoutOverflow();
+ int childBottomOverflow = box->hasOverflowClip() ? curr->height() : box->bottomLayoutOverflow();
+ topLayoutOverflow = min(boxY + childTopOverflow, topLayoutOverflow);
+ bottomLayoutOverflow = max(boxY + childBottomOverflow, bottomLayoutOverflow);
+ topVisualOverflow = min(boxY + box->topVisualOverflow(), topVisualOverflow);
+ bottomVisualOverflow = max(boxY + box->bottomVisualOverflow(), bottomVisualOverflow);
}
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp
index 29e2e5761f..9611660427 100644
--- a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.cpp
@@ -46,6 +46,16 @@ namespace WebCore {
using namespace HTMLNames;
+HTMLMediaElement* toParentMediaElement(RenderObject* o)
+{
+ Node* node = o->node();
+ Node* mediaNode = node ? node->shadowAncestorNode() : 0;
+ if (!mediaNode || (!mediaNode->hasTagName(HTMLNames::videoTag) && !mediaNode->hasTagName(HTMLNames::audioTag)))
+ return 0;
+
+ return static_cast<HTMLMediaElement*>(mediaNode);
+}
+
// FIXME: These constants may need to be tweaked to better match the seeking in the QuickTime plug-in.
static const float cSeekRepeatDelay = 0.1f;
static const float cStepTime = 0.07f;
@@ -138,7 +148,7 @@ bool MediaControlElement::rendererIsNeeded(RenderStyle* style)
ASSERT(document()->page());
return HTMLDivElement::rendererIsNeeded(style) && parent() && parent()->renderer()
- && document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement);
+ && (!style->hasAppearance() || document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement));
}
void MediaControlElement::attach()
@@ -366,7 +376,7 @@ bool MediaControlInputElement::rendererIsNeeded(RenderStyle* style)
ASSERT(document()->page());
return HTMLInputElement::rendererIsNeeded(style) && parent() && parent()->renderer()
- && document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement);
+ && (!style->hasAppearance() || document()->page()->theme()->shouldRenderMediaControlPart(style->appearance(), m_mediaElement));
}
void MediaControlInputElement::attach()
@@ -636,6 +646,15 @@ void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
}
}
+void MediaControlVolumeSliderElement::update()
+{
+ float volume = m_mediaElement->volume();
+ if (value().toFloat() != volume) {
+ setValue(String::number(volume));
+ MediaControlInputElement::update();
+ }
+}
+
// ----------------------------
MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Document* document, HTMLMediaElement* element)
@@ -646,12 +665,12 @@ MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Documen
void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
{
if (event->type() == eventNames().clickEvent) {
+ m_mediaElement->enterFullscreen();
event->setDefaultHandled();
}
HTMLInputElement::defaultEventHandler(event);
}
-
// ----------------------------
MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(Document* document, PseudoId pseudo, HTMLMediaElement* element)
diff --git a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h
index f692485de7..8b297733fd 100644
--- a/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h
+++ b/src/3rdparty/webkit/WebCore/rendering/MediaControlElements.h
@@ -66,6 +66,8 @@ enum MediaControlElementType {
MediaVolumeSliderThumb
};
+HTMLMediaElement* toParentMediaElement(RenderObject*);
+
class MediaControlShadowRootElement : public HTMLDivElement {
public:
MediaControlShadowRootElement(Document*, HTMLMediaElement*);
@@ -232,6 +234,7 @@ class MediaControlVolumeSliderElement : public MediaControlInputElement {
public:
MediaControlVolumeSliderElement(Document*, HTMLMediaElement*);
virtual void defaultEventHandler(Event*);
+ virtual void update();
};
// ----------------------------
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBR.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBR.cpp
index f40709912d..e05c8b4733 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBR.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBR.cpp
@@ -64,7 +64,7 @@ int RenderBR::lineHeight(bool firstLine, bool /*isRootLineBox*/) const
return s->font().lineSpacing();
}
if (lh.isPercent())
- return lh.calcMinValue(s->fontSize());
+ return lh.calcMinValue(s->fontSize(), true);
return lh.value();
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
index ae0d76df40..d5bb7787c4 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.cpp
@@ -163,15 +163,18 @@ RenderBlock::~RenderBlock()
void RenderBlock::destroy()
{
- // Detach our continuation first.
- if (m_inlineContinuation)
- m_inlineContinuation->destroy();
- m_inlineContinuation = 0;
-
// Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
- // properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
+ // properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
children()->destroyLeftoverChildren();
+ // Destroy our continuation before anything other than anonymous children.
+ // The reason we don't destroy it before anonymous children is that they may
+ // have continuations of their own that are anonymous children of our continuation.
+ if (m_inlineContinuation) {
+ m_inlineContinuation->destroy();
+ m_inlineContinuation = 0;
+ }
+
if (!documentBeingDestroyed()) {
if (firstLineBox()) {
// We can't wait for RenderBox::destroy to clear the selection,
@@ -774,7 +777,9 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
// Repaint with our new bounds if they are different from our old bounds.
bool didFullRepaint = repainter.repaintAfterLayout();
if (!didFullRepaint && repaintTop != repaintBottom && (style()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
- IntRect repaintRect(leftVisibleOverflow(), repaintTop, rightVisibleOverflow() - leftVisibleOverflow(), repaintBottom - repaintTop);
+ int repaintLeft = min(leftVisualOverflow(), leftLayoutOverflow());
+ int repaintRight = max(rightVisualOverflow(), rightLayoutOverflow());
+ IntRect repaintRect(repaintLeft, repaintTop, repaintRight - repaintLeft, repaintBottom - repaintTop);
// FIXME: Deal with multiple column repainting. We have to split the repaint
// rect up into multiple rects if it spans columns.
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp
index c8d30372a1..1df82a4093 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp
@@ -139,6 +139,8 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl
markContainingBlocksForLayout();
if (style()->position() == StaticPosition)
repaint();
+ else if (newStyle->position() == AbsolutePosition || newStyle->position() == FixedPosition)
+ parent()->setChildNeedsLayout(true);
if (isFloating() && !isPositioned() && (newStyle->position() == AbsolutePosition || newStyle->position() == FixedPosition))
removeFloatingOrPositionedChildFromBlockLists();
}
@@ -961,10 +963,10 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool
transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
if (containerSkipped) {
- // There can't be a transfrom between repaintContainer and o, because transforms create containers, so it should be safe
+ // There can't be a transform between repaintContainer and o, because transforms create containers, so it should be safe
// to just subtract the delta between the repaintContainer and o.
- IntSize repaintContainerOffset = repaintContainer->offsetFromContainer(o);
- transformState.move(-repaintContainerOffset.width(), -repaintContainerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
+ transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
return;
}
@@ -1201,7 +1203,7 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In
if (containerSkipped) {
// If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.
- IntSize containerOffset = repaintContainer->offsetFromContainer(o);
+ IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
rect.move(-containerOffset);
return;
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBox.h b/src/3rdparty/webkit/WebCore/rendering/RenderBox.h
index 41c5622588..9050dcbe14 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderBox.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderBox.h
@@ -318,7 +318,7 @@ protected:
virtual bool shouldCalculateSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
- virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&) const;
virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
private:
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderCounter.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderCounter.cpp
index 67e5cbaf78..17c6dad211 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderCounter.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderCounter.cpp
@@ -143,13 +143,19 @@ static bool findPlaceForCounter(RenderObject* object, const AtomicString& counte
RenderObject* resetCandidate = isReset ? object->parent() : previousSiblingOrParent(object);
RenderObject* prevCounterCandidate = object;
CounterNode* candidateCounter = 0;
+ // When a reset counter is chosen as candidateCounter, we'll
+ // decide the new node should be a child of the reset node or a
+ // sibling or the reset node. This flag controls it.
+ bool createChildForReset = true;
while ((prevCounterCandidate = prevCounterCandidate->previousInPreOrder())) {
CounterNode* c = counter(prevCounterCandidate, counterName, false);
if (prevCounterCandidate == resetCandidate) {
- if (!candidateCounter)
+ if (!candidateCounter) {
candidateCounter = c;
+ createChildForReset = true;
+ }
if (candidateCounter) {
- if (candidateCounter->isReset()) {
+ if (createChildForReset && candidateCounter->isReset()) {
parent = candidateCounter;
previousSibling = 0;
} else {
@@ -160,10 +166,19 @@ static bool findPlaceForCounter(RenderObject* object, const AtomicString& counte
}
resetCandidate = previousSiblingOrParent(resetCandidate);
} else if (c) {
- if (c->isReset())
- candidateCounter = 0;
- else if (!candidateCounter)
+ if (c->isReset()) {
+ if (c->parent()) {
+ // The new node may be the next sibling of this reset node.
+ createChildForReset = false;
+ candidateCounter = c;
+ } else {
+ createChildForReset = true;
+ candidateCounter = 0;
+ }
+ } else if (!candidateCounter) {
+ createChildForReset = true;
candidateCounter = c;
+ }
}
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderImage.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderImage.cpp
index 51c3073165..4206b1cf1c 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderImage.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderImage.cpp
@@ -227,7 +227,7 @@ bool RenderImage::setImageSizeForAltText(CachedImage* newImage /* = 0 */)
imageHeight = paddingHeight;
}
- if (newImage) {
+ if (newImage && newImage->image()) {
// imageSize() returns 0 for the error image. We need the true size of the
// error image, so we have to get it by grabbing image() directly.
imageWidth += newImage->image()->width() * style()->effectiveZoom();
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp
index a5e973eb57..2f9a247a5e 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderInline.cpp
@@ -30,6 +30,7 @@
#include "RenderArena.h"
#include "RenderBlock.h"
#include "RenderView.h"
+#include "TransformState.h"
#include "VisiblePosition.h"
#if ENABLE(DASHBOARD_SUPPORT)
@@ -51,15 +52,18 @@ RenderInline::RenderInline(Node* node)
void RenderInline::destroy()
{
- // Detach our continuation first.
- if (m_continuation)
- m_continuation->destroy();
- m_continuation = 0;
-
// Make sure to destroy anonymous children first while they are still connected to the rest of the tree, so that they will
// properly dirty line boxes that they are removed from. Effects that do :before/:after only on hover could crash otherwise.
children()->destroyLeftoverChildren();
+ // Destroy our continuation before anything other than anonymous children.
+ // The reason we don't destroy it before anonymous children is that they may
+ // have continuations of their own that are anonymous children of our continuation.
+ if (m_continuation) {
+ m_continuation->destroy();
+ m_continuation = 0;
+ }
+
if (!documentBeingDestroyed()) {
if (firstLineBox()) {
// We can't wait for RenderBoxModelObject::destroy to clear the selection,
@@ -697,7 +701,7 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer,
if (containerSkipped) {
// If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.
- IntSize containerOffset = repaintContainer->offsetFromContainer(o);
+ IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
rect.move(-containerOffset);
return;
}
@@ -705,6 +709,92 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer,
o->computeRectForRepaint(repaintContainer, rect, fixed);
}
+IntSize RenderInline::offsetFromContainer(RenderObject* container) const
+{
+ ASSERT(container == this->container());
+
+ IntSize offset;
+ if (isRelPositioned())
+ offset += relativePositionOffset();
+
+ if (!isInline() || isReplaced()) {
+ RenderBlock* cb;
+ if (container->isBlockFlow() && (cb = toRenderBlock(container))->hasColumns()) {
+ IntRect rect(0, 0, 1, 1);
+ cb->adjustRectForColumns(rect);
+ }
+ }
+
+ if (container->hasOverflowClip())
+ offset -= toRenderBox(container)->layer()->scrolledContentOffset();
+
+ return offset;
+}
+
+void RenderInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
+{
+ if (repaintContainer == this)
+ return;
+
+ if (RenderView *v = view()) {
+ if (v->layoutStateEnabled() && !repaintContainer) {
+ LayoutState* layoutState = v->layoutState();
+ IntSize offset = layoutState->m_offset;
+ if (style()->position() == RelativePosition && layer())
+ offset += layer()->relativePositionOffset();
+ transformState.move(offset);
+ return;
+ }
+ }
+
+ bool containerSkipped;
+ RenderObject* o = container(repaintContainer, &containerSkipped);
+ if (!o)
+ return;
+
+ IntSize containerOffset = offsetFromContainer(o);
+
+ bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ if (useTransforms && shouldUseTransformFromContainer(o)) {
+ TransformationMatrix t;
+ getTransformFromContainer(o, containerOffset, t);
+ transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ } else
+ transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+
+ if (containerSkipped) {
+ // There can't be a transform between repaintContainer and o, because transforms create containers, so it should be safe
+ // to just subtract the delta between the repaintContainer and o.
+ IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
+ transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ return;
+ }
+
+ o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
+}
+
+void RenderInline::mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState& transformState) const
+{
+ // We don't expect this function to be called during layout.
+ ASSERT(!view() || !view()->layoutStateEnabled());
+
+ RenderObject* o = container();
+ if (!o)
+ return;
+
+ o->mapAbsoluteToLocalPoint(fixed, useTransforms, transformState);
+
+ IntSize containerOffset = offsetFromContainer(o);
+
+ bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ if (useTransforms && shouldUseTransformFromContainer(o)) {
+ TransformationMatrix t;
+ getTransformFromContainer(o, containerOffset, t);
+ transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+ } else
+ transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+}
+
void RenderInline::updateDragState(bool dragOn)
{
RenderBoxModelObject::updateDragState(dragOn);
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderInline.h b/src/3rdparty/webkit/WebCore/rendering/RenderInline.h
index 8e0064e702..8e9715ccbd 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderInline.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderInline.h
@@ -44,6 +44,8 @@ public:
virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
+ virtual IntSize offsetFromContainer(RenderObject*) const;
+
IntRect linesBoundingBox() const;
IntRect linesVisibleOverflowBoundingBox() const;
@@ -107,6 +109,9 @@ private:
virtual IntRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, int outlineWidth);
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& rect, bool fixed);
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState&) const;
+ virtual void mapAbsoluteToLocalPoint(bool fixed, bool useTransforms, TransformState&) const;
+
virtual VisiblePosition positionForPoint(const IntPoint&);
virtual IntRect borderBoundingBox() const
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
index 95db43a1a8..fea61c9feb 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.cpp
@@ -311,12 +311,19 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
if (m_reflection)
m_reflection->layout();
+#if USE(ACCELERATED_COMPOSITING)
+ // Clear the IsCompositingUpdateRoot flag once we've found the first compositing layer in this update.
+ bool isUpdateRoot = (flags & IsCompositingUpdateRoot);
+ if (isComposited())
+ flags &= ~IsCompositingUpdateRoot;
+#endif
+
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->updateLayerPositions(flags);
#if USE(ACCELERATED_COMPOSITING)
if ((flags & UpdateCompositingLayers) && isComposited())
- backing()->updateAfterLayout(RenderLayerBacking::CompositingChildren);
+ backing()->updateAfterLayout(RenderLayerBacking::CompositingChildren, isUpdateRoot);
#endif
// With all our children positioned, now update our marquee if we need to.
@@ -662,21 +669,20 @@ RenderLayer* RenderLayer::enclosingTransformedAncestor() const
return curr;
}
+static inline const RenderLayer* compositingContainer(const RenderLayer* layer)
+{
+ return layer->isNormalFlowOnly() ? layer->parent() : layer->stackingContext();
+}
+
#if USE(ACCELERATED_COMPOSITING)
RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const
{
if (includeSelf && isComposited())
return const_cast<RenderLayer*>(this);
- // Compositing layers are parented according to stacking order and overflow list,
- // so we have to check whether the parent is a stacking context, or whether
- // the child is overflow-only.
- bool inNormalFlowList = isNormalFlowOnly();
- for (RenderLayer* curr = parent(); curr; curr = curr->parent()) {
- if (curr->isComposited() && (inNormalFlowList || curr->isStackingContext()))
- return curr;
-
- inNormalFlowList = curr->isNormalFlowOnly();
+ for (const RenderLayer* curr = compositingContainer(this); curr; curr = compositingContainer(curr)) {
+ if (curr->isComposited())
+ return const_cast<RenderLayer*>(curr);
}
return 0;
@@ -1140,8 +1146,10 @@ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repai
#if USE(ACCELERATED_COMPOSITING)
if (compositor()->inCompositingMode()) {
- if (RenderLayer* compositingAncestor = ancestorCompositingLayer())
- compositingAncestor->backing()->updateAfterLayout(RenderLayerBacking::AllDescendants);
+ if (RenderLayer* compositingAncestor = ancestorCompositingLayer()) {
+ bool isUpdateRoot = true;
+ compositingAncestor->backing()->updateAfterLayout(RenderLayerBacking::AllDescendants, isUpdateRoot);
+ }
}
#endif
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
index 9d2212bfae..a274638586 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayer.h
@@ -298,10 +298,11 @@ public:
enum UpdateLayerPositionsFlag {
DoFullRepaint = 1,
CheckForRepaint = 1 << 1,
- UpdateCompositingLayers = 1 << 2,
+ IsCompositingUpdateRoot = 1 << 2,
+ UpdateCompositingLayers = 1 << 3,
};
typedef unsigned UpdateLayerPositionsFlags;
- void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | UpdateCompositingLayers);
+ void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers);
void updateTransform();
@@ -327,6 +328,7 @@ public:
Vector<RenderLayer*>* normalFlowList() const { return m_normalFlowList; }
bool hasVisibleContent() const { return m_hasVisibleContent; }
+ bool hasVisibleDescendant() const { return m_hasVisibleDescendant; }
void setHasVisibleContent(bool);
void dirtyVisibleContentStatus();
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.cpp
index 941817cbd4..d7248d49f0 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.cpp
@@ -89,8 +89,8 @@ void RenderLayerBacking::createGraphicsLayer()
m_graphicsLayer->setName("Anonymous Node");
#endif // NDEBUG
- updateLayerOpacity();
- updateLayerTransform();
+ updateLayerOpacity(renderer()->style());
+ updateLayerTransform(renderer()->style());
}
void RenderLayerBacking::destroyGraphicsLayer()
@@ -104,15 +104,13 @@ void RenderLayerBacking::destroyGraphicsLayer()
m_maskLayer = 0;
}
-void RenderLayerBacking::updateLayerOpacity()
+void RenderLayerBacking::updateLayerOpacity(const RenderStyle* style)
{
- m_graphicsLayer->setOpacity(compositingOpacity(renderer()->opacity()));
+ m_graphicsLayer->setOpacity(compositingOpacity(style->opacity()));
}
-void RenderLayerBacking::updateLayerTransform()
+void RenderLayerBacking::updateLayerTransform(const RenderStyle* style)
{
- RenderStyle* style = renderer()->style();
-
// FIXME: This could use m_owningLayer->transform(), but that currently has transform-origin
// baked into it, and we don't want that.
TransformationMatrix t;
@@ -148,7 +146,7 @@ void RenderLayerBacking::updateCompositedBounds()
setCompositedBounds(layerBounds);
}
-void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth)
+void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth, bool isUpdateRoot)
{
RenderLayerCompositor* layerCompositor = compositor();
if (!layerCompositor->compositingLayersNeedRebuild()) {
@@ -162,7 +160,7 @@ void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth)
updateCompositedBounds();
layerCompositor->updateCompositingDescendantGeometry(m_owningLayer, m_owningLayer, updateDepth);
- if (!m_owningLayer->parent()) {
+ if (isUpdateRoot) {
updateGraphicsLayerGeometry();
layerCompositor->updateRootLayerPosition();
}
@@ -219,11 +217,11 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
// Set transform property, if it is not animating. We have to do this here because the transform
// is affected by the layer dimensions.
if (!renderer()->animation()->isAnimatingPropertyOnRenderer(renderer(), CSSPropertyWebkitTransform))
- updateLayerTransform();
+ updateLayerTransform(renderer()->style());
// Set opacity, if it is not animating.
if (!renderer()->animation()->isAnimatingPropertyOnRenderer(renderer(), CSSPropertyOpacity))
- updateLayerOpacity();
+ updateLayerOpacity(renderer()->style());
RenderStyle* style = renderer()->style();
m_graphicsLayer->setPreserves3D(style->transformStyle3D() == TransformStyle3DPreserve3D);
@@ -886,7 +884,7 @@ void RenderLayerBacking::paintIntoLayer(RenderLayer* rootLayer, GraphicsContext*
if (paintingRoot && !renderer()->isDescendantOf(paintingRoot))
paintingRootForRenderer = paintingRoot;
- bool shouldPaint = m_owningLayer->hasVisibleContent() && m_owningLayer->isSelfPaintingLayer();
+ bool shouldPaint = (m_owningLayer->hasVisibleContent() || m_owningLayer->hasVisibleDescendant()) && m_owningLayer->isSelfPaintingLayer();
if (shouldPaint && (paintingPhase & GraphicsLayerPaintBackground)) {
// If this is the root then we need to send in a bigger bounding box
@@ -1082,8 +1080,11 @@ bool RenderLayerBacking::startTransition(double beginTime, int property, const R
opacityVector.insert(new FloatAnimationValue(0, compositingOpacity(fromStyle->opacity())));
opacityVector.insert(new FloatAnimationValue(1, compositingOpacity(toStyle->opacity())));
// The boxSize param is only used for transform animations (which can only run on RenderBoxes), so we pass an empty size here.
- if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityAnim, String(), beginTime))
+ if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityAnim, String(), beginTime)) {
+ // To ensure that the correct opacity is visible when the animation ends, also set the final opacity.
+ updateLayerOpacity(toStyle);
didAnimate = true;
+ }
}
}
@@ -1093,8 +1094,11 @@ bool RenderLayerBacking::startTransition(double beginTime, int property, const R
KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
transformVector.insert(new TransformAnimationValue(0, &fromStyle->transform()));
transformVector.insert(new TransformAnimationValue(1, &toStyle->transform()));
- if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), transformAnim, String(), beginTime))
+ if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->borderBoxRect().size(), transformAnim, String(), beginTime)) {
+ // To ensure that the correct transform is visible when the animation ends, also set the final opacity.
+ updateLayerTransform(toStyle);
didAnimate = true;
+ }
}
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.h b/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.h
index e12aa5845e..17bcaf707f 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayerBacking.h
@@ -54,7 +54,7 @@ public:
RenderLayer* owningLayer() const { return m_owningLayer; }
enum UpdateDepth { CompositingChildren, AllDescendants };
- void updateAfterLayout(UpdateDepth);
+ void updateAfterLayout(UpdateDepth, bool isUpdateRoot);
// Returns true if layer configuration changed.
bool updateGraphicsLayerConfiguration();
@@ -140,8 +140,8 @@ private:
// Result is perspective origin in pixels.
FloatPoint computePerspectiveOrigin(const IntRect& borderBox) const;
- void updateLayerOpacity();
- void updateLayerTransform();
+ void updateLayerOpacity(const RenderStyle*);
+ void updateLayerTransform(const RenderStyle*);
// Return the opacity value that this layer should use for compositing.
float compositingOpacity(float rendererOpacity) const;
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderLayerCompositor.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderLayerCompositor.cpp
index bcd1f08145..5201287eb9 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderLayerCompositor.cpp
@@ -535,6 +535,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
void RenderLayerCompositor::setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer)
{
+ ASSERT(!parentLayer || childLayer->ancestorCompositingLayer() == parentLayer);
ASSERT(childLayer->isComposited());
// It's possible to be called with a parent that isn't yet composited when we're doing
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
index f94f7ce1d4..0edfdef31b 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderListBox.cpp
@@ -508,7 +508,7 @@ bool RenderListBox::listIndexIsVisible(int index)
return index >= m_indexOffset && index < m_indexOffset + numVisibleItems();
}
-bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Node**)
{
return m_vBar && m_vBar->scroll(direction, granularity, multiplier);
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderListBox.h b/src/3rdparty/webkit/WebCore/rendering/RenderListBox.h
index e5454e5653..aafb87e957 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderListBox.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderListBox.h
@@ -68,7 +68,7 @@ private:
virtual bool isPointInOverflowControl(HitTestResult&, int x, int y, int tx, int ty);
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
+ virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0);
virtual void calcPrefWidths();
virtual int baselinePosition(bool firstLine, bool isRootLineBox) const;
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderMedia.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderMedia.cpp
index 1da26289d1..1d4da23381 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderMedia.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderMedia.cpp
@@ -258,6 +258,7 @@ void RenderMedia::createVolumeSlider()
m_volumeSlider = new MediaControlVolumeSliderElement(document(), mediaElement());
m_volumeSlider->setAttribute(precisionAttr, "float");
m_volumeSlider->setAttribute(maxAttr, "1");
+ m_volumeSlider->setAttribute(valueAttr, String::number(mediaElement()->volume()));
m_volumeSlider->attachToParent(m_volumeSliderContainer.get());
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderMediaControls.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderMediaControls.cpp
index 0ce0642ece..9cc1493f52 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderMediaControls.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderMediaControls.cpp
@@ -37,7 +37,7 @@ using namespace std;
namespace WebCore {
-#if !defined(NDEBUG) && defined(USE_DEBUG_SAFARI_THEME)
+#ifdef DEBUG_ALL
SOFT_LINK_DEBUG_LIBRARY(SafariTheme)
#else
SOFT_LINK_LIBRARY(SafariTheme)
@@ -82,16 +82,6 @@ void RenderMediaControls::adjustMediaSliderThumbSize(RenderObject* o)
o->style()->setHeight(Length(static_cast<int>(mediaSliderThumbHeight * zoomLevel), Fixed));
}
-static HTMLMediaElement* parentMediaElement(RenderObject* o)
-{
- Node* node = o->node();
- Node* mediaNode = node ? node->shadowAncestorNode() : 0;
- if (!mediaNode || (!mediaNode->hasTagName(HTMLNames::videoTag) && !mediaNode->hasTagName(HTMLNames::audioTag)))
- return 0;
-
- return static_cast<HTMLMediaElement*>(mediaNode);
-}
-
bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
{
ASSERT(SafariThemeLibrary());
@@ -121,7 +111,7 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
paintThemePart(SafariTheme::MediaSeekForwardButtonPart, paintInfo.context->platformContext(), r, NSRegularControlSize, determineState(o));
break;
case MediaSlider: {
- if (HTMLMediaElement* mediaElement = parentMediaElement(o))
+ if (HTMLMediaElement* mediaElement = toParentMediaElement(o))
STPaintProgressIndicator(SafariTheme::MediaType, paintInfo.context->platformContext(), r, NSRegularControlSize, 0, mediaElement->percentLoaded());
break;
}
@@ -159,4 +149,3 @@ bool RenderMediaControls::paintMediaControlsPart(MediaControlElementType part, R
#endif // #if ENABLE(VIDEO)
} // namespace WebCore
-
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.cpp
new file mode 100644
index 0000000000..56fbec43c2
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.cpp
@@ -0,0 +1,304 @@
+/*
+ * Copyright (C) 2009 Apple Inc.
+ * Copyright (C) 2009 Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "RenderMediaControlsChromium.h"
+
+#include "Gradient.h"
+#include "GraphicsContext.h"
+#include "HTMLMediaElement.h"
+#include "HTMLNames.h"
+
+namespace WebCore {
+
+#if ENABLE(VIDEO)
+
+typedef WTF::HashMap<const char*, Image*> MediaControlImageMap;
+static MediaControlImageMap* gMediaControlImageMap = 0;
+
+static Image* platformResource(const char* name)
+{
+ if (!gMediaControlImageMap)
+ gMediaControlImageMap = new MediaControlImageMap();
+ if (Image* image = gMediaControlImageMap->get(name))
+ return image;
+ if (Image* image = Image::loadPlatformResource(name).releaseRef()) {
+ gMediaControlImageMap->set(name, image);
+ return image;
+ }
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+static bool hasSource(const HTMLMediaElement* mediaElement)
+{
+ return mediaElement->networkState() != HTMLMediaElement::NETWORK_EMPTY
+ && mediaElement->networkState() != HTMLMediaElement::NETWORK_NO_SOURCE;
+}
+
+static bool paintMediaButton(GraphicsContext* context, const IntRect& rect, Image* image)
+{
+ IntRect imageRect = image->rect();
+ context->drawImage(image, rect);
+ return true;
+}
+
+static bool paintMediaMuteButton(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ static Image* soundFull = platformResource("mediaSoundFull");
+ static Image* soundNone = platformResource("mediaSoundNone");
+ static Image* soundDisabled = platformResource("mediaSoundDisabled");
+
+ if (!hasSource(mediaElement) || !mediaElement->hasAudio())
+ return paintMediaButton(paintInfo.context, rect, soundDisabled);
+
+ return paintMediaButton(paintInfo.context, rect, mediaElement->muted() ? soundNone: soundFull);
+}
+
+static bool paintMediaPlayButton(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ static Image* mediaPlay = platformResource("mediaPlay");
+ static Image* mediaPause = platformResource("mediaPause");
+ static Image* mediaPlayDisabled = platformResource("mediaPlayDisabled");
+
+ if (!hasSource(mediaElement))
+ return paintMediaButton(paintInfo.context, rect, mediaPlayDisabled);
+
+ return paintMediaButton(paintInfo.context, rect, mediaElement->paused() ? mediaPlay : mediaPause);
+}
+
+static bool paintMediaSlider(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ RenderStyle* style = object->style();
+ GraphicsContext* context = paintInfo.context;
+
+ // Draw the border of the time bar.
+ // FIXME: this should be a rounded rect but need to fix GraphicsContextSkia first.
+ // https://bugs.webkit.org/show_bug.cgi?id=30143
+ context->save();
+ context->setShouldAntialias(true);
+ context->setStrokeStyle(SolidStroke);
+ context->setStrokeColor(style->borderLeftColor());
+ context->setStrokeThickness(style->borderLeftWidth());
+ context->setFillColor(style->backgroundColor());
+ context->drawRect(rect);
+ context->restore();
+
+ // Draw the buffered ranges.
+ // FIXME: Draw multiple ranges if there are multiple buffered ranges.
+ IntRect bufferedRect = rect;
+ bufferedRect.inflate(-style->borderLeftWidth());
+ bufferedRect.setWidth((bufferedRect.width() * mediaElement->percentLoaded()));
+
+ // Don't bother drawing an empty area.
+ if (!bufferedRect.isEmpty()) {
+ IntPoint sliderTopLeft = bufferedRect.location();
+ IntPoint sliderTopRight = sliderTopLeft;
+ sliderTopRight.move(0, bufferedRect.height());
+
+ RefPtr<Gradient> gradient = Gradient::create(sliderTopLeft, sliderTopRight);
+ Color startColor = object->style()->color();
+ gradient->addColorStop(0.0, startColor);
+ gradient->addColorStop(1.0, Color(startColor.red() / 2, startColor.green() / 2, startColor.blue() / 2, startColor.alpha()));
+
+ context->save();
+ context->setStrokeStyle(NoStroke);
+ context->setFillGradient(gradient);
+ context->fillRect(bufferedRect);
+ context->restore();
+ }
+
+ return true;
+}
+
+static bool paintMediaSliderThumb(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ if (!object->parent()->isSlider())
+ return false;
+
+ HTMLMediaElement* mediaElement = toParentMediaElement(object->parent());
+ if (!mediaElement)
+ return false;
+
+ if (!hasSource(mediaElement))
+ return true;
+
+ static Image* mediaSliderThumb = platformResource("mediaSliderThumb");
+ return paintMediaButton(paintInfo.context, rect, mediaSliderThumb);
+}
+
+static bool paintMediaVolumeSlider(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ GraphicsContext* context = paintInfo.context;
+ Color originalColor = context->strokeColor();
+ if (originalColor != Color::white)
+ context->setStrokeColor(Color::white);
+
+ int x = rect.x() + rect.width() / 2;
+ context->drawLine(IntPoint(x, rect.y()), IntPoint(x, rect.y() + rect.height()));
+
+ if (originalColor != Color::white)
+ context->setStrokeColor(originalColor);
+ return true;
+}
+
+static bool paintMediaVolumeSliderThumb(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ if (!object->parent()->isSlider())
+ return false;
+
+ static Image* mediaVolumeSliderThumb = platformResource("mediaVolumeSliderThumb");
+ return paintMediaButton(paintInfo.context, rect, mediaVolumeSliderThumb);
+}
+
+static bool paintMediaTimelineContainer(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ HTMLMediaElement* mediaElement = toParentMediaElement(object);
+ if (!mediaElement)
+ return false;
+
+ if (!rect.isEmpty()) {
+ GraphicsContext* context = paintInfo.context;
+ Color originalColor = context->strokeColor();
+ float originalThickness = context->strokeThickness();
+ StrokeStyle originalStyle = context->strokeStyle();
+
+ context->setStrokeStyle(SolidStroke);
+
+ // Draw the left border using CSS defined width and color.
+ context->setStrokeThickness(object->style()->borderLeftWidth());
+ context->setStrokeColor(object->style()->borderLeftColor().rgb());
+ context->drawLine(IntPoint(rect.x() + 1, rect.y()),
+ IntPoint(rect.x() + 1, rect.y() + rect.height()));
+
+ // Draw the right border using CSS defined width and color.
+ context->setStrokeThickness(object->style()->borderRightWidth());
+ context->setStrokeColor(object->style()->borderRightColor().rgb());
+ context->drawLine(IntPoint(rect.x() + rect.width() - 1, rect.y()),
+ IntPoint(rect.x() + rect.width() - 1, rect.y() + rect.height()));
+
+ context->setStrokeColor(originalColor);
+ context->setStrokeThickness(originalThickness);
+ context->setStrokeStyle(originalStyle);
+ }
+ return true;
+}
+
+bool RenderMediaControlsChromium::shouldRenderMediaControlPart(ControlPart part, Element* e)
+{
+ UNUSED_PARAM(e);
+
+ switch (part) {
+ case MediaMuteButtonPart:
+ case MediaPlayButtonPart:
+ case MediaSliderPart:
+ case MediaSliderThumbPart:
+ case MediaVolumeSliderContainerPart:
+ case MediaVolumeSliderPart:
+ case MediaVolumeSliderThumbPart:
+ case MediaControlsBackgroundPart:
+ case MediaCurrentTimePart:
+ case MediaTimeRemainingPart:
+ return true;
+ default:
+ ;
+ }
+ return false;
+}
+
+bool RenderMediaControlsChromium::paintMediaControlsPart(MediaControlElementType part, RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+{
+ switch (part) {
+ case MediaMuteButton:
+ case MediaUnMuteButton:
+ return paintMediaMuteButton(object, paintInfo, rect);
+ case MediaPauseButton:
+ case MediaPlayButton:
+ return paintMediaPlayButton(object, paintInfo, rect);
+ case MediaSlider:
+ return paintMediaSlider(object, paintInfo, rect);
+ case MediaSliderThumb:
+ return paintMediaSliderThumb(object, paintInfo, rect);
+ case MediaVolumeSlider:
+ return paintMediaVolumeSlider(object, paintInfo, rect);
+ case MediaVolumeSliderThumb:
+ return paintMediaVolumeSliderThumb(object, paintInfo, rect);
+ case MediaTimelineContainer:
+ return paintMediaTimelineContainer(object, paintInfo, rect);
+ case MediaFullscreenButton:
+ case MediaSeekBackButton:
+ case MediaSeekForwardButton:
+ case MediaVolumeSliderContainer:
+ case MediaCurrentTimeDisplay:
+ case MediaTimeRemainingDisplay:
+ case MediaControlsPanel:
+ case MediaRewindButton:
+ case MediaReturnToRealtimeButton:
+ case MediaStatusDisplay:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ return false;
+}
+
+void RenderMediaControlsChromium::adjustMediaSliderThumbSize(RenderObject* object)
+{
+ static Image* mediaSliderThumb = platformResource("mediaSliderThumb");
+ static Image* mediaVolumeSliderThumb = platformResource("mediaVolumeSliderThumb");
+
+ Image* thumbImage = 0;
+ if (object->style()->appearance() == MediaSliderThumbPart)
+ thumbImage = mediaSliderThumb;
+ else if (object->style()->appearance() == MediaVolumeSliderThumbPart)
+ thumbImage = mediaVolumeSliderThumb;
+
+ float zoomLevel = object->style()->effectiveZoom();
+ if (thumbImage) {
+ object->style()->setWidth(Length(static_cast<int>(thumbImage->width() * zoomLevel), Fixed));
+ object->style()->setHeight(Length(static_cast<int>(thumbImage->height() * zoomLevel), Fixed));
+ }
+}
+
+#endif // #if ENABLE(VIDEO)
+
+} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.h b/src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.h
new file mode 100644
index 0000000000..d6d986cde0
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderMediaControlsChromium.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2009 Apple Inc.
+ * Copyright (C) 2009 Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RenderMediaControlsChromium_h
+#define RenderMediaControlsChromium_h
+
+#include "RenderObject.h"
+#include "MediaControlElements.h"
+
+namespace WebCore {
+
+class HTMLMediaElement;
+class RenderMediaControlsChromium {
+public:
+ static bool shouldRenderMediaControlPart(ControlPart, Element*);
+ static bool paintMediaControlsPart(MediaControlElementType, RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+ static void adjustMediaSliderThumbSize(RenderObject*);
+};
+
+} // namespace WebCore
+
+#endif // RenderMediaControlsChromium_h
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp
index b7f59e1139..a10ffd9609 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp
@@ -1568,7 +1568,7 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
// For changes in float styles, we need to conceivably remove ourselves
// from the floating objects list.
toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
- else if (isPositioned() && (newStyle->position() != AbsolutePosition && newStyle->position() != FixedPosition))
+ else if (isPositioned() && (m_style->position() != newStyle->position()))
// For changes in positioning styles, we need to conceivably remove ourselves
// from the positioned objects list.
toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists();
@@ -1755,6 +1755,23 @@ IntSize RenderObject::offsetFromContainer(RenderObject* o) const
return offset;
}
+IntSize RenderObject::offsetFromAncestorContainer(RenderObject* container) const
+{
+ IntSize offset;
+ const RenderObject* currContainer = this;
+ do {
+ RenderObject* nextContainer = currContainer->container();
+ ASSERT(nextContainer); // This means we reached the top without finding container.
+ if (!nextContainer)
+ break;
+ ASSERT(!currContainer->hasTransform());
+ offset += currContainer->offsetFromContainer(nextContainer);
+ currContainer = nextContainer;
+ } while (currContainer != container);
+
+ return offset;
+}
+
IntRect RenderObject::localCaretRect(InlineBox*, int, int* extraWidthToEndOfLine)
{
if (extraWidthToEndOfLine)
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.h b/src/3rdparty/webkit/WebCore/rendering/RenderObject.h
index 367eaa6a8b..e358c981ac 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.h
@@ -541,6 +541,8 @@ public:
// Return the offset from the container() renderer (excluding transforms)
virtual IntSize offsetFromContainer(RenderObject*) const;
+ // Return the offset from an object up the container() chain. Asserts that none of the intermediate objects have transforms.
+ IntSize offsetFromAncestorContainer(RenderObject*) const;
virtual void absoluteRects(Vector<IntRect>&, int, int) { }
// FIXME: useTransforms should go away eventually
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderPartObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderPartObject.cpp
index 199c0da0cd..e2c8e7d8af 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderPartObject.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderPartObject.cpp
@@ -249,7 +249,8 @@ void RenderPartObject::updateWidget(bool onlyCreateNonNetscapePlugins)
return;
}
- bool success = frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ bool success = o->dispatchBeforeLoadEvent(url) &&
+ frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues);
if (!success && m_hasFallbackContent)
o->renderFallbackContent();
} else if (node()->hasTagName(embedTag)) {
@@ -283,7 +284,8 @@ void RenderPartObject::updateWidget(bool onlyCreateNonNetscapePlugins)
}
- frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ if (o->dispatchBeforeLoadEvent(url))
+ frame->loader()->requestObject(this, url, o->getAttribute(nameAttr), serviceType, paramNames, paramValues);
}
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
else if (node()->hasTagName(videoTag) || node()->hasTagName(audioTag)) {
@@ -306,7 +308,9 @@ void RenderPartObject::updateWidget(bool onlyCreateNonNetscapePlugins)
}
serviceType = "application/x-media-element-proxy-plugin";
- frame->loader()->requestObject(this, url, nullAtom, serviceType, paramNames, paramValues);
+
+ if (o->dispatchBeforeLoadEvent(url))
+ frame->loader()->requestObject(this, url, nullAtom, serviceType, paramNames, paramValues);
}
#endif
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderSlider.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderSlider.cpp
index 247acda86d..442af39401 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderSlider.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderSlider.cpp
@@ -50,7 +50,7 @@ static const int defaultTrackLength = 129;
struct SliderRange {
bool isIntegral;
double minimum;
- double maximum;
+ double maximum; // maximum must be >= minimum.
explicit SliderRange(HTMLInputElement*);
double clampValue(double value);
@@ -80,12 +80,8 @@ SliderRange::SliderRange(HTMLInputElement* element)
isIntegral = !equalIgnoringCase(element->getAttribute(precisionAttr), "float");
- // FIXME: This treats maximum strings that can't be parsed as 0, but perhaps 100 would be more appropriate.
- const AtomicString& maxString = element->getAttribute(maxAttr);
- maximum = maxString.isNull() ? 100.0 : maxString.toDouble();
-
- // If the maximum is smaller, use it as the minimum.
- minimum = min(element->getAttribute(minAttr).toDouble(), maximum);
+ maximum = element->rangeMaximum();
+ minimum = element->rangeMinimum();
}
double SliderRange::clampValue(double value)
@@ -96,12 +92,14 @@ double SliderRange::clampValue(double value)
double SliderRange::valueFromElement(HTMLInputElement* element, bool* wasClamped)
{
- String valueString = element->value();
- double oldValue = valueString.isNull() ? (minimum + maximum) / 2 : valueString.toDouble();
+ double oldValue;
+ bool parseSuccess = HTMLInputElement::formStringToDouble(element->value(), &oldValue);
+ if (!parseSuccess)
+ oldValue = (minimum + maximum) / 2;
double newValue = clampValue(oldValue);
if (wasClamped)
- *wasClamped = valueString.isNull() || newValue != oldValue;
+ *wasClamped = !parseSuccess || newValue != oldValue;
return newValue;
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
index 8478432fb0..a49e092b1b 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlMultiLine.cpp
@@ -45,7 +45,9 @@ RenderTextControlMultiLine::~RenderTextControlMultiLine()
void RenderTextControlMultiLine::subtreeHasChanged()
{
RenderTextControl::subtreeHasChanged();
- static_cast<Element*>(node())->setFormControlValueMatchesRenderer(false);
+ HTMLTextAreaElement* textArea = static_cast<HTMLTextAreaElement*>(node());
+ textArea->setFormControlValueMatchesRenderer(false);
+ textArea->updateValidity();
if (!node()->focused())
return;
@@ -53,7 +55,7 @@ void RenderTextControlMultiLine::subtreeHasChanged()
node()->dispatchEvent(Event::create(eventNames().inputEvent, true, false));
if (Frame* frame = document()->frame())
- frame->textDidChangeInTextArea(static_cast<Element*>(node()));
+ frame->textDidChangeInTextArea(textArea);
}
bool RenderTextControlMultiLine::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.cpp
index 8d8ba97259..be800a7310 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -808,12 +808,12 @@ void RenderTextControlSingleLine::setScrollTop(int newTop)
innerTextElement()->setScrollTop(newTop);
}
-bool RenderTextControlSingleLine::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
+bool RenderTextControlSingleLine::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Node** stopNode)
{
RenderLayer* layer = innerTextElement()->renderBox()->layer();
if (layer && layer->scroll(direction, granularity, multiplier))
return true;
- return RenderBlock::scroll(direction, granularity, multiplier);
+ return RenderBlock::scroll(direction, granularity, multiplier, stopNode);
}
PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.h b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.h
index 4a17918db4..e30ff0d3d1 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTextControlSingleLine.h
@@ -72,7 +72,7 @@ private:
virtual int scrollHeight() const;
virtual void setScrollLeft(int);
virtual void setScrollTop(int);
- virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f);
+ virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1.0f, Node** stopNode = 0);
int textBlockWidth() const;
virtual int preferredContentWidth(float charWidth) const;
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp
index b5826cd2db..5ee01e445a 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTheme.cpp
@@ -85,6 +85,7 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
#if USE(NEW_THEME)
switch (part) {
+ case ListButtonPart:
case CheckboxPart:
case RadioPart:
case PushButtonPart:
@@ -171,6 +172,7 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
return adjustRadioStyle(selector, style, e);
case PushButtonPart:
case SquareButtonPart:
+ case ListButtonPart:
case DefaultButtonPart:
case ButtonPart:
return adjustButtonStyle(selector, style, e);
@@ -227,6 +229,7 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
case RadioPart:
case PushButtonPart:
case SquareButtonPart:
+ case ListButtonPart:
case DefaultButtonPart:
case ButtonPart:
m_theme->paint(part, controlStatesForRenderer(o), const_cast<GraphicsContext*>(paintInfo.context), r, o->style()->effectiveZoom(), o->view()->frameView());
@@ -245,6 +248,7 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
return paintRadio(o, paintInfo, r);
case PushButtonPart:
case SquareButtonPart:
+ case ListButtonPart:
case DefaultButtonPart:
case ButtonPart:
return paintButton(o, paintInfo, r);
@@ -335,6 +339,7 @@ bool RenderTheme::paintBorderOnly(RenderObject* o, const RenderObject::PaintInfo
case RadioPart:
case PushButtonPart:
case SquareButtonPart:
+ case ListButtonPart:
case DefaultButtonPart:
case ButtonPart:
case MenulistPart:
@@ -369,6 +374,7 @@ bool RenderTheme::paintDecorations(RenderObject* o, const RenderObject::PaintInf
case RadioPart:
case PushButtonPart:
case SquareButtonPart:
+ case ListButtonPart:
case DefaultButtonPart:
case ButtonPart:
case MenulistPart:
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.h b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.h
index 9f412a0f79..61b5e8f39c 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.h
@@ -121,6 +121,7 @@ protected:
virtual bool paintSearchFieldResultsButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
#if ENABLE(VIDEO)
+ virtual bool shouldRenderMediaControlPart(ControlPart, Element*);
virtual bool paintMediaPlayButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaMuteButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
virtual bool paintMediaSliderTrack(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.mm b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.mm
index 695f9fa442..bcfcd577c6 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.mm
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumMac.mm
@@ -29,7 +29,6 @@
#import "Document.h"
#import "Element.h"
#import "FrameView.h"
-#import "Gradient.h"
#import "GraphicsContext.h"
#import "HTMLInputElement.h"
#import "HTMLMediaElement.h"
@@ -38,6 +37,7 @@
#import "LocalCurrentGraphicsContext.h"
#import "MediaControlElements.h"
#import "RenderMedia.h"
+#import "RenderMediaControlsChromium.h"
#import "RenderSlider.h"
#import "RenderView.h"
#import "SharedBuffer.h"
@@ -1251,20 +1251,6 @@ bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const RenderObjec
return false;
}
-#if ENABLE(VIDEO)
-static Image* mediaSliderThumbImage()
-{
- static Image* mediaSliderThumb = Image::loadPlatformResource("mediaSliderThumb").releaseRef();
- return mediaSliderThumb;
-}
-
-static Image* mediaVolumeSliderThumbImage()
-{
- static Image* mediaVolumeSliderThumb = Image::loadPlatformResource("mediaVolumeSliderThumb").releaseRef();
- return mediaVolumeSliderThumb;
-}
-#endif
-
void RenderThemeChromiumMac::adjustSliderThumbSize(RenderObject* o) const
{
static const int sliderThumbWidth = 15;
@@ -1277,16 +1263,7 @@ void RenderThemeChromiumMac::adjustSliderThumbSize(RenderObject* o) const
}
#if ENABLE(VIDEO)
- Image* thumbImage = 0;
- if (o->style()->appearance() == MediaSliderThumbPart)
- thumbImage = mediaSliderThumbImage();
- else if (o->style()->appearance() == MediaVolumeSliderThumbPart)
- thumbImage = mediaVolumeSliderThumbImage();
-
- if (thumbImage) {
- o->style()->setWidth(Length(thumbImage->width(), Fixed));
- o->style()->setHeight(Length(thumbImage->height(), Fixed));
- }
+ RenderMediaControlsChromium::adjustMediaSliderThumbSize(o);
#endif
}
@@ -1537,173 +1514,44 @@ bool RenderThemeChromiumMac::paintSearchFieldResultsButton(RenderObject* o, cons
}
#if ENABLE(VIDEO)
-// Attempt to retrieve a HTMLMediaElement from a Node. Returns 0 if one cannot be found.
-static HTMLMediaElement* mediaElementParent(Node* node)
-{
- if (!node)
- return 0;
- Node* mediaNode = node->shadowAncestorNode();
- if (!mediaNode || (!mediaNode->hasTagName(HTMLNames::videoTag) && !mediaNode->hasTagName(HTMLNames::audioTag)))
- return 0;
-
- return static_cast<HTMLMediaElement*>(mediaNode);
-}
-
-bool RenderThemeChromiumMac::paintMediaButtonInternal(GraphicsContext* context, const IntRect& rect, Image* image)
+bool RenderThemeChromiumMac::shouldRenderMediaControlPart(ControlPart part, Element* e)
{
- // Create a destination rectangle for the image that is centered in the drawing rectangle, rounded left, and down.
- IntRect imageRect = image->rect();
- imageRect.setY(rect.y() + (rect.height() - image->height() + 1) / 2);
- imageRect.setX(rect.x() + (rect.width() - image->width() + 1) / 2);
-
- context->drawImage(image, imageRect);
- return true;
+ return RenderMediaControlsChromium::shouldRenderMediaControlPart(part, e);
}
bool RenderThemeChromiumMac::paintMediaPlayButton(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- static Image* mediaPlay = Image::loadPlatformResource("mediaPlay").releaseRef();
- static Image* mediaPause = Image::loadPlatformResource("mediaPause").releaseRef();
- static Image* mediaPlayDisabled = Image::loadPlatformResource("mediaPlayDisabled").releaseRef();
-
- if (mediaElement->networkState() == HTMLMediaElement::NETWORK_NO_SOURCE)
- return paintMediaButtonInternal(paintInfo.context, rect, mediaPlayDisabled);
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaElement->paused() ? mediaPlay : mediaPause);
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaPlayButton, object, paintInfo, rect);
}
bool RenderThemeChromiumMac::paintMediaMuteButton(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- static Image* soundFull = Image::loadPlatformResource("mediaSoundFull").releaseRef();
- static Image* soundNone = Image::loadPlatformResource("mediaSoundNone").releaseRef();
- static Image* soundDisabled = Image::loadPlatformResource("mediaSoundDisabled").releaseRef();
-
- if (mediaElement->networkState() == HTMLMediaElement::NETWORK_NO_SOURCE || !mediaElement->hasAudio())
- return paintMediaButtonInternal(paintInfo.context, rect, soundDisabled);
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaElement->muted() ? soundNone : soundFull);
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaMuteButton, object, paintInfo, rect);
}
bool RenderThemeChromiumMac::paintMediaSliderTrack(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- RenderStyle* style = object->style();
- GraphicsContext* context = paintInfo.context;
- context->save();
-
- context->setShouldAntialias(true);
-
- IntSize topLeftRadius = style->borderTopLeftRadius();
- IntSize topRightRadius = style->borderTopRightRadius();
- IntSize bottomLeftRadius = style->borderBottomLeftRadius();
- IntSize bottomRightRadius = style->borderBottomRightRadius();
- float borderWidth = style->borderLeftWidth();
-
- // Draw the border of the time bar.
- context->setStrokeColor(style->borderLeftColor());
- context->setStrokeThickness(borderWidth);
- context->setFillColor(style->backgroundColor());
- context->addPath(Path::createRoundedRectangle(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius));
- context->drawPath();
-
- // Draw the buffered ranges.
- // FIXME: Draw multiple ranges if there are multiple buffered ranges.
- FloatRect bufferedRect = rect;
- bufferedRect.inflate(-1.0 - borderWidth);
- bufferedRect.setWidth(bufferedRect.width() * mediaElement->percentLoaded());
- bufferedRect = context->roundToDevicePixels(bufferedRect);
-
- // Don't bother drawing an empty area.
- if (bufferedRect.width() > 0 && bufferedRect.height() > 0) {
- FloatPoint sliderTopLeft = bufferedRect.location();
- FloatPoint sliderTopRight = sliderTopLeft;
- sliderTopRight.move(0.0f, bufferedRect.height());
-
- RefPtr<Gradient> gradient = Gradient::create(sliderTopLeft, sliderTopRight);
- Color startColor = object->style()->color();
- gradient->addColorStop(0.0, startColor);
- gradient->addColorStop(1.0, Color(startColor.red() / 2, startColor.green() / 2, startColor.blue() / 2, startColor.alpha()));
-
- context->setFillGradient(gradient);
- context->addPath(Path::createRoundedRectangle(bufferedRect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius));
- context->fillPath();
- }
-
- context->restore();
- return true;
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaSlider, object, paintInfo, rect);
}
bool RenderThemeChromiumMac::paintMediaVolumeSliderTrack(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- GraphicsContext* context = paintInfo.context;
- Color originalColor = context->strokeColor();
- if (originalColor != Color::white)
- context->setStrokeColor(Color::white);
-
- int x = rect.x() + rect.width() / 2;
- context->drawLine(IntPoint(x, rect.y()), IntPoint(x, rect.y() + rect.height()));
-
- if (originalColor != Color::white)
- context->setStrokeColor(originalColor);
- return true;
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSlider, object, paintInfo, rect);
}
bool RenderThemeChromiumMac::paintMediaSliderThumb(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- if (!object->parent()->isSlider())
- return false;
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaSliderThumbImage());
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaSliderThumb, object, paintInfo, rect);
}
bool RenderThemeChromiumMac::paintMediaVolumeSliderThumb(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- if (!object->parent()->isSlider())
- return false;
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaVolumeSliderThumbImage());
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSliderThumb, object, paintInfo, rect);
}
bool RenderThemeChromiumMac::paintMediaControlsBackground(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- if (!rect.isEmpty())
- {
- GraphicsContext* context = paintInfo.context;
- Color originalColor = context->strokeColor();
-
- // Draws the left border, it is always 1px wide.
- context->setStrokeColor(object->style()->borderLeftColor());
- context->drawLine(IntPoint(rect.x() + 1, rect.y()),
- IntPoint(rect.x() + 1, rect.y() + rect.height()));
-
-
- // Draws the right border, it is always 1px wide.
- context->setStrokeColor(object->style()->borderRightColor());
- context->drawLine(IntPoint(rect.x() + rect.width() - 1, rect.y()),
- IntPoint(rect.x() + rect.width() - 1, rect.y() + rect.height()));
-
- context->setStrokeColor(originalColor);
- }
- return true;
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaTimelineContainer, object, paintInfo, rect);
}
String RenderThemeChromiumMac::extraMediaControlsStyleSheet()
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp
index 4f486d5363..fb42bb7af5 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumSkia.cpp
@@ -33,6 +33,7 @@
#include "MediaControlElements.h"
#include "PlatformContextSkia.h"
#include "RenderBox.h"
+#include "RenderMediaControlsChromium.h"
#include "RenderObject.h"
#include "RenderSlider.h"
#include "ScrollbarTheme.h"
@@ -96,20 +97,6 @@ static void drawBox(SkCanvas* canvas, const IntRect& rect, const SkPaint& paint)
drawVertLine(canvas, rect.x(), rect.y(), bottom, paint);
}
-#if ENABLE(VIDEO)
-// Attempt to retrieve a HTMLMediaElement from a Node. Returns NULL if one cannot be found.
-static HTMLMediaElement* mediaElementParent(Node* node)
-{
- if (!node)
- return 0;
- Node* mediaNode = node->shadowAncestorNode();
- if (!mediaNode || (!mediaNode->hasTagName(HTMLNames::videoTag) && !mediaNode->hasTagName(HTMLNames::audioTag)))
- return 0;
-
- return static_cast<HTMLMediaElement*>(mediaNode);
-}
-#endif
-
// We aim to match IE here.
// -IE uses a font based on the encoding as the default font for form controls.
// -Gecko uses MS Shell Dlg (actually calls GetStockObject(DEFAULT_GUI_FONT),
@@ -486,42 +473,10 @@ bool RenderThemeChromiumSkia::paintSearchFieldResultsButton(RenderObject* o, con
return false;
}
-bool RenderThemeChromiumSkia::paintMediaButtonInternal(GraphicsContext* context, const IntRect& rect, Image* image)
-{
- // Create a destination rectangle for the image that is centered in the drawing rectangle, rounded left, and down.
- IntRect imageRect = image->rect();
- imageRect.setY(rect.y() + (rect.height() - image->height() + 1) / 2);
- imageRect.setX(rect.x() + (rect.width() - image->width() + 1) / 2);
-
- context->drawImage(image, imageRect);
- return true;
-}
-
bool RenderThemeChromiumSkia::paintMediaControlsBackground(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- if (!rect.isEmpty())
- {
- SkCanvas* canvas = paintInfo.context->platformContext()->canvas();
- SkPaint paint;
-
- // Draws the left border, it is always 1px wide.
- paint.setColor(object->style()->borderLeftColor().rgb());
- canvas->drawLine(rect.x() + 1, rect.y(),
- rect.x() + 1, rect.y() + rect.height(),
- paint);
-
- // Draws the right border, it is always 1px wide.
- paint.setColor(object->style()->borderRightColor().rgb());
- canvas->drawLine(rect.x() + rect.width() - 1, rect.y(),
- rect.x() + rect.width() - 1, rect.y() + rect.height(),
- paint);
- }
- return true;
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaTimelineContainer, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -533,62 +488,7 @@ bool RenderThemeChromiumSkia::paintMediaControlsBackground(RenderObject* object,
bool RenderThemeChromiumSkia::paintMediaSliderTrack(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- SkCanvas* canvas = paintInfo.context->platformContext()->canvas();
- SkRect backgroundRect;
- backgroundRect.set(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height());
-
- SkPaint paint;
- paint.setAntiAlias(true);
-
- // Draw the border of the time bar. The border only has one single color,
- // width and radius. So use the property of the left border.
- SkColor borderColor = object->style()->borderLeftColor().rgb();
- int borderWidth = object->style()->borderLeftWidth();
- IntSize borderRadius = object->style()->borderTopLeftRadius();
- paint.setStyle(SkPaint::kStroke_Style);
- paint.setStrokeWidth(borderWidth);
- paint.setColor(borderColor);
- canvas->drawRoundRect(backgroundRect, borderRadius.width(), borderRadius.height(), paint);
-
- // Draw the background of the time bar.
- SkColor backgroundColor = object->style()->backgroundColor().rgb();
- paint.setStyle(SkPaint::kFill_Style);
- paint.setColor(backgroundColor);
- canvas->drawRoundRect(backgroundRect, borderRadius.width(), borderRadius.height(), paint);
-
- if (backgroundRect.width() >= 3 && backgroundRect.height() >= 3)
- {
- // Draw the buffered ranges.
- // FIXME: Draw multiple ranges if there are multiple buffered ranges.
- SkRect bufferedRect;
- bufferedRect.set(backgroundRect.fLeft + 2, backgroundRect.fTop + 2,
- backgroundRect.fRight - 1, backgroundRect.fBottom - 1);
- int width = static_cast<int>(bufferedRect.width() * mediaElement->percentLoaded());
- bufferedRect.fRight = bufferedRect.fLeft + width;
-
- SkPoint points[2] = { { 0, bufferedRect.fTop }, { 0, bufferedRect.fBottom } };
- SkColor startColor = object->style()->color().rgb();
- SkColor endColor = SkColorSetRGB(SkColorGetR(startColor) / 2,
- SkColorGetG(startColor) / 2,
- SkColorGetB(startColor) / 2);
- SkColor colors[2] = { startColor, endColor };
- SkShader* gradient = SkGradientShader::CreateLinear(points, colors, 0,
- sizeof(points) / sizeof(points[0]),
- SkShader::kMirror_TileMode, 0);
-
- paint.reset();
- paint.setShader(gradient);
- paint.setAntiAlias(true);
- // Check for round rect with zero width or height, otherwise Skia will assert
- if (bufferedRect.width() > 0 && bufferedRect.height() > 0)
- canvas->drawRoundRect(bufferedRect, borderRadius.width(), borderRadius.height(), paint);
- gradient->unref();
- }
- return true;
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaSlider, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -600,17 +500,7 @@ bool RenderThemeChromiumSkia::paintMediaSliderTrack(RenderObject* object, const
bool RenderThemeChromiumSkia::paintMediaVolumeSliderTrack(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- SkCanvas* canvas = paintInfo.context->platformContext()->canvas();
- SkPaint paint;
- paint.setColor(SK_ColorWHITE);
-
- int x = rect.x() + rect.width() / 2;
- canvas->drawLine(x, rect.y(), x, rect.y() + rect.height(), paint);
- return true;
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSlider, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -619,31 +509,10 @@ bool RenderThemeChromiumSkia::paintMediaVolumeSliderTrack(RenderObject* object,
#endif
}
-static Image* mediaSliderThumbImage()
-{
- static Image* mediaSliderThumb = Image::loadPlatformResource("mediaSliderThumb").releaseRef();
- return mediaSliderThumb;
-}
-
-static Image* mediaVolumeSliderThumbImage()
-{
- static Image* mediaVolumeSliderThumb = Image::loadPlatformResource("mediaVolumeSliderThumb").releaseRef();
- return mediaVolumeSliderThumb;
-}
-
void RenderThemeChromiumSkia::adjustSliderThumbSize(RenderObject* object) const
{
#if ENABLE(VIDEO)
- Image* thumbImage = 0;
- if (object->style()->appearance() == MediaSliderThumbPart)
- thumbImage = mediaSliderThumbImage();
- else if (object->style()->appearance() == MediaVolumeSliderThumbPart)
- thumbImage = mediaVolumeSliderThumbImage();
-
- if (thumbImage) {
- object->style()->setWidth(Length(thumbImage->width(), Fixed));
- object->style()->setHeight(Length(thumbImage->height(), Fixed));
- }
+ RenderMediaControlsChromium::adjustMediaSliderThumbSize(object);
#else
UNUSED_PARAM(object);
#endif
@@ -652,10 +521,7 @@ void RenderThemeChromiumSkia::adjustSliderThumbSize(RenderObject* object) const
bool RenderThemeChromiumSkia::paintMediaSliderThumb(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- if (!object->parent()->isSlider())
- return false;
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaSliderThumbImage());
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaSliderThumb, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -667,10 +533,7 @@ bool RenderThemeChromiumSkia::paintMediaSliderThumb(RenderObject* object, const
bool RenderThemeChromiumSkia::paintMediaVolumeSliderThumb(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- if (!object->parent()->isSlider())
- return false;
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaVolumeSliderThumbImage());
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSliderThumb, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -682,18 +545,7 @@ bool RenderThemeChromiumSkia::paintMediaVolumeSliderThumb(RenderObject* object,
bool RenderThemeChromiumSkia::paintMediaPlayButton(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- static Image* mediaPlay = Image::loadPlatformResource("mediaPlay").releaseRef();
- static Image* mediaPause = Image::loadPlatformResource("mediaPause").releaseRef();
- static Image* mediaPlayDisabled = Image::loadPlatformResource("mediaPlayDisabled").releaseRef();
-
- if (mediaElement->networkState() == HTMLMediaElement::NETWORK_NO_SOURCE)
- return paintMediaButtonInternal(paintInfo.context, rect, mediaPlayDisabled);
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaElement->paused() ? mediaPlay : mediaPause);
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaPlayButton, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -705,18 +557,7 @@ bool RenderThemeChromiumSkia::paintMediaPlayButton(RenderObject* object, const R
bool RenderThemeChromiumSkia::paintMediaMuteButton(RenderObject* object, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(VIDEO)
- HTMLMediaElement* mediaElement = mediaElementParent(object->node());
- if (!mediaElement)
- return false;
-
- static Image* soundFull = Image::loadPlatformResource("mediaSoundFull").releaseRef();
- static Image* soundNone = Image::loadPlatformResource("mediaSoundNone").releaseRef();
- static Image* soundDisabled = Image::loadPlatformResource("mediaSoundDisabled").releaseRef();
-
- if (mediaElement->networkState() == HTMLMediaElement::NETWORK_NO_SOURCE || !mediaElement->hasAudio())
- return paintMediaButtonInternal(paintInfo.context, rect, soundDisabled);
-
- return paintMediaButtonInternal(paintInfo.context, rect, mediaElement->muted() ? soundNone: soundFull);
+ return RenderMediaControlsChromium::paintMediaControlsPart(MediaMuteButton, object, paintInfo, rect);
#else
UNUSED_PARAM(object);
UNUSED_PARAM(paintInfo);
@@ -744,8 +585,9 @@ bool RenderThemeChromiumSkia::paintMenuList(RenderObject* o, const RenderObject:
paint.setAntiAlias(true);
paint.setStyle(SkPaint::kFill_Style);
+ int arrowXPosition = (o->style()->direction() == RTL) ? rect.x() + 7 : right - 13;
SkPath path;
- path.moveTo(right - 13, middle - 3);
+ path.moveTo(arrowXPosition, middle - 3);
path.rLineTo(6, 0);
path.rLineTo(-3, 6);
path.close();
@@ -871,13 +713,7 @@ int RenderThemeChromiumSkia::buttonInternalPaddingBottom() const
#if ENABLE(VIDEO)
bool RenderThemeChromiumSkia::shouldRenderMediaControlPart(ControlPart part, Element* e)
{
- HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(e);
- switch (part) {
- case MediaMuteButtonPart:
- return true;
- default:
- return RenderTheme::shouldRenderMediaControlPart(part, e);
- }
+ return RenderMediaControlsChromium::shouldRenderMediaControlPart(part, e);
}
#endif
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp
index 20503f33cb..4b38d53e74 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeChromiumWin.cpp
@@ -611,21 +611,11 @@ bool RenderThemeChromiumWin::paintTextFieldInternal(RenderObject* o,
const IntRect& r,
bool drawEdges)
{
- // Nasty hack to make us not paint the border on text fields with a
- // border-radius. Webkit paints elements with border-radius for us.
- // FIXME: Get rid of this if-check once we can properly clip rounded
- // borders: http://b/1112604 and http://b/1108635
- // FIXME: make sure we do the right thing if css background-clip is set.
- if (o->style()->hasBorderRadius())
- return false;
-
- const ThemeData& themeData = getThemeData(o);
-
// Fallback to white if the specified color object is invalid.
+ // (Note ChromiumBridge::paintTextField duplicates this check).
Color backgroundColor(Color::white);
- if (o->style()->backgroundColor().isValid()) {
+ if (o->style()->backgroundColor().isValid())
backgroundColor = o->style()->backgroundColor();
- }
// If we have background-image, don't fill the content area to expose the
// parent's background. Also, we shouldn't fill the content area if the
@@ -634,17 +624,32 @@ bool RenderThemeChromiumWin::paintTextFieldInternal(RenderObject* o,
// Note that we should paint the content area white if we have neither the
// background color nor background image explicitly specified to keep the
// appearance of select element consistent with other browsers.
- bool fillContentArea = !o->style()->hasBackgroundImage() && backgroundColor.alpha() != 0;
-
- WebCore::ThemePainter painter(i.context, r);
- ChromiumBridge::paintTextField(painter.context(),
- themeData.m_part,
- themeData.m_state,
- themeData.m_classicState,
- painter.drawRect(),
- backgroundColor,
- fillContentArea,
- drawEdges);
+ bool fillContentArea = !o->style()->hasBackgroundImage() && backgroundColor.alpha();
+
+ if (o->style()->hasBorderRadius()) {
+ // If the style has rounded borders, setup the context to clip the
+ // background (themed or filled) appropriately.
+ // FIXME: make sure we do the right thing if css background-clip is set.
+ i.context->save();
+ IntSize topLeft, topRight, bottomLeft, bottomRight;
+ o->style()->getBorderRadiiForRect(r, topLeft, topRight, bottomLeft, bottomRight);
+ i.context->addRoundedRectClip(r, topLeft, topRight, bottomLeft, bottomRight);
+ }
+ {
+ const ThemeData& themeData = getThemeData(o);
+ WebCore::ThemePainter painter(i.context, r);
+ ChromiumBridge::paintTextField(painter.context(),
+ themeData.m_part,
+ themeData.m_state,
+ themeData.m_classicState,
+ painter.drawRect(),
+ backgroundColor,
+ fillContentArea,
+ drawEdges);
+ // End of block commits the painter before restoring context.
+ }
+ if (o->style()->hasBorderRadius())
+ i.context->restore();
return false;
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeMac.h b/src/3rdparty/webkit/WebCore/rendering/RenderThemeMac.h
index 85f141f609..1d68c630c9 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeMac.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeMac.h
@@ -132,6 +132,8 @@ protected:
// Media controls
virtual String extraMediaControlsStyleSheet();
+
+ virtual bool shouldRenderMediaControlPart(ControlPart, Element*);
#endif
private:
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderThemeSafari.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderThemeSafari.cpp
index 8e53088914..2ea3b8beaf 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderThemeSafari.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderThemeSafari.cpp
@@ -86,7 +86,7 @@ PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page* page)
return safariTheme; // keep the reference of one.
}
-#if !defined(NDEBUG) && defined(USE_DEBUG_SAFARI_THEME)
+#ifdef DEBUG_ALL
SOFT_LINK_DEBUG_LIBRARY(SafariTheme)
#else
SOFT_LINK_LIBRARY(SafariTheme)
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
index 5c6e738d2b..b7ab191d7d 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.cpp
@@ -28,6 +28,7 @@
#include "CSSMutableStyleDeclaration.h"
#include "CharacterNames.h"
+#include "CString.h"
#include "Document.h"
#include "Frame.h"
#include "FrameView.h"
@@ -553,4 +554,31 @@ String externalRepresentation(RenderObject* o)
return ts.release();
}
+static void writeCounterValuesFromChildren(TextStream& stream, RenderObject* parent)
+{
+ for (RenderObject* child = parent->firstChild(); child; child = child->nextSibling()) {
+ if (child->isCounter()) {
+ String str(toRenderText(child)->text());
+ stream << str;
+ }
+ }
+}
+
+String counterValueForElement(Element* element)
+{
+ // Make sure the element is not freed during the layout.
+ RefPtr<Element> elementRef(element);
+ element->document()->updateLayout();
+ TextStream stream;
+ // The counter renderers should be children of anonymous children
+ // (i.e., :before or :after pseudo-elements).
+ if (RenderObject* renderer = element->renderer()) {
+ for (RenderObject* child = renderer->firstChild(); child; child = child->nextSibling()) {
+ if (child->isAnonymous())
+ writeCounterValuesFromChildren(stream, child);
+ }
+ }
+ return stream.release();
+}
+
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.h b/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.h
index daca25379f..325f109478 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderTreeAsText.h
@@ -28,15 +28,18 @@
namespace WebCore {
- class RenderObject;
- class String;
- class TextStream;
+class Element;
+class RenderObject;
+class String;
+class TextStream;
- String externalRepresentation(RenderObject*);
- void write(TextStream&, const RenderObject&, int indent = 0);
+String externalRepresentation(RenderObject*);
+void write(TextStream&, const RenderObject&, int indent = 0);
- // Helper function shared with SVGRenderTreeAsText
- String quoteAndEscapeNonPrintables(const String&);
+// Helper function shared with SVGRenderTreeAsText
+String quoteAndEscapeNonPrintables(const String&);
+
+String counterValueForElement(Element*);
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp
index ef78b07ee1..9af7137faf 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp
@@ -175,6 +175,12 @@ void RenderWidget::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
}
}
+void RenderWidget::showSubstituteImage(PassRefPtr<Image> prpImage)
+{
+ m_substituteImage = prpImage;
+ repaint();
+}
+
void RenderWidget::paint(PaintInfo& paintInfo, int tx, int ty)
{
if (!shouldPaint(paintInfo, tx, ty))
@@ -222,7 +228,10 @@ void RenderWidget::paint(PaintInfo& paintInfo, int tx, int ty)
// Tell the widget to paint now. This is the only time the widget is allowed
// to paint itself. That way it will composite properly with z-indexed layers.
- m_widget->paint(paintInfo.context, paintInfo.rect);
+ if (m_substituteImage)
+ paintInfo.context->drawImage(m_substituteImage.get(), m_widget->frameRect());
+ else
+ m_widget->paint(paintInfo.context, paintInfo.rect);
if (m_widget->isFrameView() && paintInfo.overlapTestRequests && !static_cast<FrameView*>(m_widget.get())->useSlowRepaints()) {
ASSERT(!paintInfo.overlapTestRequests->contains(this));
diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderWidget.h b/src/3rdparty/webkit/WebCore/rendering/RenderWidget.h
index 098f69edef..78537fdfa5 100644
--- a/src/3rdparty/webkit/WebCore/rendering/RenderWidget.h
+++ b/src/3rdparty/webkit/WebCore/rendering/RenderWidget.h
@@ -40,6 +40,8 @@ public:
void updateWidgetPosition();
+ void showSubstituteImage(PassRefPtr<Image>);
+
protected:
RenderWidget(Node*);
@@ -66,6 +68,7 @@ private:
void deref(RenderArena*);
RefPtr<Widget> m_widget;
+ RefPtr<Image> m_substituteImage;
FrameView* m_frameView;
int m_refCount;
};
diff --git a/src/3rdparty/webkit/WebCore/rendering/SVGRenderSupport.cpp b/src/3rdparty/webkit/WebCore/rendering/SVGRenderSupport.cpp
index fb6866fba8..ea087f9031 100644
--- a/src/3rdparty/webkit/WebCore/rendering/SVGRenderSupport.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/SVGRenderSupport.cpp
@@ -94,6 +94,9 @@ void SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject
paintInfo.context->beginTransparencyLayer(opacity);
}
+ if (ShadowData* shadow = svgStyle->shadow())
+ paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color);
+
#if ENABLE(FILTERS)
AtomicString filterId(svgStyle->filter());
#endif
@@ -220,7 +223,7 @@ FloatRect SVGRenderBase::filterBoundingBoxForRenderer(const RenderObject* object
#if ENABLE(FILTERS)
SVGResourceFilter* filter = getFilterById(object->document(), object->style()->svgStyle()->filter());
if (filter)
- return filter->filterBBoxForItemBBox(object->objectBoundingBox());
+ return filter->filterBoundingBox();
#else
UNUSED_PARAM(object);
#endif
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/RenderStyle.h b/src/3rdparty/webkit/WebCore/rendering/style/RenderStyle.h
index be5d1cf4a3..2e8fb0acda 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/RenderStyle.h
+++ b/src/3rdparty/webkit/WebCore/rendering/style/RenderStyle.h
@@ -462,7 +462,7 @@ public:
return font().lineSpacing();
if (lh.isPercent())
- return lh.calcMinValue(fontSize());
+ return lh.calcMinValue(fontSize(), true);
return lh.value();
}
@@ -1182,6 +1182,7 @@ public:
static float initialPerspective() { return 0; }
static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
+ static Color initialBackgroundColor() { return Color::transparent; }
// Keep these at the end.
static int initialLineClamp() { return -1; }
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/RenderStyleConstants.h b/src/3rdparty/webkit/WebCore/rendering/style/RenderStyleConstants.h
index a47defb1f4..3010947ad7 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/RenderStyleConstants.h
+++ b/src/3rdparty/webkit/WebCore/rendering/style/RenderStyleConstants.h
@@ -72,6 +72,7 @@ enum PseudoId {
MEDIA_CONTROLS_VOLUME_SLIDER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY, MEDIA_CONTROLS_SEEK_BACK_BUTTON,
MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON, MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON,
MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
+ INPUT_LIST_BUTTON,
FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON
};
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.cpp b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.cpp
index 1289b06b79..e8827c4733 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -51,6 +51,7 @@ SVGRenderStyle::SVGRenderStyle()
mask = defaultStyle->mask;
misc = defaultStyle->misc;
markers = defaultStyle->markers;
+ shadowSVG = defaultStyle->shadowSVG;
setBitDefaults();
}
@@ -67,6 +68,7 @@ SVGRenderStyle::SVGRenderStyle(CreateDefaultType)
mask.init();
misc.init();
markers.init();
+ shadowSVG.init();
}
SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
@@ -80,6 +82,7 @@ SVGRenderStyle::SVGRenderStyle(const SVGRenderStyle& other)
mask = other.mask;
misc = other.misc;
markers = other.markers;
+ shadowSVG = other.shadowSVG;
svg_inherited_flags = other.svg_inherited_flags;
svg_noninherited_flags = other.svg_noninherited_flags;
@@ -93,7 +96,7 @@ bool SVGRenderStyle::operator==(const SVGRenderStyle& o) const
{
return (fill == o.fill && stroke == o.stroke && text == o.text &&
stops == o.stops && clip == o.clip && mask == o.mask &&
- misc == o.misc && markers == o.markers &&
+ misc == o.misc && markers == o.markers && shadowSVG == o.shadowSVG &&
svg_inherited_flags == o.svg_inherited_flags &&
svg_noninherited_flags == o.svg_noninherited_flags);
}
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.h b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.h
index 0e9dae463a..12477d771e 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.h
+++ b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyle.h
@@ -30,6 +30,7 @@
#include "GraphicsTypes.h"
#include "SVGPaint.h"
#include "SVGRenderStyleDefs.h"
+#include "ShadowData.h"
#include <wtf/Platform.h>
@@ -65,7 +66,6 @@ namespace WebCore {
SVG_RS_DEFINE_ATTRIBUTE_INHERITED(LineJoin, JoinStyle, joinStyle, MiterJoin)
SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EShapeRendering, ShapeRendering, shapeRendering, SR_AUTO)
SVG_RS_DEFINE_ATTRIBUTE_INHERITED(ETextAnchor, TextAnchor, textAnchor, TA_START)
- SVG_RS_DEFINE_ATTRIBUTE_INHERITED(ETextRendering, TextRendering, textRendering, TR_AUTO)
SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EWritingMode, WritingMode, writingMode, WM_LRTB)
SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EGlyphOrientation, GlyphOrientationHorizontal, glyphOrientationHorizontal, GO_0DEG)
SVG_RS_DEFINE_ATTRIBUTE_INHERITED(EGlyphOrientation, GlyphOrientationVertical, glyphOrientationVertical, GO_AUTO)
@@ -99,6 +99,8 @@ namespace WebCore {
SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL(Color, misc, lightingColor, LightingColor, lightingColor, Color(255, 255, 255))
SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_REFCOUNTED(CSSValue, misc, baselineShiftValue, BaselineShiftValue, baselineShiftValue, 0)
+ SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(ShadowData, shadowSVG, shadow, Shadow, shadow, 0)
+
// convenience
bool hasStroke() const { return (strokePaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE); }
bool hasFill() const { return (fillPaint()->paintType() != SVGPaint::SVG_PAINTTYPE_NONE); }
@@ -113,7 +115,6 @@ namespace WebCore {
return (_colorRendering == other._colorRendering) &&
(_imageRendering == other._imageRendering) &&
(_shapeRendering == other._shapeRendering) &&
- (_textRendering == other._textRendering) &&
(_clipRule == other._clipRule) &&
(_fillRule == other._fillRule) &&
(_capStyle == other._capStyle) &&
@@ -134,7 +135,6 @@ namespace WebCore {
unsigned _colorRendering : 2; // EColorRendering
unsigned _imageRendering : 2; // EImageRendering
unsigned _shapeRendering : 2; // EShapeRendering
- unsigned _textRendering : 2; // ETextRendering
unsigned _clipRule : 1; // WindRule
unsigned _fillRule : 1; // WindRule
unsigned _capStyle : 2; // LineCap
@@ -175,6 +175,7 @@ namespace WebCore {
DataRef<StyleClipData> clip;
DataRef<StyleMaskData> mask;
DataRef<StyleMiscData> misc;
+ DataRef<StyleShadowSVGData> shadowSVG;
private:
enum CreateDefaultType { CreateDefault };
@@ -190,7 +191,6 @@ namespace WebCore {
svg_inherited_flags._fillRule = initialFillRule();
svg_inherited_flags._imageRendering = initialImageRendering();
svg_inherited_flags._shapeRendering = initialShapeRendering();
- svg_inherited_flags._textRendering = initialTextRendering();
svg_inherited_flags._textAnchor = initialTextAnchor();
svg_inherited_flags._capStyle = initialCapStyle();
svg_inherited_flags._joinStyle = initialJoinStyle();
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.cpp b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.cpp
index f5faad3e8d..2ed1d8fcc1 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.cpp
@@ -213,6 +213,25 @@ bool StyleMiscData::operator==(const StyleMiscData &other) const
&& baselineShiftValue == other.baselineShiftValue;
}
+StyleShadowSVGData::StyleShadowSVGData()
+{
+}
+
+StyleShadowSVGData::StyleShadowSVGData(const StyleShadowSVGData& other)
+ : RefCounted<StyleShadowSVGData>()
+ , shadow(other.shadow ? new ShadowData(*other.shadow) : 0)
+{
+}
+
+bool StyleShadowSVGData::operator==(const StyleShadowSVGData& other) const
+{
+ if ((!shadow && other.shadow) || (shadow && !other.shadow))
+ return false;
+ if (shadow && other.shadow && (*shadow != *other.shadow))
+ return false;
+ return true;
+}
+
#endif // ENABLE(SVG)
// vim:ts=4:noet
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.h b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.h
index b7bf0261d8..f4cf9327a3 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.h
+++ b/src/3rdparty/webkit/WebCore/rendering/style/SVGRenderStyleDefs.h
@@ -33,6 +33,9 @@
#include "Color.h"
#include "Path.h"
#include "PlatformString.h"
+#include "ShadowData.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -65,6 +68,13 @@
} \
static Data* initial##Type() { return Initial; }
+#define SVG_RS_DEFINE_ATTRIBUTE_DATAREF_WITH_INITIAL_OWNPTR(Data, Group, Variable, Type, Name, Initial) \
+ Data* Name() const { return Group->Variable.get(); } \
+ void set##Type(Data* obj) { \
+ Group.access()->Variable.set(obj); \
+ } \
+ static Data* initial##Type() { return Initial; }
+
#define SVG_RS_SET_VARIABLE(Group, Variable, Value) \
if (!(Group->Variable == Value)) \
Group.access()->Variable = Value;
@@ -95,10 +105,6 @@ namespace WebCore {
SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION
};
- enum ETextRendering {
- TR_AUTO, TR_OPTIMIZESPEED, TR_OPTIMIZELEGIBILITY, TR_GEOMETRICPRECISION
- };
-
enum EWritingMode {
WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB
};
@@ -283,6 +289,24 @@ namespace WebCore {
StyleMiscData();
StyleMiscData(const StyleMiscData&);
};
+
+ class StyleShadowSVGData : public RefCounted<StyleShadowSVGData> {
+ public:
+ static PassRefPtr<StyleShadowSVGData> create() { return adoptRef(new StyleShadowSVGData); }
+ PassRefPtr<StyleShadowSVGData> copy() const { return adoptRef(new StyleShadowSVGData(*this)); }
+
+ bool operator==(const StyleShadowSVGData& other) const;
+ bool operator!=(const StyleShadowSVGData& other) const
+ {
+ return !(*this == other);
+ }
+
+ OwnPtr<ShadowData> shadow;
+
+ private:
+ StyleShadowSVGData();
+ StyleShadowSVGData(const StyleShadowSVGData& other);
+ };
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/rendering/style/StyleBackgroundData.cpp b/src/3rdparty/webkit/WebCore/rendering/style/StyleBackgroundData.cpp
index 68a9dddbcd..08f5527ad2 100644
--- a/src/3rdparty/webkit/WebCore/rendering/style/StyleBackgroundData.cpp
+++ b/src/3rdparty/webkit/WebCore/rendering/style/StyleBackgroundData.cpp
@@ -22,12 +22,14 @@
#include "config.h"
#include "StyleBackgroundData.h"
+#include "RenderStyle.h"
#include "RenderStyleConstants.h"
namespace WebCore {
StyleBackgroundData::StyleBackgroundData()
: m_background(BackgroundFillLayer)
+ , m_color(RenderStyle::initialBackgroundColor())
{
}