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

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

Issue 1177673005: Implement ShadowRoot.delegatesFocus 4/4 (match CSS :focus for shadow host) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: split a layout test into 5 tests. Created 5 years, 6 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-2011, 2014 Apple Inc. All rights reserved. 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved.
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); } 353 virtual void startLoadingDynamicSheet() { ASSERT_NOT_REACHED(); }
354 354
355 bool hasName() const { ASSERT(!isTextNode()); return getFlag(HasNameOrIsEdit ingTextFlag); } 355 bool hasName() const { ASSERT(!isTextNode()); return getFlag(HasNameOrIsEdit ingTextFlag); }
356 356
357 bool isUserActionElement() const { return getFlag(IsUserActionElementFlag); } 357 bool isUserActionElement() const { return getFlag(IsUserActionElementFlag); }
358 void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElementFlag ); } 358 void setUserActionElement(bool flag) { setFlag(flag, IsUserActionElementFlag ); }
359 359
360 bool active() const { return isUserActionElement() && isUserActionElementAct ive(); } 360 bool active() const { return isUserActionElement() && isUserActionElementAct ive(); }
361 bool inActiveChain() const { return isUserActionElement() && isUserActionEle mentInActiveChain(); } 361 bool inActiveChain() const { return isUserActionElement() && isUserActionEle mentInActiveChain(); }
362 bool hovered() const { return isUserActionElement() && isUserActionElementHo vered(); } 362 bool hovered() const { return isUserActionElement() && isUserActionElementHo vered(); }
363 // Note: As a shadow host whose root with delegatesFocus=false may become fo cused state when
364 // an inner element gets focused, in that case more than one elements in a d ocument can return
365 // true for |focused()|. Use Element::isFocusedElementInDocument() or Docum ent::focusedElement()
366 // to check which element is exactly focused.
363 bool focused() const { return isUserActionElement() && isUserActionElementFo cused(); } 367 bool focused() const { return isUserActionElement() && isUserActionElementFo cused(); }
364 368
365 bool needsAttach() const { return styleChangeType() == NeedsReattachStyleCha nge; } 369 bool needsAttach() const { return styleChangeType() == NeedsReattachStyleCha nge; }
366 bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; } 370 bool needsStyleRecalc() const { return styleChangeType() != NoStyleChange; }
367 StyleChangeType styleChangeType() const { return static_cast<StyleChangeType >(m_nodeFlags & StyleChangeMask); } 371 StyleChangeType styleChangeType() const { return static_cast<StyleChangeType >(m_nodeFlags & StyleChangeMask); }
368 bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFla g); } 372 bool childNeedsStyleRecalc() const { return getFlag(ChildNeedsStyleRecalcFla g); }
369 bool isLink() const { return getFlag(IsLinkFlag); } 373 bool isLink() const { return getFlag(IsLinkFlag); }
370 bool isEditingText() const { ASSERT(isTextNode()); return getFlag(HasNameOrI sEditingTextFlag); } 374 bool isEditingText() const { ASSERT(isTextNode()); return getFlag(HasNameOrI sEditingTextFlag); }
371 375
372 void setHasName(bool f) { ASSERT(!isTextNode()); setFlag(f, HasNameOrIsEditi ngTextFlag); } 376 void setHasName(bool f) { ASSERT(!isTextNode()); setFlag(f, HasNameOrIsEditi ngTextFlag); }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 } // namespace blink 919 } // namespace blink
916 920
917 #ifndef NDEBUG 921 #ifndef NDEBUG
918 // Outside the WebCore namespace for ease of invocation from gdb. 922 // Outside the WebCore namespace for ease of invocation from gdb.
919 void showNode(const blink::Node*); 923 void showNode(const blink::Node*);
920 void showTree(const blink::Node*); 924 void showTree(const blink::Node*);
921 void showNodePath(const blink::Node*); 925 void showNodePath(const blink::Node*);
922 #endif 926 #endif
923 927
924 #endif // Node_h 928 #endif // Node_h
OLDNEW
« Source/core/dom/ContainerNode.cpp ('K') | « Source/core/dom/ContainerNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698