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-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. | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
7 * (http://www.torchmobile.com/) | 7 * (http://www.torchmobile.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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 return IsUserActionElement() && IsUserActionElementHovered(); | 384 return IsUserActionElement() && IsUserActionElementHovered(); |
385 } | 385 } |
386 // Note: As a shadow host whose root with delegatesFocus=false may become | 386 // Note: As a shadow host whose root with delegatesFocus=false may become |
387 // focused state when an inner element gets focused, in that case more than | 387 // focused state when an inner element gets focused, in that case more than |
388 // one elements in a document can return true for |isFocused()|. Use | 388 // one elements in a document can return true for |isFocused()|. Use |
389 // Element::isFocusedElementInDocument() or Document::focusedElement() to | 389 // Element::isFocusedElementInDocument() or Document::focusedElement() to |
390 // check which element is exactly focused. | 390 // check which element is exactly focused. |
391 bool IsFocused() const { | 391 bool IsFocused() const { |
392 return IsUserActionElement() && IsUserActionElementFocused(); | 392 return IsUserActionElement() && IsUserActionElementFocused(); |
393 } | 393 } |
| 394 bool HasFocusWithin() const { |
| 395 return IsUserActionElement() && IsUserActionElementHasFocusWithin(); |
| 396 } |
394 | 397 |
395 bool NeedsAttach() const { | 398 bool NeedsAttach() const { |
396 return GetStyleChangeType() == kNeedsReattachStyleChange; | 399 return GetStyleChangeType() == kNeedsReattachStyleChange; |
397 } | 400 } |
398 bool NeedsStyleRecalc() const { | 401 bool NeedsStyleRecalc() const { |
399 return GetStyleChangeType() != kNoStyleChange; | 402 return GetStyleChangeType() != kNoStyleChange; |
400 } | 403 } |
401 StyleChangeType GetStyleChangeType() const { | 404 StyleChangeType GetStyleChangeType() const { |
402 return static_cast<StyleChangeType>(node_flags_ & kStyleChangeMask); | 405 return static_cast<StyleChangeType>(node_flags_ & kStyleChangeMask); |
403 } | 406 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 void UpdateDistribution(); | 474 void UpdateDistribution(); |
472 | 475 |
473 void SetIsLink(bool f); | 476 void SetIsLink(bool f); |
474 | 477 |
475 bool HasEventTargetData() const { return GetFlag(kHasEventTargetDataFlag); } | 478 bool HasEventTargetData() const { return GetFlag(kHasEventTargetDataFlag); } |
476 void SetHasEventTargetData(bool flag) { | 479 void SetHasEventTargetData(bool flag) { |
477 SetFlag(flag, kHasEventTargetDataFlag); | 480 SetFlag(flag, kHasEventTargetDataFlag); |
478 } | 481 } |
479 | 482 |
480 virtual void SetFocused(bool flag, WebFocusType); | 483 virtual void SetFocused(bool flag, WebFocusType); |
| 484 virtual void SetHasFocusWithin(bool flag); |
481 virtual void SetActive(bool flag = true); | 485 virtual void SetActive(bool flag = true); |
482 virtual void SetDragged(bool flag); | 486 virtual void SetDragged(bool flag); |
483 virtual void SetHovered(bool flag = true); | 487 virtual void SetHovered(bool flag = true); |
484 | 488 |
485 virtual int tabIndex() const; | 489 virtual int tabIndex() const; |
486 | 490 |
487 virtual Node* FocusDelegate(); | 491 virtual Node* FocusDelegate(); |
488 // This is called only when the node is focused. | 492 // This is called only when the node is focused. |
489 virtual bool ShouldHaveFocusAppearance() const; | 493 virtual bool ShouldHaveFocusAppearance() const; |
490 | 494 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 // during "commit". The main thread is stopped at that time, but | 900 // during "commit". The main thread is stopped at that time, but |
897 // it is not safe to cache AtomicStrings because those are | 901 // it is not safe to cache AtomicStrings because those are |
898 // per-thread. | 902 // per-thread. |
899 virtual String DebugNodeName() const; | 903 virtual String DebugNodeName() const; |
900 | 904 |
901 bool IsUserActionElementActive() const; | 905 bool IsUserActionElementActive() const; |
902 bool IsUserActionElementInActiveChain() const; | 906 bool IsUserActionElementInActiveChain() const; |
903 bool IsUserActionElementDragged() const; | 907 bool IsUserActionElementDragged() const; |
904 bool IsUserActionElementHovered() const; | 908 bool IsUserActionElementHovered() const; |
905 bool IsUserActionElementFocused() const; | 909 bool IsUserActionElementFocused() const; |
| 910 bool IsUserActionElementHasFocusWithin() const; |
906 | 911 |
907 void RecalcDistribution(); | 912 void RecalcDistribution(); |
908 | 913 |
909 void SetStyleChange(StyleChangeType); | 914 void SetStyleChange(StyleChangeType); |
910 | 915 |
911 virtual const ComputedStyle* VirtualEnsureComputedStyle( | 916 virtual const ComputedStyle* VirtualEnsureComputedStyle( |
912 PseudoId = kPseudoIdNone); | 917 PseudoId = kPseudoIdNone); |
913 | 918 |
914 void TrackForDebugging(); | 919 void TrackForDebugging(); |
915 | 920 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 } // namespace blink | 999 } // namespace blink |
995 | 1000 |
996 #ifndef NDEBUG | 1001 #ifndef NDEBUG |
997 // Outside the WebCore namespace for ease of invocation from gdb. | 1002 // Outside the WebCore namespace for ease of invocation from gdb. |
998 void showNode(const blink::Node*); | 1003 void showNode(const blink::Node*); |
999 void showTree(const blink::Node*); | 1004 void showTree(const blink::Node*); |
1000 void showNodePath(const blink::Node*); | 1005 void showNodePath(const blink::Node*); |
1001 #endif | 1006 #endif |
1002 | 1007 |
1003 #endif // Node_h | 1008 #endif // Node_h |
OLD | NEW |