| 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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 if (node->getNodeType() == TEXT_NODE) | 529 if (node->getNodeType() == TEXT_NODE) |
| 530 node = toText(node)->mergeNextSiblingNodesIfPossible(); | 530 node = toText(node)->mergeNextSiblingNodesIfPossible(); |
| 531 else | 531 else |
| 532 node = NodeTraversal::nextPostOrder(*node); | 532 node = NodeTraversal::nextPostOrder(*node); |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 | 535 |
| 536 bool Node::isContentEditable(UserSelectAllTreatment treatment) const | 536 bool Node::isContentEditable(UserSelectAllTreatment treatment) const |
| 537 { | 537 { |
| 538 document().updateLayoutTree(); | 538 document().updateStyleAndLayoutTree(); |
| 539 return hasEditableStyle(Editable, treatment); | 539 return hasEditableStyle(Editable, treatment); |
| 540 } | 540 } |
| 541 | 541 |
| 542 bool Node::isContentRichlyEditable() const | 542 bool Node::isContentRichlyEditable() const |
| 543 { | 543 { |
| 544 document().updateLayoutTree(); | 544 document().updateStyleAndLayoutTree(); |
| 545 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); | 545 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); |
| 546 } | 546 } |
| 547 | 547 |
| 548 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const | 548 bool Node::hasEditableStyle(EditableLevel editableLevel, UserSelectAllTreatment
treatment) const |
| 549 { | 549 { |
| 550 if (isPseudoElement()) | 550 if (isPseudoElement()) |
| 551 return false; | 551 return false; |
| 552 | 552 |
| 553 // Ideally we'd call DCHECK(!needsStyleRecalc()) here, but | 553 // Ideally we'd call DCHECK(!needsStyleRecalc()) here, but |
| 554 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion | 554 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion |
| (...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2152 MouseEvent* mouseEvent = toMouseEvent(event); | 2152 MouseEvent* mouseEvent = toMouseEvent(event); |
| 2153 if (mouseEvent->button() == MiddleButton) { | 2153 if (mouseEvent->button() == MiddleButton) { |
| 2154 if (enclosingLinkEventParentOrSelf()) | 2154 if (enclosingLinkEventParentOrSelf()) |
| 2155 return; | 2155 return; |
| 2156 | 2156 |
| 2157 // Avoid that canBeScrolledAndHasScrollableArea changes layout tree | 2157 // Avoid that canBeScrolledAndHasScrollableArea changes layout tree |
| 2158 // structure. | 2158 // structure. |
| 2159 // FIXME: We should avoid synchronous layout if possible. We can | 2159 // FIXME: We should avoid synchronous layout if possible. We can |
| 2160 // remove this synchronous layout if we avoid synchronous layout in | 2160 // remove this synchronous layout if we avoid synchronous layout in |
| 2161 // LayoutTextControlSingleLine::scrollHeight | 2161 // LayoutTextControlSingleLine::scrollHeight |
| 2162 document().updateLayoutIgnorePendingStylesheets(); | 2162 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2163 LayoutObject* layoutObject = this->layoutObject(); | 2163 LayoutObject* layoutObject = this->layoutObject(); |
| 2164 while (layoutObject && (!layoutObject->isBox() || !toLayoutBox(layou
tObject)->canBeScrolledAndHasScrollableArea())) | 2164 while (layoutObject && (!layoutObject->isBox() || !toLayoutBox(layou
tObject)->canBeScrolledAndHasScrollableArea())) |
| 2165 layoutObject = layoutObject->parent(); | 2165 layoutObject = layoutObject->parent(); |
| 2166 | 2166 |
| 2167 if (layoutObject) { | 2167 if (layoutObject) { |
| 2168 if (LocalFrame* frame = document().frame()) | 2168 if (LocalFrame* frame = document().frame()) |
| 2169 frame->eventHandler().startPanScrolling(layoutObject); | 2169 frame->eventHandler().startPanScrolling(layoutObject); |
| 2170 } | 2170 } |
| 2171 } | 2171 } |
| 2172 #endif | 2172 #endif |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2414 | 2414 |
| 2415 void showNodePath(const blink::Node* node) | 2415 void showNodePath(const blink::Node* node) |
| 2416 { | 2416 { |
| 2417 if (node) | 2417 if (node) |
| 2418 node->showNodePathForThis(); | 2418 node->showNodePathForThis(); |
| 2419 else | 2419 else |
| 2420 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2420 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
| 2421 } | 2421 } |
| 2422 | 2422 |
| 2423 #endif | 2423 #endif |
| OLD | NEW |