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

Side by Side Diff: Source/core/editing/DOMSelection.cpp

Issue 813163007: Enable strict type checking for Selection.selectAllChildren() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 || (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRang e->startContainer(), selectedRange->startOffset(), exceptionState) < 0 && !excep tionState.hadException()); 486 || (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRang e->startContainer(), selectedRange->startOffset(), exceptionState) < 0 && !excep tionState.hadException());
487 ASSERT(!exceptionState.hadException()); 487 ASSERT(!exceptionState.hadException());
488 if (nodeFullyUnselected) 488 if (nodeFullyUnselected)
489 return false; 489 return false;
490 490
491 return allowPartial || n->isTextNode(); 491 return allowPartial || n->isTextNode();
492 } 492 }
493 493
494 void DOMSelection::selectAllChildren(Node* n, ExceptionState& exceptionState) 494 void DOMSelection::selectAllChildren(Node* n, ExceptionState& exceptionState)
495 { 495 {
496 if (!n) 496 ASSERT(n);
497 return;
498 497
499 // This doesn't (and shouldn't) select text node characters. 498 // This doesn't (and shouldn't) select text node characters.
500 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState); 499 setBaseAndExtent(n, 0, n, n->countChildren(), exceptionState);
501 } 500 }
502 501
503 String DOMSelection::toString() 502 String DOMSelection::toString()
504 { 503 {
505 if (!m_frame) 504 if (!m_frame)
506 return String(); 505 return String();
507 506
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message)); 559 m_treeScope->document().addConsoleMessage(ConsoleMessage::create(JSMessa geSource, ErrorMessageLevel, message));
561 } 560 }
562 561
563 void DOMSelection::trace(Visitor* visitor) 562 void DOMSelection::trace(Visitor* visitor)
564 { 563 {
565 visitor->trace(m_treeScope); 564 visitor->trace(m_treeScope);
566 DOMWindowProperty::trace(visitor); 565 DOMWindowProperty::trace(visitor);
567 } 566 }
568 567
569 } // namespace blink 568 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/editing/selection/selectAllChildren-expected.txt ('k') | Source/core/editing/Selection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698