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

Unified Diff: Source/core/layout/style/BorderEdge.cpp

Issue 1045723009: Move core/layout/style to core/style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 5 years, 9 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 | « Source/core/layout/style/BorderEdge.h ('k') | Source/core/layout/style/BorderImageLength.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/style/BorderEdge.cpp
diff --git a/Source/core/layout/style/BorderEdge.cpp b/Source/core/layout/style/BorderEdge.cpp
deleted file mode 100644
index 67788be8e69fd52edca2970b8140b9922b8c0fae..0000000000000000000000000000000000000000
--- a/Source/core/layout/style/BorderEdge.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "core/layout/style/BorderEdge.h"
-
-namespace blink {
-
-BorderEdge::BorderEdge(int edgeWidth, const Color& edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent)
- : width(edgeWidth)
- , color(edgeColor)
- , isTransparent(edgeIsTransparent)
- , isPresent(edgeIsPresent)
- , style(edgeStyle)
-{
- if (style == DOUBLE && edgeWidth < 3)
- style = SOLID;
-}
-
-BorderEdge::BorderEdge()
- : width(0)
- , isTransparent(false)
- , isPresent(false)
- , style(BHIDDEN)
-{
-}
-
-bool BorderEdge::hasVisibleColorAndStyle() const
-{
- return style > BHIDDEN && !isTransparent;
-}
-
-bool BorderEdge::shouldRender() const { return isPresent && width && hasVisibleColorAndStyle(); }
-bool BorderEdge::presentButInvisible() const { return usedWidth() && !hasVisibleColorAndStyle(); }
-bool BorderEdge::obscuresBackgroundEdge(float scale) const
-{
- if (!isPresent || isTransparent || (width * scale) < 2 || color.hasAlpha() || style == BHIDDEN)
- return false;
-
- if (style == DOTTED || style == DASHED)
- return false;
-
- if (style == DOUBLE)
- return width >= 5 * scale; // The outer band needs to be >= 2px wide at unit scale.
-
- return true;
-}
-bool BorderEdge::obscuresBackground() const
-{
- if (!isPresent || isTransparent || color.hasAlpha() || style == BHIDDEN)
- return false;
-
- if (style == DOTTED || style == DASHED || style == DOUBLE)
- return false;
-
- return true;
-}
-
-int BorderEdge::usedWidth() const
-{
- return isPresent ? width : 0;
-}
-
-void BorderEdge::getDoubleBorderStripeWidths(int& outerWidth, int& innerWidth) const
-{
- int fullWidth = usedWidth();
- outerWidth = fullWidth / 3;
- innerWidth = fullWidth * 2 / 3;
-
- // We need certain integer rounding results
- if (fullWidth % 3 == 2)
- outerWidth += 1;
-
- if (fullWidth % 3 == 1)
- innerWidth += 1;
-}
-
-bool BorderEdge::sharesColorWith(const BorderEdge& other) const
-{
- return color == other.color;
-}
-
-} // namespace blink
« no previous file with comments | « Source/core/layout/style/BorderEdge.h ('k') | Source/core/layout/style/BorderImageLength.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698