OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 // One of the renderers we're skipping over here may be the child's
repaint container, | 379 // One of the renderers we're skipping over here may be the child's
repaint container, |
380 // so we can't pass our own repaint container along. | 380 // so we can't pass our own repaint container along. |
381 const RenderLayerModelObject& repaintContainerForChild = *box->conta
inerForPaintInvalidation(); | 381 const RenderLayerModelObject& repaintContainerForChild = *box->conta
inerForPaintInvalidation(); |
382 | 382 |
383 // If the positioned renderer is absolutely positioned and it is ins
ide | 383 // If the positioned renderer is absolutely positioned and it is ins
ide |
384 // a relatively positioend inline element, we need to account for | 384 // a relatively positioend inline element, we need to account for |
385 // the inline elements position in LayoutState. | 385 // the inline elements position in LayoutState. |
386 if (box->style()->position() == AbsolutePosition) { | 386 if (box->style()->position() == AbsolutePosition) { |
387 RenderObject* container = box->container(&repaintContainerForChi
ld, 0); | 387 RenderObject* container = box->container(&repaintContainerForChi
ld, 0); |
388 if (container->isInFlowPositioned() && container->isRenderInline
()) { | 388 if (container->isRelPositioned() && container->isRenderInline())
{ |
389 // FIXME: We should be able to use layout-state for this. | 389 // FIXME: We should be able to use layout-state for this. |
390 // Currently, we will place absolutly positioned elements in
side | 390 // Currently, we will place absolutly positioned elements in
side |
391 // relatively positioned inline blocks in the wrong location
. crbug.com/371485 | 391 // relatively positioned inline blocks in the wrong location
. crbug.com/371485 |
392 ForceHorriblySlowRectMapping slowRectMapping(*this); | 392 ForceHorriblySlowRectMapping slowRectMapping(*this); |
393 box->invalidateTreeAfterLayout(repaintContainerForChild); | 393 box->invalidateTreeAfterLayout(repaintContainerForChild); |
394 continue; | 394 continue; |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 box->invalidateTreeAfterLayout(repaintContainerForChild); | 398 box->invalidateTreeAfterLayout(repaintContainerForChild); |
(...skipping 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 for (curr = firstChildBox(); curr && curr->selectionState() == SelectionNone
; curr = curr->nextSiblingBox()) { } | 2355 for (curr = firstChildBox(); curr && curr->selectionState() == SelectionNone
; curr = curr->nextSiblingBox()) { } |
2356 | 2356 |
2357 for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->ne
xtSiblingBox()) { | 2357 for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; curr = curr->ne
xtSiblingBox()) { |
2358 SelectionState childState = curr->selectionState(); | 2358 SelectionState childState = curr->selectionState(); |
2359 if (childState == SelectionBoth || childState == SelectionEnd) | 2359 if (childState == SelectionBoth || childState == SelectionEnd) |
2360 sawSelectionEnd = true; | 2360 sawSelectionEnd = true; |
2361 | 2361 |
2362 if (curr->isFloatingOrOutOfFlowPositioned()) | 2362 if (curr->isFloatingOrOutOfFlowPositioned()) |
2363 continue; // We must be a normal flow object in order to even be con
sidered. | 2363 continue; // We must be a normal flow object in order to even be con
sidered. |
2364 | 2364 |
2365 if (curr->isInFlowPositioned() && curr->hasLayer()) { | 2365 if (curr->isRelPositioned() && curr->hasLayer()) { |
2366 // If the relposition offset is anything other than 0, then treat th
is just like an absolute positioned element. | 2366 // If the relposition offset is anything other than 0, then treat th
is just like an absolute positioned element. |
2367 // Just disregard it completely. | 2367 // Just disregard it completely. |
2368 LayoutSize relOffset = curr->layer()->offsetForInFlowPosition(); | 2368 LayoutSize relOffset = curr->layer()->offsetForInFlowPosition(); |
2369 if (relOffset.width() || relOffset.height()) | 2369 if (relOffset.width() || relOffset.height()) |
2370 continue; | 2370 continue; |
2371 } | 2371 } |
2372 | 2372 |
2373 bool paintsOwnSelection = curr->shouldPaintSelectionGaps() || curr->isTa
ble(); // FIXME: Eventually we won't special-case table like this. | 2373 bool paintsOwnSelection = curr->shouldPaintSelectionGaps() || curr->isTa
ble(); // FIXME: Eventually we won't special-case table like this. |
2374 bool fillBlockGaps = paintsOwnSelection || (curr->canBeSelectionLeaf() &
& childState != SelectionNone); | 2374 bool fillBlockGaps = paintsOwnSelection || (curr->canBeSelectionLeaf() &
& childState != SelectionNone); |
2375 if (fillBlockGaps) { | 2375 if (fillBlockGaps) { |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3006 return !ancestor || !ancestor->parent() || (ancestor->hasLayer() && ancestor
->parent()->isRenderView()) | 3006 return !ancestor || !ancestor->parent() || (ancestor->hasLayer() && ancestor
->parent()->isRenderView()) |
3007 || ancestor->nonPseudoNode()->rendererIsEditable() == child->nonPseudoNo
de()->rendererIsEditable(); | 3007 || ancestor->nonPseudoNode()->rendererIsEditable() == child->nonPseudoNo
de()->rendererIsEditable(); |
3008 } | 3008 } |
3009 | 3009 |
3010 // FIXME: This function should go on RenderObject as an instance method. Then | 3010 // FIXME: This function should go on RenderObject as an instance method. Then |
3011 // all cases in which positionForPoint recurs could call this instead to | 3011 // all cases in which positionForPoint recurs could call this instead to |
3012 // prevent crossing editable boundaries. This would require many tests. | 3012 // prevent crossing editable boundaries. This would require many tests. |
3013 static PositionWithAffinity positionForPointRespectingEditingBoundaries(RenderBl
ock* parent, RenderBox* child, const LayoutPoint& pointInParentCoordinates) | 3013 static PositionWithAffinity positionForPointRespectingEditingBoundaries(RenderBl
ock* parent, RenderBox* child, const LayoutPoint& pointInParentCoordinates) |
3014 { | 3014 { |
3015 LayoutPoint childLocation = child->location(); | 3015 LayoutPoint childLocation = child->location(); |
3016 if (child->isInFlowPositioned()) | 3016 if (child->isRelPositioned()) |
3017 childLocation += child->offsetForInFlowPosition(); | 3017 childLocation += child->offsetForInFlowPosition(); |
3018 | 3018 |
3019 // FIXME: This is wrong if the child's writing-mode is different from the pa
rent's. | 3019 // FIXME: This is wrong if the child's writing-mode is different from the pa
rent's. |
3020 LayoutPoint pointInChildCoordinates(toLayoutPoint(pointInParentCoordinates -
childLocation)); | 3020 LayoutPoint pointInChildCoordinates(toLayoutPoint(pointInParentCoordinates -
childLocation)); |
3021 | 3021 |
3022 // If this is an anonymous renderer, we just recur normally | 3022 // If this is an anonymous renderer, we just recur normally |
3023 Node* childNode = child->nonPseudoNode(); | 3023 Node* childNode = child->nonPseudoNode(); |
3024 if (!childNode) | 3024 if (!childNode) |
3025 return child->positionForPoint(pointInChildCoordinates); | 3025 return child->positionForPoint(pointInChildCoordinates); |
3026 | 3026 |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4882 return "RenderBlock (anonymous multi-column span)"; | 4882 return "RenderBlock (anonymous multi-column span)"; |
4883 if (isAnonymousBlock()) | 4883 if (isAnonymousBlock()) |
4884 return "RenderBlock (anonymous)"; | 4884 return "RenderBlock (anonymous)"; |
4885 // FIXME: Temporary hack while the new generated content system is being imp
lemented. | 4885 // FIXME: Temporary hack while the new generated content system is being imp
lemented. |
4886 if (isPseudoElement()) | 4886 if (isPseudoElement()) |
4887 return "RenderBlock (generated)"; | 4887 return "RenderBlock (generated)"; |
4888 if (isAnonymous()) | 4888 if (isAnonymous()) |
4889 return "RenderBlock (generated)"; | 4889 return "RenderBlock (generated)"; |
4890 if (isRelPositioned()) | 4890 if (isRelPositioned()) |
4891 return "RenderBlock (relative positioned)"; | 4891 return "RenderBlock (relative positioned)"; |
4892 if (isStickyPositioned()) | |
4893 return "RenderBlock (sticky positioned)"; | |
4894 return "RenderBlock"; | 4892 return "RenderBlock"; |
4895 } | 4893 } |
4896 | 4894 |
4897 RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const Rend
erObject* parent, EDisplay display) | 4895 RenderBlock* RenderBlock::createAnonymousWithParentRendererAndDisplay(const Rend
erObject* parent, EDisplay display) |
4898 { | 4896 { |
4899 // FIXME: Do we need to convert all our inline displays to block-type in the
anonymous logic ? | 4897 // FIXME: Do we need to convert all our inline displays to block-type in the
anonymous logic ? |
4900 EDisplay newDisplay; | 4898 EDisplay newDisplay; |
4901 RenderBlock* newBox = 0; | 4899 RenderBlock* newBox = 0; |
4902 if (display == BOX || display == INLINE_BOX) { | 4900 if (display == BOX || display == INLINE_BOX) { |
4903 // FIXME: Remove this case once we have eliminated all internal users of
old flexbox | 4901 // FIXME: Remove this case once we have eliminated all internal users of
old flexbox |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5039 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 5037 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
5040 { | 5038 { |
5041 showRenderObject(); | 5039 showRenderObject(); |
5042 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 5040 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
5043 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 5041 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
5044 } | 5042 } |
5045 | 5043 |
5046 #endif | 5044 #endif |
5047 | 5045 |
5048 } // namespace WebCore | 5046 } // namespace WebCore |
OLD | NEW |