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

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

Issue 18313005: Introduce isHTMLTableElement and toHTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 7 years, 5 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 17 matching lines...) Expand all
28 28
29 #include <stdio.h> 29 #include <stdio.h>
30 #include "HTMLNames.h" 30 #include "HTMLNames.h"
31 #include "core/css/CSSComputedStyleDeclaration.h" 31 #include "core/css/CSSComputedStyleDeclaration.h"
32 #include "core/dom/PositionIterator.h" 32 #include "core/dom/PositionIterator.h"
33 #include "core/dom/Text.h" 33 #include "core/dom/Text.h"
34 #include "core/editing/TextIterator.h" 34 #include "core/editing/TextIterator.h"
35 #include "core/editing/VisiblePosition.h" 35 #include "core/editing/VisiblePosition.h"
36 #include "core/editing/VisibleUnits.h" 36 #include "core/editing/VisibleUnits.h"
37 #include "core/editing/htmlediting.h" 37 #include "core/editing/htmlediting.h"
38 #include "core/html/HTMLTableElement.h"
38 #include "core/platform/Logging.h" 39 #include "core/platform/Logging.h"
39 #include "core/rendering/InlineIterator.h" 40 #include "core/rendering/InlineIterator.h"
40 #include "core/rendering/InlineTextBox.h" 41 #include "core/rendering/InlineTextBox.h"
41 #include "core/rendering/RenderBlock.h" 42 #include "core/rendering/RenderBlock.h"
42 #include "core/rendering/RenderInline.h" 43 #include "core/rendering/RenderInline.h"
43 #include "core/rendering/RenderText.h" 44 #include "core/rendering/RenderText.h"
44 #include "wtf/text/CString.h" 45 #include "wtf/text/CString.h"
45 #include "wtf/unicode/CharacterNames.h" 46 #include "wtf/unicode/CharacterNames.h"
46 47
47 namespace WebCore { 48 namespace WebCore {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 // FIXME: Share code with isCandidate, if possible. 542 // FIXME: Share code with isCandidate, if possible.
542 static bool endsOfNodeAreVisuallyDistinctPositions(Node* node) 543 static bool endsOfNodeAreVisuallyDistinctPositions(Node* node)
543 { 544 {
544 if (!node || !node->renderer()) 545 if (!node || !node->renderer())
545 return false; 546 return false;
546 547
547 if (!node->renderer()->isInline()) 548 if (!node->renderer()->isInline())
548 return true; 549 return true;
549 550
550 // Don't include inline tables. 551 // Don't include inline tables.
551 if (node->hasTagName(tableTag)) 552 if (isHTMLTableElement(node))
552 return false; 553 return false;
553 554
554 // There is a VisiblePosition inside an empty inline-block container. 555 // There is a VisiblePosition inside an empty inline-block container.
555 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();
556 } 557 }
557 558
558 static Node* enclosingVisualBoundary(Node* node) 559 static Node* enclosingVisualBoundary(Node* node)
559 { 560 {
560 while (node && !endsOfNodeAreVisuallyDistinctPositions(node)) 561 while (node && !endsOfNodeAreVisuallyDistinctPositions(node))
561 node = node->parentNode(); 562 node = node->parentNode();
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 pos.showTreeForThis(); 1391 pos.showTreeForThis();
1391 } 1392 }
1392 1393
1393 void showTree(const WebCore::Position* pos) 1394 void showTree(const WebCore::Position* pos)
1394 { 1395 {
1395 if (pos) 1396 if (pos)
1396 pos->showTreeForThis(); 1397 pos->showTreeForThis();
1397 } 1398 }
1398 1399
1399 #endif 1400 #endif
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/editing/DeleteSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698