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

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

Issue 2200653002: Apply styles to mathML elements having class attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11 matching lines...) Expand all
22 * Boston, MA 02110-1301, USA. 22 * Boston, MA 02110-1301, USA.
23 */ 23 */
24 24
25 #include "core/dom/Node.h" 25 #include "core/dom/Node.h"
26 26
27 #include "bindings/core/v8/DOMDataStore.h" 27 #include "bindings/core/v8/DOMDataStore.h"
28 #include "bindings/core/v8/ExceptionState.h" 28 #include "bindings/core/v8/ExceptionState.h"
29 #include "bindings/core/v8/Microtask.h" 29 #include "bindings/core/v8/Microtask.h"
30 #include "bindings/core/v8/V8DOMWrapper.h" 30 #include "bindings/core/v8/V8DOMWrapper.h"
31 #include "core/HTMLNames.h" 31 #include "core/HTMLNames.h"
32 #include "core/MathMLNames.h"
32 #include "core/css/CSSSelector.h" 33 #include "core/css/CSSSelector.h"
33 #include "core/css/resolver/StyleResolver.h" 34 #include "core/css/resolver/StyleResolver.h"
34 #include "core/dom/AXObjectCache.h" 35 #include "core/dom/AXObjectCache.h"
35 #include "core/dom/Attr.h" 36 #include "core/dom/Attr.h"
36 #include "core/dom/Attribute.h" 37 #include "core/dom/Attribute.h"
37 #include "core/dom/ChildListMutationScope.h" 38 #include "core/dom/ChildListMutationScope.h"
38 #include "core/dom/ChildNodeList.h" 39 #include "core/dom/ChildNodeList.h"
39 #include "core/dom/DOMNodeIds.h" 40 #include "core/dom/DOMNodeIds.h"
40 #include "core/dom/Document.h" 41 #include "core/dom/Document.h"
41 #include "core/dom/DocumentFragment.h" 42 #include "core/dom/DocumentFragment.h"
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 const ComputedStyle& style = layoutObject()->styleRef(); 1023 const ComputedStyle& style = layoutObject()->styleRef();
1023 // We allow selections to begin within an element that has -webkit-user- select: none set, 1024 // We allow selections to begin within an element that has -webkit-user- select: none set,
1024 // but if the element is draggable then dragging should take priority ov er selection. 1025 // but if the element is draggable then dragging should take priority ov er selection.
1025 if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NON E) 1026 if (style.userDrag() == DRAG_ELEMENT && style.userSelect() == SELECT_NON E)
1026 return false; 1027 return false;
1027 } 1028 }
1028 ContainerNode* parent = FlatTreeTraversal::parent(*this); 1029 ContainerNode* parent = FlatTreeTraversal::parent(*this);
1029 return parent ? parent->canStartSelection() : true; 1030 return parent ? parent->canStartSelection() : true;
1030 } 1031 }
1031 1032
1033 // StyledElements allow inline style (style="border: 1px"), presentational attri butes (ex. color),
1034 // class names (ex. class="foo bar") and other non-basic styling features. They and also control
PhistucK 2016/08/02 15:40:47 s/They and also/Then also/
ramya.v 2016/08/03 04:03:48 Done.
1035 // if this element can participate in style sharing.
1036 //
1037 // FIXME: The only things that ever go through StyleResolver that aren't StyledE lements are
1038 // PseudoElements and VTTElements. It's possible we can just eliminate all the c hecks
1039 // since those elements will never have class names, inline style, or other thin gs that
1040 // this apparently guards against.
1041 bool Node::isStyledElement() const
1042 {
1043 return isHTMLElement() || isSVGElement() || (isElementNode() && toElement(th is)->namespaceURI() == MathMLNames::mathmlNamespaceURI);
1044 }
1045
1032 bool Node::canParticipateInFlatTree() const 1046 bool Node::canParticipateInFlatTree() const
1033 { 1047 {
1034 return !isShadowRoot() && !isSlotOrActiveInsertionPoint(); 1048 return !isShadowRoot() && !isSlotOrActiveInsertionPoint();
1035 } 1049 }
1036 1050
1037 bool Node::isSlotOrActiveInsertionPoint() const 1051 bool Node::isSlotOrActiveInsertionPoint() const
1038 { 1052 {
1039 return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this); 1053 return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this);
1040 } 1054 }
1041 1055
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
2538 2552
2539 void showNodePath(const blink::Node* node) 2553 void showNodePath(const blink::Node* node)
2540 { 2554 {
2541 if (node) 2555 if (node)
2542 node->showNodePathForThis(); 2556 node->showNodePathForThis();
2543 else 2557 else
2544 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2558 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2545 } 2559 }
2546 2560
2547 #endif 2561 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698