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

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

Issue 1420693006: Introduce a struct to store arguments of Element::focus(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 , m_domTreeVersion(++s_globalTreeVersion) 397 , m_domTreeVersion(++s_globalTreeVersion)
398 , m_styleVersion(0) 398 , m_styleVersion(0)
399 , m_listenerTypes(0) 399 , m_listenerTypes(0)
400 , m_mutationObserverTypes(0) 400 , m_mutationObserverTypes(0)
401 , m_visitedLinkState(VisitedLinkState::create(*this)) 401 , m_visitedLinkState(VisitedLinkState::create(*this))
402 , m_visuallyOrdered(false) 402 , m_visuallyOrdered(false)
403 , m_readyState(Complete) 403 , m_readyState(Complete)
404 , m_parsingState(FinishedParsing) 404 , m_parsingState(FinishedParsing)
405 , m_gotoAnchorNeededAfterStylesheetsLoad(false) 405 , m_gotoAnchorNeededAfterStylesheetsLoad(false)
406 , m_containsValidityStyleRules(false) 406 , m_containsValidityStyleRules(false)
407 , m_updateFocusAppearanceRestoresSelection(false)
408 , m_containsPlugins(false) 407 , m_containsPlugins(false)
408 , m_updateFocusAppearanceSelectionBahavior(SelectionBehaviorOnFocus::Reset)
409 , m_ignoreDestructiveWriteCount(0) 409 , m_ignoreDestructiveWriteCount(0)
410 , m_markers(adoptPtrWillBeNoop(new DocumentMarkerController)) 410 , m_markers(adoptPtrWillBeNoop(new DocumentMarkerController))
411 , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFi red) 411 , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFi red)
412 , m_cssTarget(nullptr) 412 , m_cssTarget(nullptr)
413 , m_startTime(currentTime()) 413 , m_startTime(currentTime())
414 , m_scriptRunner(ScriptRunner::create(this)) 414 , m_scriptRunner(ScriptRunner::create(this))
415 , m_xmlVersion("1.0") 415 , m_xmlVersion("1.0")
416 , m_xmlStandalone(StandaloneUnspecified) 416 , m_xmlStandalone(StandaloneUnspecified)
417 , m_hasXMLDeclaration(0) 417 , m_hasXMLDeclaration(0)
418 , m_designMode(false) 418 , m_designMode(false)
(...skipping 4476 matching lines...) Expand 10 before | Expand all | Expand 10 after
4895 return; 4895 return;
4896 m_frame->updateFrameSecurityOrigin(); 4896 m_frame->updateFrameSecurityOrigin();
4897 m_frame->script().updateSecurityOrigin(securityOrigin()); 4897 m_frame->script().updateSecurityOrigin(securityOrigin());
4898 } 4898 }
4899 4899
4900 bool Document::isContextThread() const 4900 bool Document::isContextThread() const
4901 { 4901 {
4902 return isMainThread(); 4902 return isMainThread();
4903 } 4903 }
4904 4904
4905 void Document::updateFocusAppearanceSoon(bool restorePreviousSelection) 4905 void Document::updateFocusAppearanceSoon(SelectionBehaviorOnFocus selectionbehav ioronfocus)
4906 { 4906 {
4907 m_updateFocusAppearanceRestoresSelection = restorePreviousSelection; 4907 m_updateFocusAppearanceSelectionBahavior = selectionbehavioronfocus;
4908 if (!m_updateFocusAppearanceTimer.isActive()) 4908 if (!m_updateFocusAppearanceTimer.isActive())
4909 m_updateFocusAppearanceTimer.startOneShot(0, BLINK_FROM_HERE); 4909 m_updateFocusAppearanceTimer.startOneShot(0, BLINK_FROM_HERE);
4910 } 4910 }
4911 4911
4912 void Document::cancelFocusAppearanceUpdate() 4912 void Document::cancelFocusAppearanceUpdate()
4913 { 4913 {
4914 m_updateFocusAppearanceTimer.stop(); 4914 m_updateFocusAppearanceTimer.stop();
4915 } 4915 }
4916 4916
4917 void Document::updateFocusAppearanceTimerFired(Timer<Document>*) 4917 void Document::updateFocusAppearanceTimerFired(Timer<Document>*)
4918 { 4918 {
4919 Element* element = focusedElement(); 4919 Element* element = focusedElement();
4920 if (!element) 4920 if (!element)
4921 return; 4921 return;
4922 updateLayout(); 4922 updateLayout();
4923 if (element->isFocusable()) 4923 if (element->isFocusable())
4924 element->updateFocusAppearance(m_updateFocusAppearanceRestoresSelection) ; 4924 element->updateFocusAppearance(m_updateFocusAppearanceSelectionBahavior) ;
4925 } 4925 }
4926 4926
4927 void Document::attachRange(Range* range) 4927 void Document::attachRange(Range* range)
4928 { 4928 {
4929 ASSERT(!m_ranges.contains(range)); 4929 ASSERT(!m_ranges.contains(range));
4930 m_ranges.add(range); 4930 m_ranges.add(range);
4931 } 4931 }
4932 4932
4933 void Document::detachRange(Range* range) 4933 void Document::detachRange(Range* range)
4934 { 4934 {
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
5828 #ifndef NDEBUG 5828 #ifndef NDEBUG
5829 using namespace blink; 5829 using namespace blink;
5830 void showLiveDocumentInstances() 5830 void showLiveDocumentInstances()
5831 { 5831 {
5832 Document::WeakDocumentSet& set = Document::liveDocumentSet(); 5832 Document::WeakDocumentSet& set = Document::liveDocumentSet();
5833 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5833 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5834 for (Document* document : set) 5834 for (Document* document : set)
5835 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5835 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5836 } 5836 }
5837 #endif 5837 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698