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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2906253003: Replace call sites to BorderValue functions to save the BorderValue construction cost (Closed)
Patch Set: rune@ renames Created 3 years, 7 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 | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 3bb53f552e82e5e947e40db31739f4a95d393238..cee3e96d873544bf1ce14b3034d03a2fe0c2966b 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -2135,6 +2135,44 @@ float ComputedStyle::BorderUnderWidth() const {
return IsHorizontalWritingMode() ? BorderBottomWidth() : BorderLeftWidth();
}
+EBorderStyle ComputedStyle::BorderBeforeStyle() const {
+ switch (GetWritingMode()) {
+ case WritingMode::kHorizontalTb:
+ return BorderTopStyle();
+ case WritingMode::kVerticalLr:
+ return BorderLeftStyle();
+ case WritingMode::kVerticalRl:
+ return BorderRightStyle();
+ }
+ NOTREACHED();
+ return BorderTopStyle();
+}
+
+EBorderStyle ComputedStyle::BorderAfterStyle() const {
+ switch (GetWritingMode()) {
+ case WritingMode::kHorizontalTb:
+ return BorderBottomStyle();
+ case WritingMode::kVerticalLr:
+ return BorderRightStyle();
+ case WritingMode::kVerticalRl:
+ return BorderLeftStyle();
+ }
+ NOTREACHED();
+ return BorderBottomStyle();
+}
+
+EBorderStyle ComputedStyle::BorderStartStyle() const {
+ if (IsHorizontalWritingMode())
+ return IsLeftToRightDirection() ? BorderLeftStyle() : BorderRightStyle();
+ return IsLeftToRightDirection() ? BorderTopStyle() : BorderBottomStyle();
+}
+
+EBorderStyle ComputedStyle::BorderEndStyle() const {
+ if (IsHorizontalWritingMode())
+ return IsLeftToRightDirection() ? BorderRightStyle() : BorderLeftStyle();
+ return IsLeftToRightDirection() ? BorderBottomStyle() : BorderTopStyle();
+}
+
void ComputedStyle::SetMarginStart(const Length& margin) {
if (IsHorizontalWritingMode()) {
if (IsLeftToRightDirection())
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698