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

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

Issue 2500793002: Internals.setValueForUser(): add argument type check. (Closed)
Patch Set: constrain argument type via IDL Created 4 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) 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 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after
2757 long) { 2757 long) {
2758 return ScriptPromise::cast(scriptState, 2758 return ScriptPromise::cast(scriptState,
2759 v8String(scriptState->isolate(), "done")); 2759 v8String(scriptState->isolate(), "done"));
2760 } 2760 }
2761 2761
2762 DEFINE_TRACE(Internals) { 2762 DEFINE_TRACE(Internals) {
2763 visitor->trace(m_runtimeFlags); 2763 visitor->trace(m_runtimeFlags);
2764 ContextLifecycleObserver::trace(visitor); 2764 ContextLifecycleObserver::trace(visitor);
2765 } 2765 }
2766 2766
2767 void Internals::setValueForUser(Element* element, const String& value) { 2767 void Internals::setValueForUser(HTMLInputElement* element,
2768 toHTMLInputElement(element)->setValueForUser(value); 2768 const String& value) {
2769 element->setValueForUser(value);
2769 } 2770 }
2770 2771
2771 String Internals::textSurroundingNode(Node* node, 2772 String Internals::textSurroundingNode(Node* node,
2772 int x, 2773 int x,
2773 int y, 2774 int y,
2774 unsigned long maxLength) { 2775 unsigned long maxLength) {
2775 if (!node) 2776 if (!node)
2776 return String(); 2777 return String();
2777 2778
2778 // VisiblePosition and SurroundingText must be created with clean layout. 2779 // VisiblePosition and SurroundingText must be created with clean layout.
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 return ClientRect::create(); 3036 return ClientRect::create();
3036 3037
3037 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); 3038 return ClientRect::create(FloatRect(node->layoutObject()->visualRect()));
3038 } 3039 }
3039 3040
3040 void Internals::crash() { 3041 void Internals::crash() {
3041 CHECK(false) << "Intentional crash"; 3042 CHECK(false) << "Intentional crash";
3042 } 3043 }
3043 3044
3044 } // namespace blink 3045 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698