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

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

Issue 23863002: Refactoring: toHTMLElement(const Node*) added but never used. Using it. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 | « Source/core/editing/ReplaceSelectionCommand.cpp ('k') | Source/core/html/HTMLElement.cpp » ('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) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2008, 2009, 2010, 2011 Google Inc. All rights reserved.
4 * Copyright (C) 2011 Igalia S.L. 4 * Copyright (C) 2011 Igalia S.L.
5 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 5 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 return isEndOfParagraph(v) && isStartOfParagraph(next) && !(upstreamNode->ha sTagName(brTag) && upstreamNode == downstreamNode); 476 return isEndOfParagraph(v) && isStartOfParagraph(next) && !(upstreamNode->ha sTagName(brTag) && upstreamNode == downstreamNode);
477 } 477 }
478 478
479 static PassRefPtr<EditingStyle> styleFromMatchedRulesAndInlineDecl(const Node* n ode) 479 static PassRefPtr<EditingStyle> styleFromMatchedRulesAndInlineDecl(const Node* n ode)
480 { 480 {
481 if (!node->isHTMLElement()) 481 if (!node->isHTMLElement())
482 return 0; 482 return 0;
483 483
484 // FIXME: Having to const_cast here is ugly, but it is quite a bit of work t o untangle 484 // FIXME: Having to const_cast here is ugly, but it is quite a bit of work t o untangle
485 // the non-const-ness of styleFromMatchedRulesForElement. 485 // the non-const-ness of styleFromMatchedRulesForElement.
486 HTMLElement* element = const_cast<HTMLElement*>(static_cast<const HTMLElemen t*>(node)); 486 HTMLElement* element = const_cast<HTMLElement*>(toHTMLElement(node));
487 RefPtr<EditingStyle> style = EditingStyle::create(element->inlineStyle()); 487 RefPtr<EditingStyle> style = EditingStyle::create(element->inlineStyle());
488 style->mergeStyleFromRules(element); 488 style->mergeStyleFromRules(element);
489 return style.release(); 489 return style.release();
490 } 490 }
491 491
492 static bool isElementPresentational(const Node* node) 492 static bool isElementPresentational(const Node* node)
493 { 493 {
494 return node->hasTagName(uTag) || node->hasTagName(sTag) || node->hasTagName( strikeTag) 494 return node->hasTagName(uTag) || node->hasTagName(sTag) || node->hasTagName( strikeTag)
495 || node->hasTagName(iTag) || node->hasTagName(emTag) || node->hasTagName (bTag) || node->hasTagName(strongTag); 495 || node->hasTagName(iTag) || node->hasTagName(emTag) || node->hasTagName (bTag) || node->hasTagName(strongTag);
496 } 496 }
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 if (containerNode->hasOneChild()) { 1072 if (containerNode->hasOneChild()) {
1073 containerNode->replaceChild(textNode.release(), containerNode->firstChil d(), es); 1073 containerNode->replaceChild(textNode.release(), containerNode->firstChil d(), es);
1074 return; 1074 return;
1075 } 1075 }
1076 1076
1077 containerNode->removeChildren(); 1077 containerNode->removeChildren();
1078 containerNode->appendChild(textNode.release(), es); 1078 containerNode->appendChild(textNode.release(), es);
1079 } 1079 }
1080 1080
1081 } 1081 }
OLDNEW
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.cpp ('k') | Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698