diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/ViewportStyleResolver.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/css/ViewportStyleResolver.cpp')
-rw-r--r-- | Source/WebCore/css/ViewportStyleResolver.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/WebCore/css/ViewportStyleResolver.cpp b/Source/WebCore/css/ViewportStyleResolver.cpp index cbc398a26..dc3421924 100644 --- a/Source/WebCore/css/ViewportStyleResolver.cpp +++ b/Source/WebCore/css/ViewportStyleResolver.cpp @@ -34,6 +34,7 @@ #include "CSSValueKeywords.h" #include "Document.h" +#include "NodeRenderStyle.h" #include "Page.h" #include "RenderView.h" #include "StyleProperties.h" @@ -70,7 +71,7 @@ void ViewportStyleResolver::addViewportRule(StyleRuleViewport* viewportRule) void ViewportStyleResolver::clearDocument() { - m_document = 0; + m_document = nullptr; } void ViewportStyleResolver::resolve() @@ -93,7 +94,7 @@ void ViewportStyleResolver::resolve() m_document->setViewportArguments(arguments); m_document->updateViewportArguments(); - m_propertySet = 0; + m_propertySet = nullptr; } float ViewportStyleResolver::getViewportArgumentValue(CSSPropertyID id) const @@ -107,19 +108,19 @@ float ViewportStyleResolver::getViewportArgumentValue(CSSPropertyID id) const defaultValue = 1; RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); - if (!value || !value->isPrimitiveValue()) + if (!is<CSSPrimitiveValue>(value.get())) return defaultValue; - CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); + CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value); - if (primitiveValue->isNumber() || primitiveValue->isPx()) - return primitiveValue->getFloatValue(); + if (primitiveValue.isNumber() || primitiveValue.isPx()) + return primitiveValue.floatValue(); - if (primitiveValue->isFontRelativeLength()) - return primitiveValue->getFloatValue() * m_document->documentElement()->renderStyle()->fontDescription().computedSize(); + if (primitiveValue.isFontRelativeLength()) + return primitiveValue.floatValue() * m_document->documentElement()->renderStyle()->fontDescription().computedSize(); - if (primitiveValue->isPercentage()) { - float percentValue = primitiveValue->getFloatValue() / 100.0f; + if (primitiveValue.isPercentage()) { + float percentValue = primitiveValue.floatValue() / 100.0f; switch (id) { case CSSPropertyMaxHeight: case CSSPropertyMinHeight: @@ -139,7 +140,7 @@ float ViewportStyleResolver::getViewportArgumentValue(CSSPropertyID id) const } } - switch (primitiveValue->getValueID()) { + switch (primitiveValue.valueID()) { case CSSValueAuto: return defaultValue; case CSSValueDeviceHeight: |