diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/style/BorderData.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/rendering/style/BorderData.h')
-rw-r--r-- | Source/WebCore/rendering/style/BorderData.h | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/Source/WebCore/rendering/style/BorderData.h b/Source/WebCore/rendering/style/BorderData.h index e65628a99..06bcc99f8 100644 --- a/Source/WebCore/rendering/style/BorderData.h +++ b/Source/WebCore/rendering/style/BorderData.h @@ -22,8 +22,7 @@ * */ -#ifndef BorderData_h -#define BorderData_h +#pragma once #include "BorderValue.h" #include "IntRect.h" @@ -35,10 +34,11 @@ namespace WebCore { class BorderData { friend class RenderStyle; public: - BorderData() : m_topLeft(Length(0, Fixed), Length(0, Fixed)) - , m_topRight(Length(0, Fixed), Length(0, Fixed)) - , m_bottomLeft(Length(0, Fixed), Length(0, Fixed)) - , m_bottomRight(Length(0, Fixed), Length(0, Fixed)) + BorderData() + : m_topLeft { { 0, Fixed }, { 0, Fixed } } + , m_topRight { { 0, Fixed }, { 0, Fixed } } + , m_bottomLeft { { 0, Fixed }, { 0, Fixed } } + , m_bottomRight { { 0, Fixed }, { 0, Fixed } } { } bool hasBorder() const @@ -46,47 +46,58 @@ public: bool haveImage = m_image.hasImage(); return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage); } + + bool hasVisibleBorder() const + { + bool haveImage = m_image.hasImage(); + return m_left.isVisible(!haveImage) || m_right.isVisible(!haveImage) || m_top.isVisible(!haveImage) || m_bottom.isVisible(!haveImage); + } + bool hasFill() const + { + return m_image.hasImage() && m_image.fill(); + } + bool hasBorderRadius() const { - if (!m_topLeft.width().isZero()) - return true; - if (!m_topRight.width().isZero()) - return true; - if (!m_bottomLeft.width().isZero()) - return true; - if (!m_bottomRight.width().isZero()) - return true; - return false; + return !m_topLeft.width.isZero() + || !m_topRight.width.isZero() + || !m_bottomLeft.width.isZero() + || !m_bottomRight.width.isZero(); } - unsigned borderLeftWidth() const + float borderLeftWidth() const { if (!m_image.hasImage() && (m_left.style() == BNONE || m_left.style() == BHIDDEN)) return 0; return m_left.width(); } - unsigned borderRightWidth() const + float borderRightWidth() const { if (!m_image.hasImage() && (m_right.style() == BNONE || m_right.style() == BHIDDEN)) return 0; return m_right.width(); } - unsigned borderTopWidth() const + float borderTopWidth() const { if (!m_image.hasImage() && (m_top.style() == BNONE || m_top.style() == BHIDDEN)) return 0; return m_top.width(); } - unsigned borderBottomWidth() const + float borderBottomWidth() const { if (!m_image.hasImage() && (m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN)) return 0; return m_bottom.width(); } + + FloatBoxExtent borderWidth() const + { + return FloatBoxExtent(borderTopWidth(), borderRightWidth(), borderBottomWidth(), borderLeftWidth()); + } bool operator==(const BorderData& o) const { @@ -126,5 +137,3 @@ private: }; } // namespace WebCore - -#endif // BorderData_h |