| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/rendering/RenderNamedFlowThread.h" | 27 #include "core/rendering/RenderNamedFlowThread.h" |
| 28 | 28 |
| 29 #include "RuntimeEnabledFeatures.h" | 29 #include "RuntimeEnabledFeatures.h" |
| 30 #include "bindings/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 31 #include "core/dom/NamedFlow.h" | 31 #include "core/dom/NamedFlow.h" |
| 32 #include "core/dom/NodeRenderingContext.h" | 32 #include "core/dom/NodeRenderingTraversal.h" |
| 33 #include "core/dom/NodeTraversal.h" | 33 #include "core/dom/NodeTraversal.h" |
| 34 #include "core/dom/Position.h" | 34 #include "core/dom/Position.h" |
| 35 #include "core/dom/Range.h" | 35 #include "core/dom/Range.h" |
| 36 #include "core/dom/Text.h" | 36 #include "core/dom/Text.h" |
| 37 #include "core/inspector/InspectorInstrumentation.h" | 37 #include "core/inspector/InspectorInstrumentation.h" |
| 38 #include "core/rendering/FlowThreadController.h" | 38 #include "core/rendering/FlowThreadController.h" |
| 39 #include "core/rendering/InlineTextBox.h" | 39 #include "core/rendering/InlineTextBox.h" |
| 40 #include "core/rendering/RenderInline.h" | 40 #include "core/rendering/RenderInline.h" |
| 41 #include "core/rendering/RenderRegion.h" | 41 #include "core/rendering/RenderRegion.h" |
| 42 #include "core/rendering/RenderText.h" | 42 #include "core/rendering/RenderText.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 setMarkForDestruction(); | 448 setMarkForDestruction(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 const AtomicString& RenderNamedFlowThread::flowThreadName() const | 451 const AtomicString& RenderNamedFlowThread::flowThreadName() const |
| 452 { | 452 { |
| 453 return m_namedFlow->name(); | 453 return m_namedFlow->name(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 bool RenderNamedFlowThread::isChildAllowed(RenderObject* child, RenderStyle* sty
le) const | 456 bool RenderNamedFlowThread::isChildAllowed(RenderObject* child, RenderStyle* sty
le) const |
| 457 { | 457 { |
| 458 ASSERT(child); | |
| 459 ASSERT(style); | |
| 460 | |
| 461 if (!child->node()) | 458 if (!child->node()) |
| 462 return true; | 459 return true; |
| 463 | 460 |
| 464 ASSERT(child->node()->isElementNode()); | 461 ASSERT(child->node()->isElementNode()); |
| 465 RenderObject* parentRenderer = NodeRenderingContext(child->node()).parentRen
derer(); | 462 Node* originalParent = NodeRenderingTraversal::parent(child->node()); |
| 466 if (!parentRenderer) | 463 if (!originalParent || !originalParent->renderer()) |
| 467 return true; | 464 return true; |
| 468 | 465 |
| 469 return parentRenderer->isChildAllowed(child, style); | 466 return originalParent->renderer()->isChildAllowed(child, style); |
| 470 } | 467 } |
| 471 | 468 |
| 472 void RenderNamedFlowThread::dispatchRegionLayoutUpdateEvent() | 469 void RenderNamedFlowThread::dispatchRegionLayoutUpdateEvent() |
| 473 { | 470 { |
| 474 RenderFlowThread::dispatchRegionLayoutUpdateEvent(); | 471 RenderFlowThread::dispatchRegionLayoutUpdateEvent(); |
| 475 InspectorInstrumentation::didUpdateRegionLayout(document(), m_namedFlow.get(
)); | 472 InspectorInstrumentation::didUpdateRegionLayout(document(), m_namedFlow.get(
)); |
| 476 | 473 |
| 477 if (!m_regionLayoutUpdateEventTimer.isActive() && m_namedFlow->hasEventListe
ners()) | 474 if (!m_regionLayoutUpdateEventTimer.isActive() && m_namedFlow->hasEventListe
ners()) |
| 478 m_regionLayoutUpdateEventTimer.startOneShot(0); | 475 m_regionLayoutUpdateEventTimer.startOneShot(0); |
| 479 } | 476 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 lastEndNode = node; | 684 lastEndNode = node; |
| 688 } | 685 } |
| 689 } | 686 } |
| 690 } | 687 } |
| 691 if (foundStartPosition || skipOverOutsideNodes) | 688 if (foundStartPosition || skipOverOutsideNodes) |
| 692 rangeObjects.append(range); | 689 rangeObjects.append(range); |
| 693 } | 690 } |
| 694 } | 691 } |
| 695 | 692 |
| 696 } | 693 } |
| OLD | NEW |