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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp

Issue 2149893003: Rename Node::inShadowIncludingDocument() to Node::isConnected() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed Created 4 years, 5 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
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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 } 67 }
68 68
69 HTMLTextFormControlElement::~HTMLTextFormControlElement() 69 HTMLTextFormControlElement::~HTMLTextFormControlElement()
70 { 70 {
71 } 71 }
72 72
73 Node::InsertionNotificationRequest HTMLTextFormControlElement::insertedInto(Cont ainerNode* insertionPoint) 73 Node::InsertionNotificationRequest HTMLTextFormControlElement::insertedInto(Cont ainerNode* insertionPoint)
74 { 74 {
75 HTMLFormControlElementWithState::insertedInto(insertionPoint); 75 HTMLFormControlElementWithState::insertedInto(insertionPoint);
76 if (!insertionPoint->inShadowIncludingDocument()) 76 if (!insertionPoint->isConnected())
77 return InsertionDone; 77 return InsertionDone;
78 String initialValue = value(); 78 String initialValue = value();
79 setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString() : initialValue); 79 setTextAsOfLastFormControlChangeEvent(initialValue.isNull() ? emptyString() : initialValue);
80 return InsertionDone; 80 return InsertionDone;
81 } 81 }
82 82
83 void HTMLTextFormControlElement::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities) 83 void HTMLTextFormControlElement::dispatchFocusEvent(Element* oldFocusedElement, WebFocusType type, InputDeviceCapabilities* sourceCapabilities)
84 { 84 {
85 if (supportsPlaceholder()) 85 if (supportsPlaceholder())
86 updatePlaceholderVisibility(); 86 updatePlaceholderVisibility();
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField SelectionDirection direction, NeedToDispatchSelectEvent eventBehaviour, Selectio nOption selectionOption) 346 void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField SelectionDirection direction, NeedToDispatchSelectEvent eventBehaviour, Selectio nOption selectionOption)
347 { 347 {
348 if (openShadowRoot() || !isTextFormControl()) 348 if (openShadowRoot() || !isTextFormControl())
349 return; 349 return;
350 const int editorValueLength = static_cast<int>(innerEditorValue().length()); 350 const int editorValueLength = static_cast<int>(innerEditorValue().length());
351 ASSERT(editorValueLength >= 0); 351 ASSERT(editorValueLength >= 0);
352 end = std::max(std::min(end, editorValueLength), 0); 352 end = std::max(std::min(end, editorValueLength), 0);
353 start = std::min(std::max(start, 0), end); 353 start = std::min(std::max(start, 0), end);
354 cacheSelection(start, end, direction); 354 cacheSelection(start, end, direction);
355 355
356 if (selectionOption == NotChangeSelection || (selectionOption == ChangeSelec tionIfFocused && document().focusedElement() != this) || !inShadowIncludingDocum ent()) { 356 if (selectionOption == NotChangeSelection || (selectionOption == ChangeSelec tionIfFocused && document().focusedElement() != this) || !isConnected()) {
357 if (eventBehaviour == DispatchSelectEvent) 357 if (eventBehaviour == DispatchSelectEvent)
358 scheduleSelectEvent(); 358 scheduleSelectEvent();
359 return; 359 return;
360 } 360 }
361 361
362 LocalFrame* frame = document().frame(); 362 LocalFrame* frame = document().frame();
363 HTMLElement* innerEditor = innerEditorElement(); 363 HTMLElement* innerEditor = innerEditorElement();
364 if (!frame || !innerEditor) 364 if (!frame || !innerEditor)
365 return; 365 return;
366 366
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 } 1028 }
1029 1029
1030 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele ment& source) 1030 void HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(const Ele ment& source)
1031 { 1031 {
1032 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText FormControlElement&>(source); 1032 const HTMLTextFormControlElement& sourceElement = static_cast<const HTMLText FormControlElement&>(source);
1033 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit; 1033 m_lastChangeWasUserEdit = sourceElement.m_lastChangeWasUserEdit;
1034 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); 1034 HTMLFormControlElement::copyNonAttributePropertiesFromElement(source);
1035 } 1035 }
1036 1036
1037 } // namespace blink 1037 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLTitleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698