Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: Source/core/layout/LayoutInline.cpp

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase to master Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) { 581 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
582 if (curr->isFloatingOrOutOfFlowPositioned()) 582 if (curr->isFloatingOrOutOfFlowPositioned())
583 continue; 583 continue;
584 584
585 // We want to get the margin box in the inline direction, and then use o ur font ascent/descent in the block 585 // We want to get the margin box in the inline direction, and then use o ur font ascent/descent in the block
586 // direction (aligned to the root box's baseline). 586 // direction (aligned to the root box's baseline).
587 if (curr->isBox()) { 587 if (curr->isBox()) {
588 LayoutBox* currBox = toLayoutBox(curr); 588 LayoutBox* currBox = toLayoutBox(curr);
589 if (currBox->inlineBoxWrapper()) { 589 if (currBox->inlineBoxWrapper()) {
590 RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root(); 590 RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root();
591 int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styl e(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style( rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); 591 int logicalTop = rootBox.logicalTop() + (rootBox.layoutObject(). style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->st yle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
592 int logicalHeight = container->style(rootBox.isFirstLineStyle()) ->font().fontMetrics().height(); 592 int logicalHeight = container->style(rootBox.isFirstLineStyle()) ->font().fontMetrics().height();
593 if (isHorizontal) 593 if (isHorizontal)
594 yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox-> marginLeft(), logicalTop, (currBox->size().width() + currBox->marginWidth()).toF loat(), logicalHeight)); 594 yield(FloatRect(currBox->inlineBoxWrapper()->x() - currBox-> marginLeft(), logicalTop, (currBox->size().width() + currBox->marginWidth()).toF loat(), logicalHeight));
595 else 595 else
596 yield(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, (currBox->size().height() + currBox->mar ginHeight()).toFloat())); 596 yield(FloatRect(logicalTop, currBox->inlineBoxWrapper()->y() - currBox->marginTop(), logicalHeight, (currBox->size().height() + currBox->mar ginHeight()).toFloat()));
597 } 597 }
598 } else if (curr->isLayoutInline()) { 598 } else if (curr->isLayoutInline()) {
599 // If the child doesn't need line boxes either, then we can recur. 599 // If the child doesn't need line boxes either, then we can recur.
600 LayoutInline* currInline = toLayoutInline(curr); 600 LayoutInline* currInline = toLayoutInline(curr);
601 if (!currInline->alwaysCreateLineBoxes()) { 601 if (!currInline->alwaysCreateLineBoxes()) {
602 currInline->generateCulledLineBoxRects(yield, container); 602 currInline->generateCulledLineBoxRects(yield, container);
603 } else { 603 } else {
604 for (InlineFlowBox* childLine = currInline->firstLineBox(); chil dLine; childLine = childLine->nextLineBox()) { 604 for (InlineFlowBox* childLine = currInline->firstLineBox(); chil dLine; childLine = childLine->nextLineBox()) {
605 RootInlineBox& rootBox = childLine->root(); 605 RootInlineBox& rootBox = childLine->root();
606 int logicalTop = rootBox.logicalTop() + (rootBox.renderer(). style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->st yle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); 606 int logicalTop = rootBox.logicalTop() + (rootBox.layoutObjec t().style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container ->style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
607 int logicalHeight = container->style(rootBox.isFirstLineStyl e())->font().fontMetrics().height(); 607 int logicalHeight = container->style(rootBox.isFirstLineStyl e())->font().fontMetrics().height();
608 if (isHorizontal) { 608 if (isHorizontal) {
609 yield(FloatRect(childLine->x() - childLine->marginLogica lLeft(), 609 yield(FloatRect(childLine->x() - childLine->marginLogica lLeft(),
610 logicalTop, 610 logicalTop,
611 childLine->logicalWidth() + childLine->marginLogical Left() + childLine->marginLogicalRight(), 611 childLine->logicalWidth() + childLine->marginLogical Left() + childLine->marginLogicalRight(),
612 logicalHeight)); 612 logicalHeight));
613 } else { 613 } else {
614 yield(FloatRect(logicalTop, 614 yield(FloatRect(logicalTop,
615 childLine->y() - childLine->marginLogicalLeft(), 615 childLine->y() - childLine->marginLogicalLeft(),
616 logicalHeight, 616 logicalHeight,
617 childLine->logicalWidth() + childLine->marginLogical Left() + childLine->marginLogicalRight())); 617 childLine->logicalWidth() + childLine->marginLogical Left() + childLine->marginLogicalRight()));
618 } 618 }
619 } 619 }
620 } 620 }
621 } else if (curr->isText()) { 621 } else if (curr->isText()) {
622 LayoutText* currText = toLayoutText(curr); 622 LayoutText* currText = toLayoutText(curr);
623 for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) { 623 for (InlineTextBox* childText = currText->firstTextBox(); childText; childText = childText->nextTextBox()) {
624 RootInlineBox& rootBox = childText->root(); 624 RootInlineBox& rootBox = childText->root();
625 int logicalTop = rootBox.logicalTop() + (rootBox.renderer().styl e(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->style( rootBox.isFirstLineStyle())->font().fontMetrics().ascent()); 625 int logicalTop = rootBox.logicalTop() + (rootBox.layoutObject(). style(rootBox.isFirstLineStyle())->font().fontMetrics().ascent() - container->st yle(rootBox.isFirstLineStyle())->font().fontMetrics().ascent());
626 int logicalHeight = container->style(rootBox.isFirstLineStyle()) ->font().fontMetrics().height(); 626 int logicalHeight = container->style(rootBox.isFirstLineStyle()) ->font().fontMetrics().height();
627 if (isHorizontal) 627 if (isHorizontal)
628 yield(FloatRect(childText->x(), logicalTop, childText->logic alWidth(), logicalHeight)); 628 yield(FloatRect(childText->x(), logicalTop, childText->logic alWidth(), logicalHeight));
629 else 629 else
630 yield(FloatRect(logicalTop, childText->y(), logicalHeight, c hildText->logicalWidth())); 630 yield(FloatRect(logicalTop, childText->y(), logicalHeight, c hildText->logicalWidth()));
631 } 631 }
632 } 632 }
633 } 633 }
634 } 634 }
635 635
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1245 { 1245 {
1246 if (result.innerNode()) 1246 if (result.innerNode())
1247 return; 1247 return;
1248 1248
1249 Node* n = node(); 1249 Node* n = node();
1250 LayoutPoint localPoint(point); 1250 LayoutPoint localPoint(point);
1251 if (n) { 1251 if (n) {
1252 if (isInlineElementContinuation()) { 1252 if (isInlineElementContinuation()) {
1253 // We're in the continuation of a split inline. Adjust our local po int to be in the coordinate space 1253 // We're in the continuation of a split inline. Adjust our local po int to be in the coordinate space
1254 // of the principal renderer's containing block. This will end up b eing the innerNonSharedNode. 1254 // of the principal renderer's containing block. This will end up b eing the innerNonSharedNode.
1255 LayoutBlock* firstBlock = n->renderer()->containingBlock(); 1255 LayoutBlock* firstBlock = n->layoutObject()->containingBlock();
1256 1256
1257 // Get our containing block. 1257 // Get our containing block.
1258 LayoutBox* block = containingBlock(); 1258 LayoutBox* block = containingBlock();
1259 localPoint.moveBy(block->location() - firstBlock->locationOffset()); 1259 localPoint.moveBy(block->location() - firstBlock->locationOffset());
1260 } 1260 }
1261 1261
1262 result.setInnerNode(n); 1262 result.setInnerNode(n);
1263 if (!result.innerNonSharedNode()) 1263 if (!result.innerNonSharedNode())
1264 result.setInnerNonSharedNode(n); 1264 result.setInnerNonSharedNode(n);
1265 result.setLocalPoint(localPoint); 1265 result.setLocalPoint(localPoint);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 } 1456 }
1457 1457
1458 void LayoutInline::invalidateDisplayItemClients(DisplayItemList* displayItemList ) const 1458 void LayoutInline::invalidateDisplayItemClients(DisplayItemList* displayItemList ) const
1459 { 1459 {
1460 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList); 1460 LayoutBoxModelObject::invalidateDisplayItemClients(displayItemList);
1461 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1461 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1462 displayItemList->invalidate(box->displayItemClient()); 1462 displayItemList->invalidate(box->displayItemClient());
1463 } 1463 }
1464 1464
1465 } // namespace blink 1465 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698