| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 357 |
| 358 size_t endPos = startPos; | 358 size_t endPos = startPos; |
| 359 while (endPos < length && !isWhitespace(idList[endPos])) | 359 while (endPos < length && !isWhitespace(idList[endPos])) |
| 360 ++endPos; | 360 ++endPos; |
| 361 | 361 |
| 362 // If there are several nodes with the same id, id() should return the first | 362 // If there are several nodes with the same id, id() should return the first |
| 363 // one. In WebKit, getElementById behaves so, too, although its behavior in | 363 // one. In WebKit, getElementById behaves so, too, although its behavior in |
| 364 // this case is formally undefined. | 364 // this case is formally undefined. |
| 365 Node* node = contextScope.getElementById( | 365 Node* node = contextScope.getElementById( |
| 366 AtomicString(idList.substring(startPos, endPos - startPos))); | 366 AtomicString(idList.substring(startPos, endPos - startPos))); |
| 367 if (node && resultSet.add(node).isNewEntry) | 367 if (node && resultSet.insert(node).isNewEntry) |
| 368 result->append(node); | 368 result->append(node); |
| 369 | 369 |
| 370 startPos = endPos; | 370 startPos = endPos; |
| 371 } | 371 } |
| 372 | 372 |
| 373 result->markSorted(false); | 373 result->markSorted(false); |
| 374 | 374 |
| 375 return Value(result, Value::adopt); | 375 return Value(result, Value::adopt); |
| 376 } | 376 } |
| 377 | 377 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 return nullptr; | 763 return nullptr; |
| 764 | 764 |
| 765 Function* function = functionRec->factoryFn(); | 765 Function* function = functionRec->factoryFn(); |
| 766 function->setArguments(args); | 766 function->setArguments(args); |
| 767 function->setName(name); | 767 function->setName(name); |
| 768 return function; | 768 return function; |
| 769 } | 769 } |
| 770 | 770 |
| 771 } // namespace XPath | 771 } // namespace XPath |
| 772 } // namespace blink | 772 } // namespace blink |
| OLD | NEW |