Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/third_party/WebKit/Source/core/style/BorderData.h b/third_party/WebKit/Source/core/style/BorderData.h
- index eedc12a..df26db3 100644
- --- a/third_party/WebKit/Source/core/style/BorderData.h
- +++ b/third_party/WebKit/Source/core/style/BorderData.h
- @@ -46,7 +46,8 @@ public:
- bool hasBorder() const
- {
- - return m_left.nonZero() || m_right.nonZero() || m_top.nonZero() || m_bottom.nonZero();
- + bool haveImage = m_image.hasImage();
- + return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage);
- }
- bool hasBorderFill() const
- @@ -69,28 +70,28 @@ public:
- int borderLeftWidth() const
- {
- - if (m_left.style() == BorderStyleNone || m_left.style() == BorderStyleHidden)
- + if (!m_image.hasImage() && (m_left.style() == BorderStyleNone || m_left.style() == BorderStyleHidden))
- return 0;
- return m_left.width();
- }
- int borderRightWidth() const
- {
- - if (m_right.style() == BorderStyleNone || m_right.style() == BorderStyleHidden)
- + if (!m_image.hasImage() && (m_right.style() == BorderStyleNone || m_right.style() == BorderStyleHidden))
- return 0;
- return m_right.width();
- }
- int borderTopWidth() const
- {
- - if (m_top.style() == BorderStyleNone || m_top.style() == BorderStyleHidden)
- + if (!m_image.hasImage() && (m_top.style() == BorderStyleNone || m_top.style() == BorderStyleHidden))
- return 0;
- return m_top.width();
- }
- int borderBottomWidth() const
- {
- - if (m_bottom.style() == BorderStyleNone || m_bottom.style() == BorderStyleHidden)
- + if (!m_image.hasImage() && (m_bottom.style() == BorderStyleNone || m_bottom.style() == BorderStyleHidden))
- return 0;
- return m_bottom.width();
- }
- diff --git a/third_party/WebKit/Source/core/style/BorderValue.h b/third_party/WebKit/Source/core/style/BorderValue.h
- index 78ea456..7914be9 100644
- --- a/third_party/WebKit/Source/core/style/BorderValue.h
- +++ b/third_party/WebKit/Source/core/style/BorderValue.h
- @@ -45,9 +45,9 @@ public:
- {
- }
- - bool nonZero() const
- + bool nonZero(bool checkStyle = true) const
- {
- - return width() && (m_style != BorderStyleNone);
- + return width() && (!checkStyle || m_style != BorderStyleNone);
- }
- bool isTransparent() const
- @@ -55,6 +55,11 @@ public:
- return !m_colorIsCurrentColor && !m_color.alpha();
- }
- + bool isVisible(bool checkStyle = true) const
- + {
- + return nonZero(checkStyle) && !isTransparent() && (!checkStyle || m_style != BorderStyleHidden);
- + }
- +
- bool operator==(const BorderValue& o) const
- {
- return m_width == o.m_width && m_style == o.m_style && m_color == o.m_color && m_colorIsCurrentColor == o.m_colorIsCurrentColor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement