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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 { | 447 { |
448 const ComputedStyle& styleToUse = styleRef(); | 448 const ComputedStyle& styleToUse = styleRef(); |
449 setHasBoxDecorationBackground(calculateHasBoxDecorations()); | 449 setHasBoxDecorationBackground(calculateHasBoxDecorations()); |
450 setInline(styleToUse.isDisplayInlineType()); | 450 setInline(styleToUse.isDisplayInlineType()); |
451 setPositionState(styleToUse.position()); | 451 setPositionState(styleToUse.position()); |
452 setHorizontalWritingMode(styleToUse.isHorizontalWritingMode()); | 452 setHorizontalWritingMode(styleToUse.isHorizontalWritingMode()); |
453 } | 453 } |
454 | 454 |
455 static LayoutSize accumulateInFlowPositionOffsets(const LayoutObject* child) | 455 static LayoutSize accumulateInFlowPositionOffsets(const LayoutObject* child) |
456 { | 456 { |
457 if (!child->isAnonymousBlock() || !child->isRelPositioned()) | 457 if (!child->isAnonymousBlock() || !child->isInFlowPositioned()) |
458 return LayoutSize(); | 458 return LayoutSize(); |
459 LayoutSize offset; | 459 LayoutSize offset; |
460 LayoutObject* p = toLayoutBlock(child)->inlineElementContinuation(); | 460 LayoutObject* p = toLayoutBlock(child)->inlineElementContinuation(); |
461 while (p && p->isLayoutInline()) { | 461 while (p && p->isLayoutInline()) { |
462 if (p->isRelPositioned()) { | 462 if (p->isInFlowPositioned()) { |
463 LayoutInline* layoutInline = toLayoutInline(p); | 463 LayoutInline* layoutInline = toLayoutInline(p); |
464 offset += layoutInline->offsetForInFlowPosition(); | 464 offset += layoutInline->offsetForInFlowPosition(); |
465 } | 465 } |
466 p = p->parent(); | 466 p = p->parent(); |
467 } | 467 } |
468 return offset; | 468 return offset; |
469 } | 469 } |
470 | 470 |
471 LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length
logicalHeight) const | 471 LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length
logicalHeight) const |
472 { | 472 { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 // return the distance between the canvas origin and the left border edge | 569 // return the distance between the canvas origin and the left border edge |
570 // of the element and stop this algorithm. | 570 // of the element and stop this algorithm. |
571 Element* element = offsetParent(); | 571 Element* element = offsetParent(); |
572 if (!element) | 572 if (!element) |
573 return referencePoint; | 573 return referencePoint; |
574 | 574 |
575 if (const LayoutBoxModelObject* offsetParent = element->layoutBoxModelObject
()) { | 575 if (const LayoutBoxModelObject* offsetParent = element->layoutBoxModelObject
()) { |
576 if (offsetParent->isBox() && !offsetParent->isBody()) | 576 if (offsetParent->isBox() && !offsetParent->isBody()) |
577 referencePoint.move(-toLayoutBox(offsetParent)->borderLeft(), -toLay
outBox(offsetParent)->borderTop()); | 577 referencePoint.move(-toLayoutBox(offsetParent)->borderLeft(), -toLay
outBox(offsetParent)->borderTop()); |
578 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { | 578 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { |
579 if (isRelPositioned()) | 579 if (isInFlowPositioned()) |
580 referencePoint.move(relativePositionOffset()); | 580 referencePoint.move(relativePositionOffset()); |
581 | 581 |
582 LayoutObject* current; | 582 LayoutObject* current; |
583 for (current = parent(); current != offsetParent && current->parent(
); current = current->parent()) { | 583 for (current = parent(); current != offsetParent && current->parent(
); current = current->parent()) { |
584 // FIXME: What are we supposed to do inside SVG content? | 584 // FIXME: What are we supposed to do inside SVG content? |
585 if (!isOutOfFlowPositioned()) { | 585 if (!isOutOfFlowPositioned()) { |
586 if (current->isBox() && !current->isTableRow()) | 586 if (current->isBox() && !current->isTableRow()) |
587 referencePoint.moveBy(toLayoutBox(current)->topLeftLocat
ion()); | 587 referencePoint.moveBy(toLayoutBox(current)->topLeftLocat
ion()); |
588 referencePoint.move(current->parent()->columnOffset(referenc
ePoint)); | 588 referencePoint.move(current->parent()->columnOffset(referenc
ePoint)); |
589 } | 589 } |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 if (rootElementStyle->hasBackground()) | 1003 if (rootElementStyle->hasBackground()) |
1004 return false; | 1004 return false; |
1005 | 1005 |
1006 if (node() != document().firstBodyElement()) | 1006 if (node() != document().firstBodyElement()) |
1007 return false; | 1007 return false; |
1008 | 1008 |
1009 return true; | 1009 return true; |
1010 } | 1010 } |
1011 | 1011 |
1012 } // namespace blink | 1012 } // namespace blink |
OLD | NEW |