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

Side by Side Diff: sky/engine/core/editing/ReplaceSelectionCommand.cpp

Issue 942933003: Remove almost all clients of isHTMLElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/engine/core/editing/EditingStyle.cpp ('k') | sky/engine/core/editing/htmlediting.h » ('j') | 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) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 m_endOfInsertedContent = m_startOfInsertedContent; 482 m_endOfInsertedContent = m_startOfInsertedContent;
483 } 483 }
484 } 484 }
485 485
486 static bool isInlineHTMLElementWithStyle(const Node* node) 486 static bool isInlineHTMLElementWithStyle(const Node* node)
487 { 487 {
488 // We don't want to skip over any block elements. 488 // We don't want to skip over any block elements.
489 if (isBlock(node)) 489 if (isBlock(node))
490 return false; 490 return false;
491 491
492 if (!node->isHTMLElement()) 492 if (!node->isElementNode())
493 return false; 493 return false;
494 494
495 // We can skip over elements whose class attribute is 495 // We can skip over elements whose class attribute is
496 // one of our internal classes. 496 // one of our internal classes.
497 const HTMLElement* element = toHTMLElement(node); 497 const Element* element = toElement(node);
498 const AtomicString& classAttributeValue = element->getAttribute(HTMLNames::c lassAttr); 498 const AtomicString& classAttributeValue = element->getAttribute(HTMLNames::c lassAttr);
499 if (classAttributeValue == AppleTabSpanClass) 499 if (classAttributeValue == AppleTabSpanClass)
500 return true; 500 return true;
501 if (classAttributeValue == AppleConvertedSpace) 501 if (classAttributeValue == AppleConvertedSpace)
502 return true; 502 return true;
503 if (classAttributeValue == ApplePasteAsQuotation) 503 if (classAttributeValue == ApplePasteAsQuotation)
504 return true; 504 return true;
505 505
506 return EditingStyle::elementIsStyledSpanOrHTMLEquivalent(element); 506 return EditingStyle::elementIsStyledSpanOrHTMLEquivalent(element);
507 } 507 }
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 return false; 998 return false;
999 999
1000 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d); 1000 VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, en d);
1001 1001
1002 setEndingSelection(selectionAfterReplace); 1002 setEndingSelection(selectionAfterReplace);
1003 1003
1004 return true; 1004 return true;
1005 } 1005 }
1006 1006
1007 } // namespace blink 1007 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/editing/EditingStyle.cpp ('k') | sky/engine/core/editing/htmlediting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698