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

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: Redo LayoutTable/LayoutTableSection 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
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 3e9803db0154062993c53218c7e93b3124928e05..87e9ca7c3b3392677cf162bc90238ce02b83bedf 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -2125,6 +2125,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())

Powered by Google App Engine
This is Rietveld 408576698