summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/style/BorderData.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/style/BorderData.h')
-rw-r--r--Source/WebCore/rendering/style/BorderData.h51
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