Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Unified Diff: Source/core/inspector/LayoutEditor.cpp

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/LayoutEditor.h ('k') | Source/core/layout/svg/ReferenceFilterBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/LayoutEditor.cpp
diff --git a/Source/core/inspector/LayoutEditor.cpp b/Source/core/inspector/LayoutEditor.cpp
index e7d46b2534318ac01fee895bf37774c8b97f58a5..81dc8cb7fb42aab04d74d65940af8627fbd0833e 100644
--- a/Source/core/inspector/LayoutEditor.cpp
+++ b/Source/core/inspector/LayoutEditor.cpp
@@ -6,7 +6,6 @@
#include "core/inspector/LayoutEditor.h"
#include "core/css/CSSComputedStyleDeclaration.h"
-#include "core/css/CSSPrimitiveValue.h"
#include "core/frame/FrameView.h"
#include "core/inspector/InspectorCSSAgent.h"
#include "core/layout/LayoutBox.h"
@@ -133,24 +132,24 @@ PassRefPtr<JSONObject> LayoutEditor::buildJSONInfo() const
return object.release();
}
-RefPtrWillBeRawPtr<CSSPrimitiveValue> LayoutEditor::getPropertyCSSValue(CSSPropertyID property) const
+NullableCSSValue LayoutEditor::getPropertyCSSValue(CSSPropertyID property) const
{
RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> computedStyleInfo = CSSComputedStyleDeclaration::create(m_node, true);
- RefPtrWillBeRawPtr<CSSValue> cssValue = computedStyleInfo->getPropertyCSSValue(property);
- if (!cssValue->isPrimitiveValue())
+ NullableCSSValue cssValue = computedStyleInfo->getPropertyCSSValue(property);
+ if (!cssValue || !cssValue->isPrimitiveValue())
return nullptr;
- return toCSSPrimitiveValue(cssValue.get());
+ return cssValue;
}
PassRefPtr<JSONObject> LayoutEditor::createValueDescription(const String& propertyName) const
{
- RefPtrWillBeRawPtr<CSSPrimitiveValue> cssValue = getPropertyCSSValue(cssPropertyID(propertyName));
+ NullableCSSValue cssValue = getPropertyCSSValue(cssPropertyID(propertyName));
if (!cssValue)
return nullptr;
RefPtr<JSONObject> object = JSONObject::create();
- object->setNumber("value", cssValue->getFloatValue());
+ object->setNumber("value", toCSSPrimitiveValue(cssValue)->getFloatValue());
object->setString("unit", "px");
return object.release();
}
@@ -161,13 +160,13 @@ void LayoutEditor::overlayStartedPropertyChange(const String& anchorName)
if (!m_node || !m_changingProperty)
return;
- RefPtrWillBeRawPtr<CSSPrimitiveValue> cssValue = getPropertyCSSValue(m_changingProperty);
+ NullableCSSValue cssValue = getPropertyCSSValue(m_changingProperty);
if (!cssValue) {
m_changingProperty = CSSPropertyInvalid;
return;
}
- m_propertyInitialValue = cssValue->getFloatValue();
+ m_propertyInitialValue = toCSSPrimitiveValue(cssValue)->getFloatValue();
}
void LayoutEditor::overlayPropertyChanged(float cssDelta)
« no previous file with comments | « Source/core/inspector/LayoutEditor.h ('k') | Source/core/layout/svg/ReferenceFilterBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698