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

Side by Side Diff: Source/core/style/ComputedStyle.cpp

Issue 1165393005: Add helper for computing outset for 'outline' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 23 matching lines...) Expand all
34 #include "core/style/PathStyleMotionPath.h" 34 #include "core/style/PathStyleMotionPath.h"
35 #include "core/style/QuotesData.h" 35 #include "core/style/QuotesData.h"
36 #include "core/style/ShadowList.h" 36 #include "core/style/ShadowList.h"
37 #include "core/style/StyleImage.h" 37 #include "core/style/StyleImage.h"
38 #include "core/style/StyleInheritedData.h" 38 #include "core/style/StyleInheritedData.h"
39 #include "platform/LengthFunctions.h" 39 #include "platform/LengthFunctions.h"
40 #include "platform/RuntimeEnabledFeatures.h" 40 #include "platform/RuntimeEnabledFeatures.h"
41 #include "platform/fonts/Font.h" 41 #include "platform/fonts/Font.h"
42 #include "platform/fonts/FontSelector.h" 42 #include "platform/fonts/FontSelector.h"
43 #include "platform/geometry/FloatRoundedRect.h" 43 #include "platform/geometry/FloatRoundedRect.h"
44 #include "platform/graphics/GraphicsContext.h"
44 #include "wtf/MathExtras.h" 45 #include "wtf/MathExtras.h"
45 46
46 #include <algorithm> 47 #include <algorithm>
47 48
48 namespace blink { 49 namespace blink {
49 50
50 struct SameSizeAsBorderValue { 51 struct SameSizeAsBorderValue {
51 RGBA32 m_color; 52 RGBA32 m_color;
52 unsigned m_width; 53 unsigned m_width;
53 }; 54 };
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 { 1605 {
1605 ASSERT(path); 1606 ASSERT(path);
1606 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = path; 1607 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = path;
1607 } 1608 }
1608 1609
1609 void ComputedStyle::resetMotionPath() 1610 void ComputedStyle::resetMotionPath()
1610 { 1611 {
1611 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = nullp tr; 1612 rareNonInheritedData.access()->m_transform.access()->m_motion.m_path = nullp tr;
1612 } 1613 }
1613 1614
1615 int ComputedStyle::outlineOutset() const
1616 {
1617 if (!hasOutline())
1618 return 0;
1619 if (outlineStyleIsAuto())
1620 return GraphicsContext::focusRingOutsetExtent(outlineOffset(), outlineWi dth());
1621 return outlineSize();
1622 }
1623
1614 bool ComputedStyle::columnRuleEquivalent(const ComputedStyle* otherStyle) const 1624 bool ComputedStyle::columnRuleEquivalent(const ComputedStyle* otherStyle) const
1615 { 1625 {
1616 return columnRuleStyle() == otherStyle->columnRuleStyle() 1626 return columnRuleStyle() == otherStyle->columnRuleStyle()
1617 && columnRuleWidth() == otherStyle->columnRuleWidth() 1627 && columnRuleWidth() == otherStyle->columnRuleWidth()
1618 && visitedDependentColor(CSSPropertyWebkitColumnRuleColor) == otherStyle ->visitedDependentColor(CSSPropertyWebkitColumnRuleColor); 1628 && visitedDependentColor(CSSPropertyWebkitColumnRuleColor) == otherStyle ->visitedDependentColor(CSSPropertyWebkitColumnRuleColor);
1619 } 1629 }
1620 1630
1621 TextEmphasisMark ComputedStyle::textEmphasisMark() const 1631 TextEmphasisMark ComputedStyle::textEmphasisMark() const
1622 { 1632 {
1623 TextEmphasisMark mark = static_cast<TextEmphasisMark>(rareInheritedData->tex tEmphasisMark); 1633 TextEmphasisMark mark = static_cast<TextEmphasisMark>(rareInheritedData->tex tEmphasisMark);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 } 1748 }
1739 1749
1740 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other) 1750 void ComputedStyle::copyChildDependentFlagsFrom(const ComputedStyle& other)
1741 { 1751 {
1742 setEmptyState(other.emptyState()); 1752 setEmptyState(other.emptyState());
1743 if (other.hasExplicitlyInheritedProperties()) 1753 if (other.hasExplicitlyInheritedProperties())
1744 setHasExplicitlyInheritedProperties(); 1754 setHasExplicitlyInheritedProperties();
1745 } 1755 }
1746 1756
1747 } // namespace blink 1757 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698