OLD | NEW |
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 | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
4 * reserved. | 4 * reserved. |
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 if (isDisplayTableType(display())) { | 829 if (isDisplayTableType(display())) { |
830 if (borderCollapse() != other.borderCollapse() || | 830 if (borderCollapse() != other.borderCollapse() || |
831 emptyCells() != other.emptyCells() || | 831 emptyCells() != other.emptyCells() || |
832 captionSide() != other.captionSide() || | 832 captionSide() != other.captionSide() || |
833 m_nonInheritedData.m_tableLayout != | 833 m_nonInheritedData.m_tableLayout != |
834 other.m_nonInheritedData.m_tableLayout) | 834 other.m_nonInheritedData.m_tableLayout) |
835 return true; | 835 return true; |
836 | 836 |
837 // In the collapsing border model, 'hidden' suppresses other borders, while | 837 // In the collapsing border model, 'hidden' suppresses other borders, while |
838 // 'none' does not, so these style differences can be width differences. | 838 // 'none' does not, so these style differences can be width differences. |
839 if ((borderCollapse() == EBorderCollapse::Collapse) && | 839 if ((borderCollapse() == EBorderCollapse::kCollapse) && |
840 ((borderTopStyle() == BorderStyleHidden && | 840 ((borderTopStyle() == BorderStyleHidden && |
841 other.borderTopStyle() == BorderStyleNone) || | 841 other.borderTopStyle() == BorderStyleNone) || |
842 (borderTopStyle() == BorderStyleNone && | 842 (borderTopStyle() == BorderStyleNone && |
843 other.borderTopStyle() == BorderStyleHidden) || | 843 other.borderTopStyle() == BorderStyleHidden) || |
844 (borderBottomStyle() == BorderStyleHidden && | 844 (borderBottomStyle() == BorderStyleHidden && |
845 other.borderBottomStyle() == BorderStyleNone) || | 845 other.borderBottomStyle() == BorderStyleNone) || |
846 (borderBottomStyle() == BorderStyleNone && | 846 (borderBottomStyle() == BorderStyleNone && |
847 other.borderBottomStyle() == BorderStyleHidden) || | 847 other.borderBottomStyle() == BorderStyleHidden) || |
848 (borderLeftStyle() == BorderStyleHidden && | 848 (borderLeftStyle() == BorderStyleHidden && |
849 other.borderLeftStyle() == BorderStyleNone) || | 849 other.borderLeftStyle() == BorderStyleNone) || |
850 (borderLeftStyle() == BorderStyleNone && | 850 (borderLeftStyle() == BorderStyleNone && |
851 other.borderLeftStyle() == BorderStyleHidden) || | 851 other.borderLeftStyle() == BorderStyleHidden) || |
852 (borderRightStyle() == BorderStyleHidden && | 852 (borderRightStyle() == BorderStyleHidden && |
853 other.borderRightStyle() == BorderStyleNone) || | 853 other.borderRightStyle() == BorderStyleNone) || |
854 (borderRightStyle() == BorderStyleNone && | 854 (borderRightStyle() == BorderStyleNone && |
855 other.borderRightStyle() == BorderStyleHidden))) | 855 other.borderRightStyle() == BorderStyleHidden))) |
856 return true; | 856 return true; |
857 } else if (display() == EDisplay::ListItem) { | 857 } else if (display() == EDisplay::ListItem) { |
858 if (listStyleType() != other.listStyleType() || | 858 if (listStyleType() != other.listStyleType() || |
859 listStylePosition() != other.listStylePosition()) | 859 listStylePosition() != other.listStylePosition()) |
860 return true; | 860 return true; |
861 } | 861 } |
862 | 862 |
863 if ((visibility() == EVisibility::Collapse) != | 863 if ((visibility() == EVisibility::kCollapse) != |
864 (other.visibility() == EVisibility::Collapse)) | 864 (other.visibility() == EVisibility::kCollapse)) |
865 return true; | 865 return true; |
866 | 866 |
867 if (hasPseudoStyle(PseudoIdScrollbar) != | 867 if (hasPseudoStyle(PseudoIdScrollbar) != |
868 other.hasPseudoStyle(PseudoIdScrollbar)) | 868 other.hasPseudoStyle(PseudoIdScrollbar)) |
869 return true; | 869 return true; |
870 | 870 |
871 // Movement of non-static-positioned object is special cased in | 871 // Movement of non-static-positioned object is special cased in |
872 // ComputedStyle::visualInvalidationDiff(). | 872 // ComputedStyle::visualInvalidationDiff(). |
873 | 873 |
874 return false; | 874 return false; |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2162 return unvisitedColor; | 2162 return unvisitedColor; |
2163 | 2163 |
2164 // Take the alpha from the unvisited color, but get the RGB values from the | 2164 // Take the alpha from the unvisited color, but get the RGB values from the |
2165 // visited color. | 2165 // visited color. |
2166 return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), | 2166 return Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), |
2167 unvisitedColor.alpha()); | 2167 unvisitedColor.alpha()); |
2168 } | 2168 } |
2169 | 2169 |
2170 const BorderValue& ComputedStyle::borderBefore() const { | 2170 const BorderValue& ComputedStyle::borderBefore() const { |
2171 switch (getWritingMode()) { | 2171 switch (getWritingMode()) { |
2172 case WritingMode::HorizontalTb: | 2172 case WritingMode::kHorizontalTb: |
2173 return borderTop(); | 2173 return borderTop(); |
2174 case WritingMode::VerticalLr: | 2174 case WritingMode::kVerticalLr: |
2175 return borderLeft(); | 2175 return borderLeft(); |
2176 case WritingMode::VerticalRl: | 2176 case WritingMode::kVerticalRl: |
2177 return borderRight(); | 2177 return borderRight(); |
2178 } | 2178 } |
2179 ASSERT_NOT_REACHED(); | 2179 ASSERT_NOT_REACHED(); |
2180 return borderTop(); | 2180 return borderTop(); |
2181 } | 2181 } |
2182 | 2182 |
2183 const BorderValue& ComputedStyle::borderAfter() const { | 2183 const BorderValue& ComputedStyle::borderAfter() const { |
2184 switch (getWritingMode()) { | 2184 switch (getWritingMode()) { |
2185 case WritingMode::HorizontalTb: | 2185 case WritingMode::kHorizontalTb: |
2186 return borderBottom(); | 2186 return borderBottom(); |
2187 case WritingMode::VerticalLr: | 2187 case WritingMode::kVerticalLr: |
2188 return borderRight(); | 2188 return borderRight(); |
2189 case WritingMode::VerticalRl: | 2189 case WritingMode::kVerticalRl: |
2190 return borderLeft(); | 2190 return borderLeft(); |
2191 } | 2191 } |
2192 ASSERT_NOT_REACHED(); | 2192 ASSERT_NOT_REACHED(); |
2193 return borderBottom(); | 2193 return borderBottom(); |
2194 } | 2194 } |
2195 | 2195 |
2196 const BorderValue& ComputedStyle::borderStart() const { | 2196 const BorderValue& ComputedStyle::borderStart() const { |
2197 if (isHorizontalWritingMode()) | 2197 if (isHorizontalWritingMode()) |
2198 return isLeftToRightDirection() ? borderLeft() : borderRight(); | 2198 return isLeftToRightDirection() ? borderLeft() : borderRight(); |
2199 return isLeftToRightDirection() ? borderTop() : borderBottom(); | 2199 return isLeftToRightDirection() ? borderTop() : borderBottom(); |
2200 } | 2200 } |
2201 | 2201 |
2202 const BorderValue& ComputedStyle::borderEnd() const { | 2202 const BorderValue& ComputedStyle::borderEnd() const { |
2203 if (isHorizontalWritingMode()) | 2203 if (isHorizontalWritingMode()) |
2204 return isLeftToRightDirection() ? borderRight() : borderLeft(); | 2204 return isLeftToRightDirection() ? borderRight() : borderLeft(); |
2205 return isLeftToRightDirection() ? borderBottom() : borderTop(); | 2205 return isLeftToRightDirection() ? borderBottom() : borderTop(); |
2206 } | 2206 } |
2207 | 2207 |
2208 int ComputedStyle::borderBeforeWidth() const { | 2208 int ComputedStyle::borderBeforeWidth() const { |
2209 switch (getWritingMode()) { | 2209 switch (getWritingMode()) { |
2210 case WritingMode::HorizontalTb: | 2210 case WritingMode::kHorizontalTb: |
2211 return borderTopWidth(); | 2211 return borderTopWidth(); |
2212 case WritingMode::VerticalLr: | 2212 case WritingMode::kVerticalLr: |
2213 return borderLeftWidth(); | 2213 return borderLeftWidth(); |
2214 case WritingMode::VerticalRl: | 2214 case WritingMode::kVerticalRl: |
2215 return borderRightWidth(); | 2215 return borderRightWidth(); |
2216 } | 2216 } |
2217 ASSERT_NOT_REACHED(); | 2217 ASSERT_NOT_REACHED(); |
2218 return borderTopWidth(); | 2218 return borderTopWidth(); |
2219 } | 2219 } |
2220 | 2220 |
2221 int ComputedStyle::borderAfterWidth() const { | 2221 int ComputedStyle::borderAfterWidth() const { |
2222 switch (getWritingMode()) { | 2222 switch (getWritingMode()) { |
2223 case WritingMode::HorizontalTb: | 2223 case WritingMode::kHorizontalTb: |
2224 return borderBottomWidth(); | 2224 return borderBottomWidth(); |
2225 case WritingMode::VerticalLr: | 2225 case WritingMode::kVerticalLr: |
2226 return borderRightWidth(); | 2226 return borderRightWidth(); |
2227 case WritingMode::VerticalRl: | 2227 case WritingMode::kVerticalRl: |
2228 return borderLeftWidth(); | 2228 return borderLeftWidth(); |
2229 } | 2229 } |
2230 ASSERT_NOT_REACHED(); | 2230 ASSERT_NOT_REACHED(); |
2231 return borderBottomWidth(); | 2231 return borderBottomWidth(); |
2232 } | 2232 } |
2233 | 2233 |
2234 int ComputedStyle::borderStartWidth() const { | 2234 int ComputedStyle::borderStartWidth() const { |
2235 if (isHorizontalWritingMode()) | 2235 if (isHorizontalWritingMode()) |
2236 return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth(); | 2236 return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth(); |
2237 return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth(); | 2237 return isLeftToRightDirection() ? borderTopWidth() : borderBottomWidth(); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2463 if (value < 0) | 2463 if (value < 0) |
2464 fvalue -= 0.5f; | 2464 fvalue -= 0.5f; |
2465 else | 2465 else |
2466 fvalue += 0.5f; | 2466 fvalue += 0.5f; |
2467 } | 2467 } |
2468 | 2468 |
2469 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | 2469 return roundForImpreciseConversion<int>(fvalue / zoomFactor); |
2470 } | 2470 } |
2471 | 2471 |
2472 } // namespace blink | 2472 } // namespace blink |
OLD | NEW |