This source file includes following definitions.
- progressElement
- rendererIsNeeded
- createRenderer
- rendererIsNeeded
- setWidthPercentage
#include "config.h"
#include "core/html/shadow/ProgressShadowElement.h"
#include "HTMLNames.h"
#include "core/html/HTMLProgressElement.h"
#include "core/rendering/RenderProgress.h"
namespace WebCore {
using namespace HTMLNames;
ProgressShadowElement::ProgressShadowElement(Document& document)
: HTMLDivElement(document)
{
}
HTMLProgressElement* ProgressShadowElement::progressElement() const
{
return toHTMLProgressElement(shadowHost());
}
bool ProgressShadowElement::rendererIsNeeded(const RenderStyle& style)
{
RenderObject* progressRenderer = progressElement()->renderer();
return progressRenderer && !progressRenderer->style()->hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
}
ProgressInnerElement::ProgressInnerElement(Document& document)
: ProgressShadowElement(document)
{
}
RenderObject* ProgressInnerElement::createRenderer(RenderStyle*)
{
return new RenderProgress(this);
}
bool ProgressInnerElement::rendererIsNeeded(const RenderStyle& style)
{
if (progressElement()->hasAuthorShadowRoot())
return HTMLDivElement::rendererIsNeeded(style);
RenderObject* progressRenderer = progressElement()->renderer();
return progressRenderer && !progressRenderer->style()->hasAppearance() && HTMLDivElement::rendererIsNeeded(style);
}
ProgressBarElement::ProgressBarElement(Document& document)
: ProgressShadowElement(document)
{
}
ProgressValueElement::ProgressValueElement(Document& document)
: ProgressShadowElement(document)
{
}
void ProgressValueElement::setWidthPercentage(double width)
{
setInlineStyleProperty(CSSPropertyWidth, width, CSSPrimitiveValue::CSS_PERCENTAGE);
}
}