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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2611723004: Add 'DirectionString' suffix to |rtl|, |ltr| and |inherit| constant identifiers. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index 05a111718b7d39b02404da3c695cd4f57ea6f131..a42c74408306641cbb2c9b98e1699c619e8f0c10 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -70,9 +70,9 @@
namespace blink {
static const char defaultFont[] = "10px sans-serif";
-static const char inherit[] = "inherit";
-static const char rtl[] = "rtl";
-static const char ltr[] = "ltr";
+static const char inheritDirectionString[] = "inherit";
+static const char rtlDirectionString[] = "rtl";
+static const char ltrDirectionString[] = "ltr";
static const double TryRestoreContextInterval = 0.5;
static const unsigned MaxTryRestoreContextAttempts = 4;
static const double cDeviceScaleFactor = 1.0; // Canvas is device independent
@@ -691,17 +691,17 @@ String CanvasRenderingContext2D::direction() const {
if (state().getDirection() == CanvasRenderingContext2DState::DirectionInherit)
canvas()->document().updateStyleAndLayoutTreeForNode(canvas());
return toTextDirection(state().getDirection(), canvas()) == TextDirection::Rtl
- ? rtl
- : ltr;
+ ? rtlDirectionString
+ : ltrDirectionString;
}
void CanvasRenderingContext2D::setDirection(const String& directionString) {
CanvasRenderingContext2DState::Direction direction;
- if (directionString == inherit)
+ if (directionString == inheritDirectionString)
direction = CanvasRenderingContext2DState::DirectionInherit;
- else if (directionString == rtl)
+ else if (directionString == rtlDirectionString)
direction = CanvasRenderingContext2DState::DirectionRTL;
- else if (directionString == ltr)
+ else if (directionString == ltrDirectionString)
direction = CanvasRenderingContext2DState::DirectionLTR;
else
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698