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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 155903002: Using hasTagName() instead of tagName() while checking textarea type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionState& except ionState) 993 bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionState& except ionState)
994 { 994 {
995 if (!textField) { 995 if (!textField) {
996 exceptionState.throwDOMException(InvalidAccessError, "The element provid ed is invalid."); 996 exceptionState.throwDOMException(InvalidAccessError, "The element provid ed is invalid.");
997 return false; 997 return false;
998 } 998 }
999 999
1000 if (textField->hasTagName(inputTag)) 1000 if (textField->hasTagName(inputTag))
1001 return toHTMLInputElement(textField)->lastChangeWasUserEdit(); 1001 return toHTMLInputElement(textField)->lastChangeWasUserEdit();
1002 1002
1003 // FIXME: We should be using hasTagName instead but Windows port doesn't lin k QualifiedNames properly. 1003 if (textField->hasTagName(textareaTag))
1004 if (textField->tagName() == "TEXTAREA")
1005 return toHTMLTextAreaElement(textField)->lastChangeWasUserEdit(); 1004 return toHTMLTextAreaElement(textField)->lastChangeWasUserEdit();
1006 1005
1007 exceptionState.throwDOMException(InvalidNodeTypeError, "The element provided is not a TEXTAREA."); 1006 exceptionState.throwDOMException(InvalidNodeTypeError, "The element provided is not a TEXTAREA.");
1008 return false; 1007 return false;
1009 } 1008 }
1010 1009
1011 bool Internals::elementShouldAutoComplete(Element* element, ExceptionState& exce ptionState) 1010 bool Internals::elementShouldAutoComplete(Element* element, ExceptionState& exce ptionState)
1012 { 1011 {
1013 if (!element) { 1012 if (!element) {
1014 exceptionState.throwDOMException(InvalidAccessError, "The element provid ed is invalid."); 1013 exceptionState.throwDOMException(InvalidAccessError, "The element provid ed is invalid.");
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 }; 2393 };
2395 2394
2396 } // namespace 2395 } // namespace
2397 2396
2398 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis e promise) 2397 ScriptPromise Internals::addOneToPromise(ExecutionContext* context, ScriptPromis e promise)
2399 { 2398 {
2400 return promise.then(AddOneFunction::create(context)); 2399 return promise.then(AddOneFunction::create(context));
2401 } 2400 }
2402 2401
2403 } 2402 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698