[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
simon.fraser at apple.com
simon.fraser at apple.com
Mon Feb 21 00:25:07 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 603412770c3f860df55e07d113f07b3d77886111
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 31 06:18:13 2011 +0000
2011-01-30 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r77107.
http://trac.webkit.org/changeset/77107
https://bugs.webkit.org/show_bug.cgi?id=53412
Caused 5 new form-related test crashes (Requested by smfr on
#webkit).
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
(WebCore::nameToPseudoTypeMap):
(WebCore::CSSSelector::extractPseudoType):
* css/CSSSelector.h:
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::parseMappedAttribute):
(WebCore::HTMLProgressElement::attach):
* html/HTMLProgressElement.h:
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::~RenderProgress):
(WebCore::RenderProgress::updateFromElement):
(WebCore::RenderProgress::layoutParts):
(WebCore::RenderProgress::shouldHaveParts):
* rendering/RenderProgress.h:
* rendering/style/RenderStyleConstants.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0bc9714..31b47e6 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2011-01-30 Sheriff Bot <webkit.review.bot at gmail.com>
+
+ Unreviewed, rolling out r77107.
+ http://trac.webkit.org/changeset/77107
+ https://bugs.webkit.org/show_bug.cgi?id=53412
+
+ Caused 5 new form-related test crashes (Requested by smfr on
+ #webkit).
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId):
+ (WebCore::nameToPseudoTypeMap):
+ (WebCore::CSSSelector::extractPseudoType):
+ * css/CSSSelector.h:
+ * html/HTMLProgressElement.cpp:
+ (WebCore::HTMLProgressElement::parseMappedAttribute):
+ (WebCore::HTMLProgressElement::attach):
+ * html/HTMLProgressElement.h:
+ * rendering/RenderProgress.cpp:
+ (WebCore::RenderProgress::~RenderProgress):
+ (WebCore::RenderProgress::updateFromElement):
+ (WebCore::RenderProgress::layoutParts):
+ (WebCore::RenderProgress::shouldHaveParts):
+ * rendering/RenderProgress.h:
+ * rendering/style/RenderStyleConstants.h:
+
2011-01-30 Simon Fraser <simon.fraser at apple.com>
Reviewed by Sam Weinig.
diff --git a/Source/WebCore/css/CSSSelector.cpp b/Source/WebCore/css/CSSSelector.cpp
index df192d7..1be7f36 100644
--- a/Source/WebCore/css/CSSSelector.cpp
+++ b/Source/WebCore/css/CSSSelector.cpp
@@ -168,6 +168,14 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
return INNER_SPIN_BUTTON;
case PseudoOuterSpinButton:
return OUTER_SPIN_BUTTON;
+ case PseudoProgressBarValue:
+#if ENABLE(PROGRESS_TAG)
+ return PROGRESS_BAR_VALUE;
+#else
+ ASSERT_NOT_REACHED();
+ return NOPSEUDO;
+#endif
+
#if ENABLE(METER_TAG)
case PseudoMeterHorizontalBar:
return METER_HORIZONTAL_BAR;
@@ -327,6 +335,10 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
DEFINE_STATIC_LOCAL(AtomicString, onlyOfType, ("only-of-type"));
DEFINE_STATIC_LOCAL(AtomicString, optional, ("optional"));
DEFINE_STATIC_LOCAL(AtomicString, outerSpinButton, ("-webkit-outer-spin-button"));
+#if ENABLE(PROGRESS_TAG)
+ DEFINE_STATIC_LOCAL(AtomicString, progressBarValue, ("-webkit-progress-bar-value"));
+#endif
+
#if ENABLE(METER_TAG)
DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalBar, ("-webkit-meter-horizontal-bar"));
DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalOptimumValue, ("-webkit-meter-horizontal-optimum-value"));
@@ -430,6 +442,9 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
nameToPseudoType->set(nthLastChild.impl(), CSSSelector::PseudoNthLastChild);
nameToPseudoType->set(nthLastOfType.impl(), CSSSelector::PseudoNthLastOfType);
nameToPseudoType->set(outerSpinButton.impl(), CSSSelector::PseudoOuterSpinButton);
+#if ENABLE(PROGRESS_TAG)
+ nameToPseudoType->set(progressBarValue.impl(), CSSSelector::PseudoProgressBarValue);
+#endif
#if ENABLE(METER_TAG)
nameToPseudoType->set(meterHorizontalBar.impl(), CSSSelector::PseudoMeterHorizontalBar);
nameToPseudoType->set(meterHorizontalOptimumValue.impl(), CSSSelector::PseudoMeterHorizontalOptimum);
@@ -529,6 +544,7 @@ void CSSSelector::extractPseudoType() const
case PseudoMeterVerticalSuboptimal:
case PseudoMeterVerticalEvenLessGood:
case PseudoOuterSpinButton:
+ case PseudoProgressBarValue:
case PseudoResizer:
case PseudoScrollbar:
case PseudoScrollbarCorner:
diff --git a/Source/WebCore/css/CSSSelector.h b/Source/WebCore/css/CSSSelector.h
index f3f800b..cbe3e9b 100644
--- a/Source/WebCore/css/CSSSelector.h
+++ b/Source/WebCore/css/CSSSelector.h
@@ -195,6 +195,7 @@ namespace WebCore {
#endif
PseudoInnerSpinButton,
PseudoOuterSpinButton,
+ PseudoProgressBarValue,
PseudoLeftPage,
PseudoRightPage,
PseudoFirstPage,
diff --git a/Source/WebCore/html/HTMLProgressElement.cpp b/Source/WebCore/html/HTMLProgressElement.cpp
index 1655823..4a55a1e 100644
--- a/Source/WebCore/html/HTMLProgressElement.cpp
+++ b/Source/WebCore/html/HTMLProgressElement.cpp
@@ -30,33 +30,12 @@
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
#include "RenderProgress.h"
-#include "ShadowElement.h"
#include <wtf/StdLibExtras.h>
namespace WebCore {
using namespace HTMLNames;
-class ProgressBarValueElement : public ShadowBlockElement {
-public:
- ProgressBarValueElement(HTMLElement* shadowParent)
- : ShadowBlockElement(shadowParent)
- {
- }
-
- virtual const AtomicString& shadowPseudoId() const
- {
- DEFINE_STATIC_LOCAL(AtomicString, pseudId, ("-webkit-progress-bar-value"));
- return pseudId;
- }
-
- static PassRefPtr<ProgressBarValueElement> create(HTMLElement* shadowParent)
- {
- return adoptRef(new ProgressBarValueElement(shadowParent));
- }
-
-};
-
HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
: HTMLFormControlElement(tagName, document, form)
{
@@ -81,19 +60,21 @@ const AtomicString& HTMLProgressElement::formControlType() const
void HTMLProgressElement::parseMappedAttribute(Attribute* attribute)
{
- if (attribute->name() == valueAttr)
- didElementStateChange();
- else if (attribute->name() == maxAttr)
- didElementStateChange();
- else
+ if (attribute->name() == valueAttr) {
+ if (renderer())
+ renderer()->updateFromElement();
+ } else if (attribute->name() == maxAttr) {
+ if (renderer())
+ renderer()->updateFromElement();
+ } else
HTMLFormControlElement::parseMappedAttribute(attribute);
}
void HTMLProgressElement::attach()
{
- createShadowSubtreeIfNeeded();
HTMLFormControlElement::attach();
- didElementStateChange();
+ if (renderer())
+ renderer()->updateFromElement();
}
double HTMLProgressElement::value() const
@@ -140,23 +121,5 @@ double HTMLProgressElement::position() const
return value() / max();
}
-ShadowBlockElement* HTMLProgressElement::valuePart()
-{
- return static_cast<ShadowBlockElement*>(shadowRoot());
-}
-
-void HTMLProgressElement::didElementStateChange()
-{
- if (renderer())
- renderer()->updateFromElement();
-}
-
-void HTMLProgressElement::createShadowSubtreeIfNeeded()
-{
- if (shadowRoot())
- return;
- setShadowRoot(ProgressBarValueElement::create(this).get());
-}
-
} // namespace
#endif
diff --git a/Source/WebCore/html/HTMLProgressElement.h b/Source/WebCore/html/HTMLProgressElement.h
index 3f43cd9..c80f50f 100644
--- a/Source/WebCore/html/HTMLProgressElement.h
+++ b/Source/WebCore/html/HTMLProgressElement.h
@@ -26,8 +26,6 @@
namespace WebCore {
-class ShadowBlockElement;
-
class HTMLProgressElement : public HTMLFormControlElement {
public:
static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document*, HTMLFormElement*);
@@ -40,7 +38,6 @@ public:
double position() const;
- ShadowBlockElement* valuePart();
private:
HTMLProgressElement(const QualifiedName&, Document*, HTMLFormElement*);
@@ -53,9 +50,6 @@ private:
virtual void parseMappedAttribute(Attribute*);
virtual void attach();
-
- void didElementStateChange();
- void createShadowSubtreeIfNeeded();
};
} // namespace
diff --git a/Source/WebCore/rendering/RenderProgress.cpp b/Source/WebCore/rendering/RenderProgress.cpp
index 1ec0a72..4194e2b 100644
--- a/Source/WebCore/rendering/RenderProgress.cpp
+++ b/Source/WebCore/rendering/RenderProgress.cpp
@@ -49,14 +49,22 @@ RenderProgress::RenderProgress(HTMLProgressElement* element)
RenderProgress::~RenderProgress()
{
+ if (m_valuePart)
+ m_valuePart->detach();
}
void RenderProgress::updateFromElement()
{
+ if (!m_valuePart) {
+ m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
+ if (m_valuePart->renderer())
+ addChild(m_valuePart->renderer());
+ }
+
if (shouldHaveParts())
style()->setAppearance(NoControlPart);
- else if (valuePart()->renderer())
- valuePart()->renderer()->style()->setVisibility(HIDDEN);
+ else if (m_valuePart->renderer())
+ m_valuePart->renderer()->style()->setVisibility(HIDDEN);
HTMLProgressElement* element = progressElement();
if (m_position == element->position())
@@ -94,7 +102,7 @@ void RenderProgress::paint(PaintInfo& paintInfo, int tx, int ty)
void RenderProgress::layoutParts()
{
- valuePart()->layoutAsPart(valuePartRect());
+ m_valuePart->layoutAsPart(valuePartRect());
updateAnimationState();
}
@@ -102,7 +110,7 @@ bool RenderProgress::shouldHaveParts() const
{
if (!style()->hasAppearance())
return true;
- if (!(valuePart()->renderer() && valuePart()->renderer()->style()->hasAppearance()))
+ if (ShadowBlockElement::partShouldHaveStyle(this, PROGRESS_BAR_VALUE))
return true;
return false;
}
@@ -137,11 +145,6 @@ HTMLProgressElement* RenderProgress::progressElement() const
return static_cast<HTMLProgressElement*>(node());
}
-ShadowBlockElement* RenderProgress::valuePart() const
-{
- return progressElement()->valuePart();
-}
-
} // namespace WebCore
#endif
diff --git a/Source/WebCore/rendering/RenderProgress.h b/Source/WebCore/rendering/RenderProgress.h
index d5d036c..9ed5741 100644
--- a/Source/WebCore/rendering/RenderProgress.h
+++ b/Source/WebCore/rendering/RenderProgress.h
@@ -57,14 +57,13 @@ private:
void animationTimerFired(Timer<RenderProgress>*);
void updateAnimationState();
- ShadowBlockElement* valuePart() const;
-
double m_position;
double m_animationStartTime;
double m_animationRepeatInterval;
double m_animationDuration;
bool m_animating;
Timer<RenderProgress> m_animationTimer;
+ RefPtr<ShadowBlockElement> m_valuePart;
};
inline RenderProgress* toRenderProgress(RenderObject* object)
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h
index c95bf5a..633d482 100644
--- a/Source/WebCore/rendering/style/RenderStyleConstants.h
+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h
@@ -71,7 +71,7 @@ enum PseudoId {
SEARCH_CANCEL_BUTTON, SEARCH_DECORATION, SEARCH_RESULTS_DECORATION, SEARCH_RESULTS_BUTTON, MEDIA_CONTROLS_PANEL,
MEDIA_CONTROLS_TIMELINE_CONTAINER, MEDIA_CONTROLS_VOLUME_SLIDER_CONTAINER, MEDIA_CONTROLS_CURRENT_TIME_DISPLAY, MEDIA_CONTROLS_TIME_REMAINING_DISPLAY,
MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
- INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK,
+ INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK, PROGRESS_BAR_VALUE,
METER_HORIZONTAL_BAR, METER_HORIZONTAL_OPTIMUM, METER_HORIZONTAL_SUBOPTIMAL, METER_HORIZONTAL_EVEN_LESS_GOOD,
METER_VERTICAL_BAR, METER_VERTICAL_OPTIMUM, METER_VERTICAL_SUBOPTIMAL, METER_VERTICAL_EVEN_LESS_GOOD,
AFTER_LAST_INTERNAL_PSEUDOID,
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list