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

Side by Side Diff: Source/core/dom/Position.cpp

Issue 165933002: Fix the crash bug about selecting a marquee element. (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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 if (!node || !node->renderer()) 540 if (!node || !node->renderer())
541 return false; 541 return false;
542 542
543 if (!node->renderer()->isInline()) 543 if (!node->renderer()->isInline())
544 return true; 544 return true;
545 545
546 // Don't include inline tables. 546 // Don't include inline tables.
547 if (node->hasTagName(tableTag)) 547 if (node->hasTagName(tableTag))
548 return false; 548 return false;
549 549
550 // A Marquee element are movings so we should assume the element's position
leviw_travelin_and_unemployed 2014/02/14 04:57:46 I'd change this to something like "Marquee element
yoichio 2014/02/19 08:00:30 Done.
551 // is always distinct from the node's one.
552 if (node->hasTagName(marqueeTag))
553 return true;
554
550 // There is a VisiblePosition inside an empty inline-block container. 555 // There is a VisiblePosition inside an empty inline-block container.
551 return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && toRenderBox(node->renderer())->height() != 0 && !node->firstChild(); 556 return node->renderer()->isReplaced() && canHaveChildrenForEditing(node) && toRenderBox(node->renderer())->height() != 0 && !node->firstChild();
552 } 557 }
553 558
554 static Node* enclosingVisualBoundary(Node* node) 559 static Node* enclosingVisualBoundary(Node* node)
555 { 560 {
556 while (node && !endsOfNodeAreVisuallyDistinctPositions(node)) 561 while (node && !endsOfNodeAreVisuallyDistinctPositions(node))
557 node = node->parentNode(); 562 node = node->parentNode();
558 563
559 return node; 564 return node;
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 pos.showTreeForThis(); 1387 pos.showTreeForThis();
1383 } 1388 }
1384 1389
1385 void showTree(const WebCore::Position* pos) 1390 void showTree(const WebCore::Position* pos)
1386 { 1391 {
1387 if (pos) 1392 if (pos)
1388 pos->showTreeForThis(); 1393 pos->showTreeForThis();
1389 } 1394 }
1390 1395
1391 #endif 1396 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698