Commit e365b2b8 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Make the Length(LengthType) constructor explicit

Per coding style:

https: //google.github.io/styleguide/cppguide.html#Implicit_Conversions
Change-Id: Ic7a05422e72b3e445236b054d887b5467f79ab6c
Reviewed-on: https://chromium-review.googlesource.com/809010Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#521786}
parent 5e19a799
...@@ -1386,10 +1386,10 @@ class ComputedStyle : public ComputedStyleBase, ...@@ -1386,10 +1386,10 @@ class ComputedStyle : public ComputedStyleBase,
!PaddingTop().IsZero() || !PaddingBottom().IsZero(); !PaddingTop().IsZero() || !PaddingBottom().IsZero();
} }
void ResetPadding() { void ResetPadding() {
SetPaddingTop(kFixed); SetPaddingTop(Length(kFixed));
SetPaddingBottom(kFixed); SetPaddingBottom(Length(kFixed));
SetPaddingLeft(kFixed); SetPaddingLeft(Length(kFixed));
SetPaddingRight(kFixed); SetPaddingRight(Length(kFixed));
} }
void SetPadding(const LengthBox& b) { void SetPadding(const LengthBox& b) {
SetPaddingTop(b.top_); SetPaddingTop(b.top_);
......
...@@ -64,7 +64,7 @@ class PLATFORM_EXPORT Length { ...@@ -64,7 +64,7 @@ class PLATFORM_EXPORT Length {
public: public:
Length() : int_value_(0), quirk_(false), type_(kAuto), is_float_(false) {} Length() : int_value_(0), quirk_(false), type_(kAuto), is_float_(false) {}
Length(LengthType t) explicit Length(LengthType t)
: int_value_(0), quirk_(false), type_(t), is_float_(false) { : int_value_(0), quirk_(false), type_(t), is_float_(false) {
DCHECK_NE(t, kCalculated); DCHECK_NE(t, kCalculated);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment