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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp

Issue 2142513003: Use initializer_lists for static WTF::HashSets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 element->style()->setPropertyInternal(CSSPropertyDisplay, String (), "inline", false, IGNORE_EXCEPTION); 606 element->style()->setPropertyInternal(CSSPropertyDisplay, String (), "inline", false, IGNORE_EXCEPTION);
607 if (element->layoutObject() && element->layoutObject()->style()->isF loating()) 607 if (element->layoutObject() && element->layoutObject()->style()->isF loating())
608 element->style()->setPropertyInternal(CSSPropertyFloat, String() , "none", false, IGNORE_EXCEPTION); 608 element->style()->setPropertyInternal(CSSPropertyFloat, String() , "none", false, IGNORE_EXCEPTION);
609 } 609 }
610 } 610 }
611 } 611 }
612 612
613 static bool isProhibitedParagraphChild(const AtomicString& name) 613 static bool isProhibitedParagraphChild(const AtomicString& name)
614 { 614 {
615 // https://dvcs.w3.org/hg/editing/raw-file/57abe6d3cb60/editing.html#prohibi ted-paragraph-child 615 // https://dvcs.w3.org/hg/editing/raw-file/57abe6d3cb60/editing.html#prohibi ted-paragraph-child
616 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, elements, ()); 616 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, elements, ({
617 if (elements.isEmpty()) { 617 addressTag.localName(),
618 elements.add(addressTag.localName()); 618 articleTag.localName(),
619 elements.add(articleTag.localName()); 619 asideTag.localName(),
620 elements.add(asideTag.localName()); 620 blockquoteTag.localName(),
621 elements.add(blockquoteTag.localName()); 621 captionTag.localName(),
622 elements.add(captionTag.localName()); 622 centerTag.localName(),
623 elements.add(centerTag.localName()); 623 colTag.localName(),
624 elements.add(colTag.localName()); 624 colgroupTag.localName(),
625 elements.add(colgroupTag.localName()); 625 ddTag.localName(),
626 elements.add(ddTag.localName()); 626 detailsTag.localName(),
627 elements.add(detailsTag.localName()); 627 dirTag.localName(),
628 elements.add(dirTag.localName()); 628 divTag.localName(),
629 elements.add(divTag.localName()); 629 dlTag.localName(),
630 elements.add(dlTag.localName()); 630 dtTag.localName(),
631 elements.add(dtTag.localName()); 631 fieldsetTag.localName(),
632 elements.add(fieldsetTag.localName()); 632 figcaptionTag.localName(),
633 elements.add(figcaptionTag.localName()); 633 figureTag.localName(),
634 elements.add(figureTag.localName()); 634 footerTag.localName(),
635 elements.add(footerTag.localName()); 635 formTag.localName(),
636 elements.add(formTag.localName()); 636 h1Tag.localName(),
637 elements.add(h1Tag.localName()); 637 h2Tag.localName(),
638 elements.add(h2Tag.localName()); 638 h3Tag.localName(),
639 elements.add(h3Tag.localName()); 639 h4Tag.localName(),
640 elements.add(h4Tag.localName()); 640 h5Tag.localName(),
641 elements.add(h5Tag.localName()); 641 h6Tag.localName(),
642 elements.add(h6Tag.localName()); 642 headerTag.localName(),
643 elements.add(headerTag.localName()); 643 hgroupTag.localName(),
644 elements.add(hgroupTag.localName()); 644 hrTag.localName(),
645 elements.add(hrTag.localName()); 645 liTag.localName(),
646 elements.add(liTag.localName()); 646 listingTag.localName(),
647 elements.add(listingTag.localName()); 647 mainTag.localName(), // Missing in the specification.
648 elements.add(mainTag.localName()); // Missing in the specification. 648 menuTag.localName(),
649 elements.add(menuTag.localName()); 649 navTag.localName(),
650 elements.add(navTag.localName()); 650 olTag.localName(),
651 elements.add(olTag.localName()); 651 pTag.localName(),
652 elements.add(pTag.localName()); 652 plaintextTag.localName(),
653 elements.add(plaintextTag.localName()); 653 preTag.localName(),
654 elements.add(preTag.localName()); 654 sectionTag.localName(),
655 elements.add(sectionTag.localName()); 655 summaryTag.localName(),
656 elements.add(summaryTag.localName()); 656 tableTag.localName(),
657 elements.add(tableTag.localName()); 657 tbodyTag.localName(),
658 elements.add(tbodyTag.localName()); 658 tdTag.localName(),
659 elements.add(tdTag.localName()); 659 tfootTag.localName(),
660 elements.add(tfootTag.localName()); 660 thTag.localName(),
661 elements.add(thTag.localName()); 661 theadTag.localName(),
662 elements.add(theadTag.localName()); 662 trTag.localName(),
663 elements.add(trTag.localName()); 663 ulTag.localName(),
664 elements.add(ulTag.localName()); 664 xmpTag.localName(),
665 elements.add(xmpTag.localName()); 665 }));
666 }
667 return elements.contains(name); 666 return elements.contains(name);
668 } 667 }
669 668
670 void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild er(const InsertedNodes& insertedNodes, EditingState* editingState) 669 void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild er(const InsertedNodes& insertedNodes, EditingState* editingState)
671 { 670 {
672 Node* pastEndNode = insertedNodes.pastLastLeaf(); 671 Node* pastEndNode = insertedNodes.pastLastLeaf();
673 Node* next = nullptr; 672 Node* next = nullptr;
674 for (Node* node = insertedNodes.firstNodeInserted(); node && node != pastEnd Node; node = next) { 673 for (Node* node = insertedNodes.firstNodeInserted(); node && node != pastEnd Node; node = next) {
675 next = NodeTraversal::next(*node); 674 next = NodeTraversal::next(*node);
676 675
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 visitor->trace(m_startOfInsertedContent); 1755 visitor->trace(m_startOfInsertedContent);
1757 visitor->trace(m_endOfInsertedContent); 1756 visitor->trace(m_endOfInsertedContent);
1758 visitor->trace(m_insertionStyle); 1757 visitor->trace(m_insertionStyle);
1759 visitor->trace(m_documentFragment); 1758 visitor->trace(m_documentFragment);
1760 visitor->trace(m_startOfInsertedRange); 1759 visitor->trace(m_startOfInsertedRange);
1761 visitor->trace(m_endOfInsertedRange); 1760 visitor->trace(m_endOfInsertedRange);
1762 CompositeEditCommand::trace(visitor); 1761 CompositeEditCommand::trace(visitor);
1763 } 1762 }
1764 1763
1765 } // namespace blink 1764 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698