summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderProgress.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/RenderProgress.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/rendering/RenderProgress.cpp')
-rw-r--r--Source/WebCore/rendering/RenderProgress.cpp37
1 files changed, 14 insertions, 23 deletions
diff --git a/Source/WebCore/rendering/RenderProgress.cpp b/Source/WebCore/rendering/RenderProgress.cpp
index 6a4197acb..3b14e407a 100644
--- a/Source/WebCore/rendering/RenderProgress.cpp
+++ b/Source/WebCore/rendering/RenderProgress.cpp
@@ -19,26 +19,23 @@
*/
#include "config.h"
-#if ENABLE(PROGRESS_ELEMENT)
#include "RenderProgress.h"
-#include "HTMLNames.h"
#include "HTMLProgressElement.h"
-#include "PaintInfo.h"
#include "RenderTheme.h"
#include <wtf/CurrentTime.h>
#include <wtf/RefPtr.h>
namespace WebCore {
-RenderProgress::RenderProgress(HTMLElement& element, PassRef<RenderStyle> style)
- : RenderBlockFlow(element, std::move(style))
+RenderProgress::RenderProgress(HTMLElement& element, RenderStyle&& style)
+ : RenderBlockFlow(element, WTFMove(style))
, m_position(HTMLProgressElement::InvalidPosition)
, m_animationStartTime(0)
, m_animationRepeatInterval(0)
, m_animationDuration(0)
, m_animating(false)
- , m_animationTimer(this, &RenderProgress::animationTimerFired)
+ , m_animationTimer(*this, &RenderProgress::animationTimerFired)
{
}
@@ -58,22 +55,17 @@ void RenderProgress::updateFromElement()
RenderBlockFlow::updateFromElement();
}
-void RenderProgress::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues& computedValues) const
+RenderBox::LogicalExtentComputedValues RenderProgress::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop) const
{
- RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
-
+ auto computedValues = RenderBox::computeLogicalHeight(logicalHeight, logicalTop);
LayoutRect frame = frameRect();
if (isHorizontalWritingMode())
frame.setHeight(computedValues.m_extent);
else
frame.setWidth(computedValues.m_extent);
- IntSize frameSize = theme().progressBarRectForBounds(this, pixelSnappedIntRect(frame)).size();
+ IntSize frameSize = theme().progressBarRectForBounds(*this, snappedIntRect(frame)).size();
computedValues.m_extent = isHorizontalWritingMode() ? frameSize.height() : frameSize.width();
-}
-
-bool RenderProgress::canBeReplacedWithInlineRunIn() const
-{
- return false;
+ return computedValues;
}
double RenderProgress::animationProgress() const
@@ -87,7 +79,7 @@ bool RenderProgress::isDeterminate() const
&& HTMLProgressElement::InvalidPosition != position());
}
-void RenderProgress::animationTimerFired(Timer<RenderProgress>&)
+void RenderProgress::animationTimerFired()
{
repaint();
if (!m_animationTimer.isActive() && m_animating)
@@ -96,8 +88,8 @@ void RenderProgress::animationTimerFired(Timer<RenderProgress>&)
void RenderProgress::updateAnimationState()
{
- m_animationDuration = theme().animationDurationForProgressBar(this);
- m_animationRepeatInterval = theme().animationRepeatIntervalForProgressBar(this);
+ m_animationDuration = theme().animationDurationForProgressBar(*this);
+ m_animationRepeatInterval = theme().animationRepeatIntervalForProgressBar(*this);
bool animating = style().hasAppearance() && m_animationDuration > 0;
if (animating == m_animating)
@@ -114,15 +106,14 @@ void RenderProgress::updateAnimationState()
HTMLProgressElement* RenderProgress::progressElement() const
{
if (!element())
- return 0;
+ return nullptr;
- if (isHTMLProgressElement(element()))
- return toHTMLProgressElement(element());
+ if (is<HTMLProgressElement>(*element()))
+ return downcast<HTMLProgressElement>(element());
ASSERT(element()->shadowHost());
- return toHTMLProgressElement(element()->shadowHost());
+ return downcast<HTMLProgressElement>(element()->shadowHost());
}
} // namespace WebCore
-#endif