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

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

Issue 108483002: Have Document::parseQualifiedName() deal with AtomicStrings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/svg/animation/SVGSMILElement.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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2009 Igalia S.L. 4 * Copyright (C) 2009 Igalia S.L.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 { 429 {
430 return executeApplyStyle(frame, source, EditActionSetColor, CSSPropertyColor , value); 430 return executeApplyStyle(frame, source, EditActionSetColor, CSSPropertyColor , value);
431 } 431 }
432 432
433 static bool executeFormatBlock(Frame& frame, Event*, EditorCommandSource, const String& value) 433 static bool executeFormatBlock(Frame& frame, Event*, EditorCommandSource, const String& value)
434 { 434 {
435 String tagName = value.lower(); 435 String tagName = value.lower();
436 if (tagName[0] == '<' && tagName[tagName.length() - 1] == '>') 436 if (tagName[0] == '<' && tagName[tagName.length() - 1] == '>')
437 tagName = tagName.substring(1, tagName.length() - 2); 437 tagName = tagName.substring(1, tagName.length() - 2);
438 438
439 String localName, prefix; 439 AtomicString localName, prefix;
440 if (!Document::parseQualifiedName(tagName, prefix, localName, IGNORE_EXCEPTI ON)) 440 if (!Document::parseQualifiedName(AtomicString(tagName), prefix, localName, IGNORE_EXCEPTION))
441 return false; 441 return false;
442 QualifiedName qualifiedTagName(prefix, localName, xhtmlNamespaceURI); 442 QualifiedName qualifiedTagName(prefix, localName, xhtmlNamespaceURI);
443 443
444 ASSERT(frame.document()); 444 ASSERT(frame.document());
445 RefPtr<FormatBlockCommand> command = FormatBlockCommand::create(*frame.docum ent(), qualifiedTagName); 445 RefPtr<FormatBlockCommand> command = FormatBlockCommand::create(*frame.docum ent(), qualifiedTagName);
446 command->apply(); 446 command->apply();
447 return command->didApply(); 447 return command->didApply();
448 } 448 }
449 449
450 static bool executeForwardDelete(Frame& frame, Event*, EditorCommandSource sourc e, const String&) 450 static bool executeForwardDelete(Frame& frame, Event*, EditorCommandSource sourc e, const String&)
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 return m_command->state(*m_frame, triggeringEvent) == TrueTriState ? "tr ue" : "false"; 1723 return m_command->state(*m_frame, triggeringEvent) == TrueTriState ? "tr ue" : "false";
1724 return m_command->value(*m_frame, triggeringEvent); 1724 return m_command->value(*m_frame, triggeringEvent);
1725 } 1725 }
1726 1726
1727 bool Editor::Command::isTextInsertion() const 1727 bool Editor::Command::isTextInsertion() const
1728 { 1728 {
1729 return m_command && m_command->isTextInsertion; 1729 return m_command && m_command->isTextInsertion;
1730 } 1730 }
1731 1731
1732 } // namespace WebCore 1732 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698