OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 409 |
410 return nextPosition.isNotNull() && !nextPosition.deprecatedNode()->hasEditab
leStyle() | 410 return nextPosition.isNotNull() && !nextPosition.deprecatedNode()->hasEditab
leStyle() |
411 && prevPosition.isNotNull() && !prevPosition.deprecatedNode()->hasEditab
leStyle(); | 411 && prevPosition.isNotNull() && !prevPosition.deprecatedNode()->hasEditab
leStyle(); |
412 } | 412 } |
413 | 413 |
414 Node* Position::parentEditingBoundary() const | 414 Node* Position::parentEditingBoundary() const |
415 { | 415 { |
416 if (!m_anchorNode) | 416 if (!m_anchorNode) |
417 return 0; | 417 return 0; |
418 | 418 |
419 Node* documentElement = m_anchorNode->document().documentElement(); | 419 // FIXME: Why does this look at parentNode? |
420 if (!documentElement) | |
421 return 0; | |
422 | |
423 Node* boundary = m_anchorNode.get(); | 420 Node* boundary = m_anchorNode.get(); |
424 while (boundary != documentElement && boundary->nonShadowBoundaryParentNode(
) && m_anchorNode->hasEditableStyle() == boundary->parentNode()->hasEditableStyl
e()) | 421 while (boundary->nonShadowBoundaryParentNode() |
| 422 && boundary->nonShadowBoundaryParentNode()->isElementNode() |
| 423 && m_anchorNode->hasEditableStyle() == boundary->parentNode()->hasEdi
tableStyle()) |
425 boundary = boundary->nonShadowBoundaryParentNode(); | 424 boundary = boundary->nonShadowBoundaryParentNode(); |
426 | 425 |
427 return boundary; | 426 return boundary; |
428 } | 427 } |
429 | 428 |
430 | |
431 bool Position::atStartOfTree() const | 429 bool Position::atStartOfTree() const |
432 { | 430 { |
433 if (isNull()) | 431 if (isNull()) |
434 return true; | 432 return true; |
435 return !deprecatedNode()->parentNode() && m_offset <= 0; | 433 return !deprecatedNode()->parentNode() && m_offset <= 0; |
436 } | 434 } |
437 | 435 |
438 bool Position::atEndOfTree() const | 436 bool Position::atEndOfTree() const |
439 { | 437 { |
440 if (isNull()) | 438 if (isNull()) |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 pos.showTreeForThis(); | 1233 pos.showTreeForThis(); |
1236 } | 1234 } |
1237 | 1235 |
1238 void showTree(const blink::Position* pos) | 1236 void showTree(const blink::Position* pos) |
1239 { | 1237 { |
1240 if (pos) | 1238 if (pos) |
1241 pos->showTreeForThis(); | 1239 pos->showTreeForThis(); |
1242 } | 1240 } |
1243 | 1241 |
1244 #endif | 1242 #endif |
OLD | NEW |