OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> |
3 * Copyright (C) 2006, 2009 Apple Inc. | 3 * Copyright (C) 2006, 2009 Apple Inc. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
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 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 (step->getAxis() != Step::ChildAxis && | 126 (step->getAxis() != Step::ChildAxis && |
127 step->getAxis() != Step::SelfAxis && | 127 step->getAxis() != Step::SelfAxis && |
128 step->getAxis() != Step::DescendantAxis && | 128 step->getAxis() != Step::DescendantAxis && |
129 step->getAxis() != Step::DescendantOrSelfAxis && | 129 step->getAxis() != Step::DescendantOrSelfAxis && |
130 step->getAxis() != Step::AttributeAxis); | 130 step->getAxis() != Step::AttributeAxis); |
131 | 131 |
132 if (needToCheckForDuplicateNodes) | 132 if (needToCheckForDuplicateNodes) |
133 resultIsSorted = false; | 133 resultIsSorted = false; |
134 | 134 |
135 // This is a simplified check that can be improved to handle more cases. | 135 // This is a simplified check that can be improved to handle more cases. |
136 if (nodes.subtreesAreDisjoint() && (step->getAxis() == Step::ChildAxis || | 136 if (nodes.subtreesAreDisjoint() && |
137 step->getAxis() == Step::SelfAxis)) | 137 (step->getAxis() == Step::ChildAxis || |
| 138 step->getAxis() == Step::SelfAxis)) |
138 newNodes->markSubtreesDisjoint(true); | 139 newNodes->markSubtreesDisjoint(true); |
139 | 140 |
140 for (const auto& inputNode : nodes) { | 141 for (const auto& inputNode : nodes) { |
141 NodeSet* matches = NodeSet::create(); | 142 NodeSet* matches = NodeSet::create(); |
142 step->evaluate(context, inputNode, *matches); | 143 step->evaluate(context, inputNode, *matches); |
143 | 144 |
144 if (!matches->isSorted()) | 145 if (!matches->isSorted()) |
145 resultIsSorted = false; | 146 resultIsSorted = false; |
146 | 147 |
147 for (const auto& node : *matches) { | 148 for (const auto& node : *matches) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 195 |
195 NodeSet& nodes = v.modifiableNodeSet(context); | 196 NodeSet& nodes = v.modifiableNodeSet(context); |
196 m_path->evaluate(context, nodes); | 197 m_path->evaluate(context, nodes); |
197 | 198 |
198 return v; | 199 return v; |
199 } | 200 } |
200 | 201 |
201 } // namespace XPath | 202 } // namespace XPath |
202 | 203 |
203 } // namespace blink | 204 } // namespace blink |
OLD | NEW |