Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: Source/core/dom/Node.cpp

Issue 22751005: Convert USERSELECT_ALL to a runtime enabled feature. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add rebaselines Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 { 645 {
646 if (isPseudoElement()) 646 if (isPseudoElement())
647 return false; 647 return false;
648 648
649 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but 649 // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but
650 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion 650 // ContainerNode::setFocus() calls setNeedsStyleRecalc(), so the assertion
651 // would fire in the middle of Document::setFocusedNode(). 651 // would fire in the middle of Document::setFocusedNode().
652 652
653 for (const Node* node = this; node; node = node->parentNode()) { 653 for (const Node* node = this; node; node = node->parentNode()) {
654 if ((node->isHTMLElement() || node->isDocumentNode()) && node->renderer( )) { 654 if ((node->isHTMLElement() || node->isDocumentNode()) && node->renderer( )) {
655 #if ENABLE(USERSELECT_ALL)
656 // Elements with user-select: all style are considered atomic 655 // Elements with user-select: all style are considered atomic
657 // therefore non editable. 656 // therefore non editable.
658 if (node->renderer()->style()->userSelect() == SELECT_ALL && treatme nt == UserSelectAllIsAlwaysNonEditable) 657 if (RuntimeEnabledFeatures::userSelectAllEnabled() && node->renderer ()->style()->userSelect() == SELECT_ALL && treatment == UserSelectAllIsAlwaysNon Editable)
adamk 2013/08/09 21:42:32 Rather than sprinkling these RuntimeEnabledFeature
ojan 2013/08/09 22:10:10 This code doesn't add a new css value, it changes
659 return false; 658 return false;
660 #else
661 UNUSED_PARAM(treatment);
662 #endif
663 switch (node->renderer()->style()->userModify()) { 659 switch (node->renderer()->style()->userModify()) {
664 case READ_ONLY: 660 case READ_ONLY:
665 return false; 661 return false;
666 case READ_WRITE: 662 case READ_WRITE:
667 return true; 663 return true;
668 case READ_WRITE_PLAINTEXT_ONLY: 664 case READ_WRITE_PLAINTEXT_ONLY:
669 return editableLevel != RichlyEditable; 665 return editableLevel != RichlyEditable;
670 } 666 }
671 ASSERT_NOT_REACHED(); 667 ASSERT_NOT_REACHED();
672 return false; 668 return false;
(...skipping 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after
2742 node->showTreeForThis(); 2738 node->showTreeForThis();
2743 } 2739 }
2744 2740
2745 void showNodePath(const WebCore::Node* node) 2741 void showNodePath(const WebCore::Node* node)
2746 { 2742 {
2747 if (node) 2743 if (node)
2748 node->showNodePathForThis(); 2744 node->showNodePathForThis();
2749 } 2745 }
2750 2746
2751 #endif 2747 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698