Advertisement
Guest User

Untitled

a guest
May 4th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.84 KB | None | 0 0
  1. diff --git a/third_party/WebKit/Source/core/style/BorderData.h b/third_party/WebKit/Source/core/style/BorderData.h
  2. index eedc12a..df26db3 100644
  3. --- a/third_party/WebKit/Source/core/style/BorderData.h
  4. +++ b/third_party/WebKit/Source/core/style/BorderData.h
  5. @@ -46,7 +46,8 @@ public:
  6.  
  7. bool hasBorder() const
  8. {
  9. - return m_left.nonZero() || m_right.nonZero() || m_top.nonZero() || m_bottom.nonZero();
  10. + bool haveImage = m_image.hasImage();
  11. + return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage);
  12. }
  13.  
  14. bool hasBorderFill() const
  15. @@ -69,28 +70,28 @@ public:
  16.  
  17. int borderLeftWidth() const
  18. {
  19. - if (m_left.style() == BorderStyleNone || m_left.style() == BorderStyleHidden)
  20. + if (!m_image.hasImage() && (m_left.style() == BorderStyleNone || m_left.style() == BorderStyleHidden))
  21. return 0;
  22. return m_left.width();
  23. }
  24.  
  25. int borderRightWidth() const
  26. {
  27. - if (m_right.style() == BorderStyleNone || m_right.style() == BorderStyleHidden)
  28. + if (!m_image.hasImage() && (m_right.style() == BorderStyleNone || m_right.style() == BorderStyleHidden))
  29. return 0;
  30. return m_right.width();
  31. }
  32.  
  33. int borderTopWidth() const
  34. {
  35. - if (m_top.style() == BorderStyleNone || m_top.style() == BorderStyleHidden)
  36. + if (!m_image.hasImage() && (m_top.style() == BorderStyleNone || m_top.style() == BorderStyleHidden))
  37. return 0;
  38. return m_top.width();
  39. }
  40.  
  41. int borderBottomWidth() const
  42. {
  43. - if (m_bottom.style() == BorderStyleNone || m_bottom.style() == BorderStyleHidden)
  44. + if (!m_image.hasImage() && (m_bottom.style() == BorderStyleNone || m_bottom.style() == BorderStyleHidden))
  45. return 0;
  46. return m_bottom.width();
  47. }
  48. diff --git a/third_party/WebKit/Source/core/style/BorderValue.h b/third_party/WebKit/Source/core/style/BorderValue.h
  49. index 78ea456..7914be9 100644
  50. --- a/third_party/WebKit/Source/core/style/BorderValue.h
  51. +++ b/third_party/WebKit/Source/core/style/BorderValue.h
  52. @@ -45,9 +45,9 @@ public:
  53. {
  54. }
  55.  
  56. - bool nonZero() const
  57. + bool nonZero(bool checkStyle = true) const
  58. {
  59. - return width() && (m_style != BorderStyleNone);
  60. + return width() && (!checkStyle || m_style != BorderStyleNone);
  61. }
  62.  
  63. bool isTransparent() const
  64. @@ -55,6 +55,11 @@ public:
  65. return !m_colorIsCurrentColor && !m_color.alpha();
  66. }
  67.  
  68. + bool isVisible(bool checkStyle = true) const
  69. + {
  70. + return nonZero(checkStyle) && !isTransparent() && (!checkStyle || m_style != BorderStyleHidden);
  71. + }
  72. +
  73. bool operator==(const BorderValue& o) const
  74. {
  75. 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