OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. | 2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc. |
3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 { | 740 { |
741 if (selection.isNone()) | 741 if (selection.isNone()) |
742 return FalseTriState; | 742 return FalseTriState; |
743 | 743 |
744 if (selection.isCaret()) | 744 if (selection.isCaret()) |
745 return triStateOfStyle(EditingStyle::styleAtSelectionStart(selection)); | 745 return triStateOfStyle(EditingStyle::styleAtSelectionStart(selection)); |
746 | 746 |
747 TriState state = FalseTriState; | 747 TriState state = FalseTriState; |
748 bool nodeIsStart = true; | 748 bool nodeIsStart = true; |
749 for (Node& node : NodeTraversal::startsAt(*selection.start().anchorNode()))
{ | 749 for (Node& node : NodeTraversal::startsAt(*selection.start().anchorNode()))
{ |
750 if (node.layoutObject() && node.hasEditableStyle()) { | 750 if (node.layoutObject() && hasEditableStyle(node)) { |
751 CSSComputedStyleDeclaration* nodeStyle = CSSComputedStyleDeclaration
::create(&node); | 751 CSSComputedStyleDeclaration* nodeStyle = CSSComputedStyleDeclaration
::create(&node); |
752 if (nodeStyle) { | 752 if (nodeStyle) { |
753 // If the selected element has <sub> or <sup> ancestor element,
apply the corresponding | 753 // If the selected element has <sub> or <sup> ancestor element,
apply the corresponding |
754 // style(vertical-align) to it so that document.queryCommandStat
e() works with the style. | 754 // style(vertical-align) to it so that document.queryCommandStat
e() works with the style. |
755 // See bug http://crbug.com/582225. | 755 // See bug http://crbug.com/582225. |
756 if (m_isVerticalAlign && getIdentifierValue(nodeStyle, CSSProper
tyVerticalAlign) == CSSValueBaseline) { | 756 if (m_isVerticalAlign && getIdentifierValue(nodeStyle, CSSProper
tyVerticalAlign) == CSSValueBaseline) { |
757 const CSSPrimitiveValue* verticalAlign = toCSSPrimitiveValue
(m_mutableStyle->getPropertyCSSValue(CSSPropertyVerticalAlign)); | 757 const CSSPrimitiveValue* verticalAlign = toCSSPrimitiveValue
(m_mutableStyle->getPropertyCSSValue(CSSPropertyVerticalAlign)); |
758 if (hasAncestorVerticalAlignStyle(node, verticalAlign->getVa
lueID())) | 758 if (hasAncestorVerticalAlignStyle(node, verticalAlign->getVa
lueID())) |
759 node.mutableComputedStyle()->setVerticalAlign(verticalAl
ign->convertTo<EVerticalAlign>()); | 759 node.mutableComputedStyle()->setVerticalAlign(verticalAl
ign->convertTo<EVerticalAlign>()); |
760 } | 760 } |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 { | 1757 { |
1758 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { | 1758 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { |
1759 CSSComputedStyleDeclaration* ancestorStyle = CSSComputedStyleDeclaration
::create(ancestor); | 1759 CSSComputedStyleDeclaration* ancestorStyle = CSSComputedStyleDeclaration
::create(ancestor); |
1760 if (!hasTransparentBackgroundColor(ancestorStyle)) | 1760 if (!hasTransparentBackgroundColor(ancestorStyle)) |
1761 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); | 1761 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor
); |
1762 } | 1762 } |
1763 return nullptr; | 1763 return nullptr; |
1764 } | 1764 } |
1765 | 1765 |
1766 } // namespace blink | 1766 } // namespace blink |
OLD | NEW |