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

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

Issue 2461633002: Missing document null pointer check in Internals. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/harness/internals-no-document-crash-expected.txt ('k') | 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 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 } 2286 }
2287 2287
2288 FrameView* frameView = document->view(); 2288 FrameView* frameView = document->view();
2289 frameView->updateAllLifecyclePhases(); 2289 frameView->updateAllLifecyclePhases();
2290 frameView->setTracksPaintInvalidations(false); 2290 frameView->setTracksPaintInvalidations(false);
2291 } 2291 }
2292 2292
2293 void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks( 2293 void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(
2294 Node* node, 2294 Node* node,
2295 ExceptionState& exceptionState) { 2295 ExceptionState& exceptionState) {
2296 Document* document; 2296 Document* document = nullptr;
2297 if (!node) { 2297 if (!node) {
2298 document = contextDocument(); 2298 document = contextDocument();
2299 } else if (node->isDocumentNode()) { 2299 } else if (node->isDocumentNode()) {
2300 document = toDocument(node); 2300 document = toDocument(node);
2301 } else if (isHTMLIFrameElement(*node)) { 2301 } else if (isHTMLIFrameElement(*node)) {
2302 document = toHTMLIFrameElement(*node).contentDocument(); 2302 document = toHTMLIFrameElement(*node).contentDocument();
2303 } else { 2303 }
2304
2305 if (!document) {
2304 exceptionState.throwTypeError( 2306 exceptionState.throwTypeError(
2305 "The node provided is neither a document nor an IFrame."); 2307 "The node provided is neither a document nor an IFrame.");
2306 return; 2308 return;
2307 } 2309 }
2308 document->updateStyleAndLayoutIgnorePendingStylesheets( 2310 document->updateStyleAndLayoutIgnorePendingStylesheets(
2309 Document::RunPostLayoutTasksSynchronously); 2311 Document::RunPostLayoutTasksSynchronously);
2310 } 2312 }
2311 2313
2312 void Internals::forceFullRepaint(Document* document, 2314 void Internals::forceFullRepaint(Document* document,
2313 ExceptionState& exceptionState) { 2315 ExceptionState& exceptionState) {
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
3009 return ClientRect::create(); 3011 return ClientRect::create();
3010 3012
3011 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); 3013 return ClientRect::create(FloatRect(node->layoutObject()->visualRect()));
3012 } 3014 }
3013 3015
3014 void Internals::crash() { 3016 void Internals::crash() {
3015 CHECK(false) << "Intentional crash"; 3017 CHECK(false) << "Intentional crash";
3016 } 3018 }
3017 3019
3018 } // namespace blink 3020 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/harness/internals-no-document-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698