| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 2026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2037 s_affectsParentBlock = false; | 2037 s_affectsParentBlock = false; |
| 2038 } | 2038 } |
| 2039 | 2039 |
| 2040 // Elements with non-auto touch-action will send a SetTouchAction message | 2040 // Elements with non-auto touch-action will send a SetTouchAction message |
| 2041 // on touchstart in EventHandler::handleTouchEvent, and so effectively have | 2041 // on touchstart in EventHandler::handleTouchEvent, and so effectively have |
| 2042 // a touchstart handler that must be reported. | 2042 // a touchstart handler that must be reported. |
| 2043 // | 2043 // |
| 2044 // Since a CSS property cannot be applied directly to a text node, a | 2044 // Since a CSS property cannot be applied directly to a text node, a |
| 2045 // handler will have already been added for its parent so ignore it. | 2045 // handler will have already been added for its parent so ignore it. |
| 2046 // TODO: Remove this blocking event handler; crbug.com/318381 | 2046 // TODO: Remove this blocking event handler; crbug.com/318381 |
| 2047 TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionA
uto; | 2047 TouchAction oldTouchAction = m_style ? m_style->getTouchAction() : TouchActi
onAuto; |
| 2048 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.touchAction() == TouchActionAuto)) { | 2048 if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) !
= (newStyle.getTouchAction() == TouchActionAuto)) { |
| 2049 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); | 2049 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); |
| 2050 if (newStyle.touchAction() != TouchActionAuto) | 2050 if (newStyle.getTouchAction() != TouchActionAuto) |
| 2051 registry.didAddEventHandler(*node(), EventHandlerRegistry::TouchEven
tBlocking); | 2051 registry.didAddEventHandler(*node(), EventHandlerRegistry::TouchEven
tBlocking); |
| 2052 else | 2052 else |
| 2053 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
ventBlocking); | 2053 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
ventBlocking); |
| 2054 } | 2054 } |
| 2055 } | 2055 } |
| 2056 | 2056 |
| 2057 static bool areNonIdenticalCursorListsEqual(const ComputedStyle* a, const Comput
edStyle* b) | 2057 static bool areNonIdenticalCursorListsEqual(const ComputedStyle* a, const Comput
edStyle* b) |
| 2058 { | 2058 { |
| 2059 ASSERT(a->cursors() != b->cursors()); | 2059 ASSERT(a->cursors() != b->cursors()); |
| 2060 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); | 2060 return a->cursors() && b->cursors() && *a->cursors() == *b->cursors(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 | 2129 |
| 2130 updateAnonymousChildStyle(*child, *newStyle); | 2130 updateAnonymousChildStyle(*child, *newStyle); |
| 2131 | 2131 |
| 2132 child->setStyle(newStyle.release()); | 2132 child->setStyle(newStyle.release()); |
| 2133 } | 2133 } |
| 2134 } | 2134 } |
| 2135 | 2135 |
| 2136 void LayoutObject::setStyleWithWritingModeOfParent(PassRefPtr<ComputedStyle> sty
le) | 2136 void LayoutObject::setStyleWithWritingModeOfParent(PassRefPtr<ComputedStyle> sty
le) |
| 2137 { | 2137 { |
| 2138 if (parent()) | 2138 if (parent()) |
| 2139 style->setWritingMode(parent()->styleRef().writingMode()); | 2139 style->setWritingMode(parent()->styleRef().getWritingMode()); |
| 2140 setStyle(style); | 2140 setStyle(style); |
| 2141 } | 2141 } |
| 2142 | 2142 |
| 2143 void LayoutObject::addChildWithWritingModeOfParent(LayoutObject* newChild, Layou
tObject* beforeChild) | 2143 void LayoutObject::addChildWithWritingModeOfParent(LayoutObject* newChild, Layou
tObject* beforeChild) |
| 2144 { | 2144 { |
| 2145 if (newChild->mutableStyleRef().setWritingMode(styleRef().writingMode()) | 2145 if (newChild->mutableStyleRef().setWritingMode(styleRef().getWritingMode()) |
| 2146 && newChild->isBoxModelObject()) { | 2146 && newChild->isBoxModelObject()) { |
| 2147 newChild->setHorizontalWritingMode(isHorizontalWritingMode()); | 2147 newChild->setHorizontalWritingMode(isHorizontalWritingMode()); |
| 2148 } | 2148 } |
| 2149 addChild(newChild, beforeChild); | 2149 addChild(newChild, beforeChild); |
| 2150 } | 2150 } |
| 2151 | 2151 |
| 2152 void LayoutObject::updateFillImages(const FillLayer* oldLayers, const FillLayer&
newLayers) | 2152 void LayoutObject::updateFillImages(const FillLayer* oldLayers, const FillLayer&
newLayers) |
| 2153 { | 2153 { |
| 2154 // Optimize the common case | 2154 // Optimize the common case |
| 2155 if (FillLayer::imagesIdentical(oldLayers, &newLayers)) | 2155 if (FillLayer::imagesIdentical(oldLayers, &newLayers)) |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2658 // reevaluation. This apparently redundant check is here for the case when | 2658 // reevaluation. This apparently redundant check is here for the case when |
| 2659 // this layoutObject had no parent at the time remove() was called. | 2659 // this layoutObject had no parent at the time remove() was called. |
| 2660 | 2660 |
| 2661 if (hasCounterNodeMap()) | 2661 if (hasCounterNodeMap()) |
| 2662 LayoutCounter::destroyCounterNodes(*this); | 2662 LayoutCounter::destroyCounterNodes(*this); |
| 2663 | 2663 |
| 2664 // Remove the handler if node had touch-action set. Handlers are not added | 2664 // Remove the handler if node had touch-action set. Handlers are not added |
| 2665 // for text nodes so don't try removing for one too. Need to check if | 2665 // for text nodes so don't try removing for one too. Need to check if |
| 2666 // m_style is null in cases of partial construction. Any handler we added | 2666 // m_style is null in cases of partial construction. Any handler we added |
| 2667 // previously may have already been removed by the Document independently. | 2667 // previously may have already been removed by the Document independently. |
| 2668 if (node() && !node()->isTextNode() && m_style && m_style->touchAction() !=
TouchActionAuto) { | 2668 if (node() && !node()->isTextNode() && m_style && m_style->getTouchAction()
!= TouchActionAuto) { |
| 2669 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); | 2669 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); |
| 2670 if (registry.eventHandlerTargets(EventHandlerRegistry::TouchEventBlockin
g)->contains(node())) | 2670 if (registry.eventHandlerTargets(EventHandlerRegistry::TouchEventBlockin
g)->contains(node())) |
| 2671 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
ventBlocking); | 2671 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
ventBlocking); |
| 2672 } | 2672 } |
| 2673 | 2673 |
| 2674 setAncestorLineBoxDirty(false); | 2674 setAncestorLineBoxDirty(false); |
| 2675 | 2675 |
| 2676 if (selectionPaintInvalidationMap) | 2676 if (selectionPaintInvalidationMap) |
| 2677 selectionPaintInvalidationMap->remove(this); | 2677 selectionPaintInvalidationMap->remove(this); |
| 2678 | 2678 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3107 | 3107 |
| 3108 void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) | 3108 void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) |
| 3109 { | 3109 { |
| 3110 LayoutObject* curr = this; | 3110 LayoutObject* curr = this; |
| 3111 const ComputedStyle* styleToUse = nullptr; | 3111 const ComputedStyle* styleToUse = nullptr; |
| 3112 unsigned currDecs = TextDecorationNone; | 3112 unsigned currDecs = TextDecorationNone; |
| 3113 Color resultColor; | 3113 Color resultColor; |
| 3114 TextDecorationStyle resultStyle; | 3114 TextDecorationStyle resultStyle; |
| 3115 do { | 3115 do { |
| 3116 styleToUse = curr->style(firstlineStyle); | 3116 styleToUse = curr->style(firstlineStyle); |
| 3117 currDecs = styleToUse->textDecoration(); | 3117 currDecs = styleToUse->getTextDecoration(); |
| 3118 currDecs &= decorations; | 3118 currDecs &= decorations; |
| 3119 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio
nColor); | 3119 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio
nColor); |
| 3120 resultStyle = styleToUse->textDecorationStyle(); | 3120 resultStyle = styleToUse->getTextDecorationStyle(); |
| 3121 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. | 3121 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. |
| 3122 if (currDecs) { | 3122 if (currDecs) { |
| 3123 if (currDecs & TextDecorationUnderline) { | 3123 if (currDecs & TextDecorationUnderline) { |
| 3124 decorations &= ~TextDecorationUnderline; | 3124 decorations &= ~TextDecorationUnderline; |
| 3125 underline.color = resultColor; | 3125 underline.color = resultColor; |
| 3126 underline.style = resultStyle; | 3126 underline.style = resultStyle; |
| 3127 } | 3127 } |
| 3128 if (currDecs & TextDecorationOverline) { | 3128 if (currDecs & TextDecorationOverline) { |
| 3129 decorations &= ~TextDecorationOverline; | 3129 decorations &= ~TextDecorationOverline; |
| 3130 overline.color = resultColor; | 3130 overline.color = resultColor; |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3712 const blink::LayoutObject* root = object1; | 3712 const blink::LayoutObject* root = object1; |
| 3713 while (root->parent()) | 3713 while (root->parent()) |
| 3714 root = root->parent(); | 3714 root = root->parent(); |
| 3715 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3715 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3716 } else { | 3716 } else { |
| 3717 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3717 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3718 } | 3718 } |
| 3719 } | 3719 } |
| 3720 | 3720 |
| 3721 #endif | 3721 #endif |
| OLD | NEW |