| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2612 // reevaluation. This apparently redundant check is here for the case when | 2612 // reevaluation. This apparently redundant check is here for the case when |
| 2613 // this layoutObject had no parent at the time remove() was called. | 2613 // this layoutObject had no parent at the time remove() was called. |
| 2614 | 2614 |
| 2615 if (hasCounterNodeMap()) | 2615 if (hasCounterNodeMap()) |
| 2616 LayoutCounter::destroyCounterNodes(*this); | 2616 LayoutCounter::destroyCounterNodes(*this); |
| 2617 | 2617 |
| 2618 // Remove the handler if node had touch-action set. Handlers are not added | 2618 // Remove the handler if node had touch-action set. Handlers are not added |
| 2619 // for text nodes so don't try removing for one too. Need to check if | 2619 // for text nodes so don't try removing for one too. Need to check if |
| 2620 // m_style is null in cases of partial construction. Any handler we added | 2620 // m_style is null in cases of partial construction. Any handler we added |
| 2621 // previously may have already been removed by the Document independently. | 2621 // previously may have already been removed by the Document independently. |
| 2622 if (node() && !node()->isTextNode() && m_style && m_style->touchAction() !=
TouchActionAuto) { | 2622 if (node() && !node()->isTextNode() && m_style && m_style->getTouchAction()
!= TouchActionAuto) { |
| 2623 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); | 2623 EventHandlerRegistry& registry = document().frameHost()->eventHandlerReg
istry(); |
| 2624 if (registry.eventHandlerTargets(EventHandlerRegistry::TouchEventBlockin
g)->contains(node())) | 2624 if (registry.eventHandlerTargets(EventHandlerRegistry::TouchEventBlockin
g)->contains(node())) |
| 2625 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
ventBlocking); | 2625 registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchE
ventBlocking); |
| 2626 } | 2626 } |
| 2627 | 2627 |
| 2628 setAncestorLineBoxDirty(false); | 2628 setAncestorLineBoxDirty(false); |
| 2629 | 2629 |
| 2630 if (selectionPaintInvalidationMap) | 2630 if (selectionPaintInvalidationMap) |
| 2631 selectionPaintInvalidationMap->remove(this); | 2631 selectionPaintInvalidationMap->remove(this); |
| 2632 | 2632 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3061 | 3061 |
| 3062 void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) | 3062 void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) |
| 3063 { | 3063 { |
| 3064 LayoutObject* curr = this; | 3064 LayoutObject* curr = this; |
| 3065 const ComputedStyle* styleToUse = nullptr; | 3065 const ComputedStyle* styleToUse = nullptr; |
| 3066 unsigned currDecs = TextDecorationNone; | 3066 unsigned currDecs = TextDecorationNone; |
| 3067 Color resultColor; | 3067 Color resultColor; |
| 3068 TextDecorationStyle resultStyle; | 3068 TextDecorationStyle resultStyle; |
| 3069 do { | 3069 do { |
| 3070 styleToUse = curr->style(firstlineStyle); | 3070 styleToUse = curr->style(firstlineStyle); |
| 3071 currDecs = styleToUse->textDecoration(); | 3071 currDecs = styleToUse->getTextDecoration(); |
| 3072 currDecs &= decorations; | 3072 currDecs &= decorations; |
| 3073 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio
nColor); | 3073 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio
nColor); |
| 3074 resultStyle = styleToUse->textDecorationStyle(); | 3074 resultStyle = styleToUse->getTextDecorationStyle(); |
| 3075 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. | 3075 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. |
| 3076 if (currDecs) { | 3076 if (currDecs) { |
| 3077 if (currDecs & TextDecorationUnderline) { | 3077 if (currDecs & TextDecorationUnderline) { |
| 3078 decorations &= ~TextDecorationUnderline; | 3078 decorations &= ~TextDecorationUnderline; |
| 3079 underline.color = resultColor; | 3079 underline.color = resultColor; |
| 3080 underline.style = resultStyle; | 3080 underline.style = resultStyle; |
| 3081 } | 3081 } |
| 3082 if (currDecs & TextDecorationOverline) { | 3082 if (currDecs & TextDecorationOverline) { |
| 3083 decorations &= ~TextDecorationOverline; | 3083 decorations &= ~TextDecorationOverline; |
| 3084 overline.color = resultColor; | 3084 overline.color = resultColor; |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3666 const blink::LayoutObject* root = object1; | 3666 const blink::LayoutObject* root = object1; |
| 3667 while (root->parent()) | 3667 while (root->parent()) |
| 3668 root = root->parent(); | 3668 root = root->parent(); |
| 3669 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3669 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3670 } else { | 3670 } else { |
| 3671 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3671 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3672 } | 3672 } |
| 3673 } | 3673 } |
| 3674 | 3674 |
| 3675 #endif | 3675 #endif |
| OLD | NEW |