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

Side by Side Diff: third_party/WebKit/WebCore/editing/htmlediting.cpp

Issue 10670: Do another merge using nifty new merge script (CL for that coming soon). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 849
850 Node *nearestMailBlockquote(const Node *node) 850 Node *nearestMailBlockquote(const Node *node)
851 { 851 {
852 for (Node *n = const_cast<Node *>(node); n; n = n->parentNode()) { 852 for (Node *n = const_cast<Node *>(node); n; n = n->parentNode()) {
853 if (isMailBlockquote(n)) 853 if (isMailBlockquote(n))
854 return n; 854 return n;
855 } 855 }
856 return 0; 856 return 0;
857 } 857 }
858 858
859 unsigned numEnclosingMailBlockquotes(const Position& p)
860 {
861 unsigned num = 0;
862 for (Node* n = p.node(); n; n = n->parentNode())
863 if (isMailBlockquote(n))
864 num++;
865
866 return num;
867 }
868
859 bool isMailBlockquote(const Node *node) 869 bool isMailBlockquote(const Node *node)
860 { 870 {
861 if (!node || !node->isElementNode() && !node->hasTagName(blockquoteTag)) 871 if (!node || !node->isElementNode() && !node->hasTagName(blockquoteTag))
862 return false; 872 return false;
863 873
864 return static_cast<const Element *>(node)->getAttribute("type") == "cite"; 874 return static_cast<const Element *>(node)->getAttribute("type") == "cite";
865 } 875 }
866 876
867 int caretMinOffset(const Node* n) 877 int caretMinOffset(const Node* n)
868 { 878 {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 992
983 if (extent == node || extent->isDescendantOf(node)) { 993 if (extent == node || extent->isDescendantOf(node)) {
984 ASSERT(node->parentNode()); 994 ASSERT(node->parentNode());
985 updatedSelection.setExtent(Position(node->parentNode(), node->nodeIndex( ))); 995 updatedSelection.setExtent(Position(node->parentNode(), node->nodeIndex( )));
986 } 996 }
987 997
988 return updatedSelection; 998 return updatedSelection;
989 } 999 }
990 1000
991 } // namespace WebCore 1001 } // namespace WebCore
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/editing/htmlediting.h ('k') | third_party/WebKit/WebCore/inspector/InspectorController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698