Commit e0c3161a authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Refactor: unsigned short -> uint16_t in third_party/blink/renderer/core/style

- unsigned short -> uint16_t.
- Used ToUnsigned instead of ToFloat
- Reference: https://google.github.io/styleguide/cppguide.html#Integer_Types

Bug: 929986
Change-Id: I0701321485e056d639f43d1f32af8d0054ea6b52
Reviewed-on: https://chromium-review.googlesource.com/c/1488471Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635432}
parent b3c9dd03
...@@ -96,7 +96,7 @@ void PaintComplexOutline(GraphicsContext& graphics_context, ...@@ -96,7 +96,7 @@ void PaintComplexOutline(GraphicsContext& graphics_context,
// Construct a clockwise path along the outer edge of the outline. // Construct a clockwise path along the outer edge of the outline.
SkRegion region; SkRegion region;
int width = style.OutlineWidth(); uint16_t width = style.OutlineWidth();
int outset = style.OutlineOffset() + style.OutlineWidth(); int outset = style.OutlineOffset() + style.OutlineWidth();
for (auto& r : rects) { for (auto& r : rects) {
IntRect rect = r; IntRect rect = r;
......
...@@ -545,9 +545,9 @@ class ComputedStyle : public ComputedStyleBase, ...@@ -545,9 +545,9 @@ class ComputedStyle : public ComputedStyleBase,
// Column properties. // Column properties.
// column-count (aka -webkit-column-count) // column-count (aka -webkit-column-count)
void SetColumnCount(unsigned short c) { void SetColumnCount(uint16_t c) {
SetHasAutoColumnCountInternal(false); SetHasAutoColumnCountInternal(false);
SetColumnCountInternal(clampTo<unsigned short>(c, 1)); SetColumnCountInternal(clampTo<uint16_t>(c, 1));
} }
void SetHasAutoColumnCount() { void SetHasAutoColumnCount() {
SetHasAutoColumnCountInternal(true); SetHasAutoColumnCountInternal(true);
...@@ -563,13 +563,13 @@ class ComputedStyle : public ComputedStyleBase, ...@@ -563,13 +563,13 @@ class ComputedStyle : public ComputedStyleBase,
} }
// column-rule-width (aka -webkit-column-rule-width) // column-rule-width (aka -webkit-column-rule-width)
unsigned short ColumnRuleWidth() const { uint16_t ColumnRuleWidth() const {
if (ColumnRuleStyle() == EBorderStyle::kNone || if (ColumnRuleStyle() == EBorderStyle::kNone ||
ColumnRuleStyle() == EBorderStyle::kHidden) ColumnRuleStyle() == EBorderStyle::kHidden)
return 0; return 0;
return ColumnRuleWidthInternal().ToFloat(); return ColumnRuleWidthInternal().ToUnsigned();
} }
void SetColumnRuleWidth(unsigned short w) { void SetColumnRuleWidth(uint16_t w) {
SetColumnRuleWidthInternal(LayoutUnit(w)); SetColumnRuleWidthInternal(LayoutUnit(w));
} }
...@@ -650,15 +650,12 @@ class ComputedStyle : public ComputedStyleBase, ...@@ -650,15 +650,12 @@ class ComputedStyle : public ComputedStyleBase,
} }
// outline-width // outline-width
unsigned short OutlineWidth() const { uint16_t OutlineWidth() const {
if (OutlineStyle() == EBorderStyle::kNone) if (OutlineStyle() == EBorderStyle::kNone)
return 0; return 0;
// FIXME: Why is this stored as a float but converted to short? return OutlineWidthInternal().ToUnsigned();
return OutlineWidthInternal().ToFloat();
}
void SetOutlineWidth(unsigned short v) {
SetOutlineWidthInternal(LayoutUnit(v));
} }
void SetOutlineWidth(uint16_t v) { SetOutlineWidthInternal(LayoutUnit(v)); }
// outline-offset // outline-offset
int OutlineOffset() const { int OutlineOffset() const {
......
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