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

Side by Side Diff: Source/core/layout/line/InlineFlowBox.cpp

Issue 1183003003: Move overflow in InlineTextBox::adjustPosition() if it has glyph overflows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add comments Created 5 years, 6 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) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 attachLineBoxToLayoutObject(); 248 attachLineBoxToLayoutObject();
249 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) 249 for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
250 child->attachLine(); 250 child->attachLine();
251 } 251 }
252 252
253 void InlineFlowBox::attachLineBoxToLayoutObject() 253 void InlineFlowBox::attachLineBoxToLayoutObject()
254 { 254 {
255 lineBoxes()->attachLineBox(this); 255 lineBoxes()->attachLineBox(this);
256 } 256 }
257 257
258 void InlineFlowBox::adjustPosition(LayoutUnit dx, LayoutUnit dy) 258 void InlineFlowBox::move(const LayoutSize& delta)
259 { 259 {
260 InlineBox::adjustPosition(dx, dy); 260 InlineBox::move(delta);
261 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) { 261 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
262 if (child->layoutObject().isOutOfFlowPositioned()) 262 if (child->layoutObject().isOutOfFlowPositioned())
263 continue; 263 continue;
264 child->adjustPosition(dx, dy); 264 child->move(delta);
265 } 265 }
266 if (m_overflow) 266 if (m_overflow)
267 m_overflow->move(dx, dy); // FIXME: Rounding error here since overflow w as pixel snapped, but nobody other than list markers passes non-integral values here. 267 m_overflow->move(delta.width(), delta.height()); // FIXME: Rounding erro r here since overflow was pixel snapped, but nobody other than list markers pass es non-integral values here.
leviw_travelin_and_unemployed 2015/06/16 20:09:17 Grumble grumble about more dx dy (not an issue wit
Xianzhu 2015/06/16 20:43:23 Acknowledged.
268 } 268 }
269 269
270 LineBoxList* InlineFlowBox::lineBoxes() const 270 LineBoxList* InlineFlowBox::lineBoxes() const
271 { 271 {
272 return toLayoutInline(layoutObject()).lineBoxes(); 272 return toLayoutInline(layoutObject()).lineBoxes();
273 } 273 }
274 274
275 static inline bool isLastChildForLayoutObject(LayoutObject* ancestor, LayoutObje ct* child) 275 static inline bool isLastChildForLayoutObject(LayoutObject* ancestor, LayoutObje ct* child)
276 { 276 {
277 if (!child) 277 if (!child)
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 adjustmentForChildrenWithSameLineHeightAndBaseline = logicalTop(); 590 adjustmentForChildrenWithSameLineHeightAndBaseline = logicalTop();
591 if (parent()) 591 if (parent())
592 adjustmentForChildrenWithSameLineHeightAndBaseline += (boxModelObjec t()->borderBefore() + boxModelObject()->paddingBefore()); 592 adjustmentForChildrenWithSameLineHeightAndBaseline += (boxModelObjec t()->borderBefore() + boxModelObject()->paddingBefore());
593 } 593 }
594 594
595 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { 595 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
596 if (curr->layoutObject().isOutOfFlowPositioned()) 596 if (curr->layoutObject().isOutOfFlowPositioned())
597 continue; // Positioned placeholders don't affect calculations. 597 continue; // Positioned placeholders don't affect calculations.
598 598
599 if (descendantsHaveSameLineHeightAndBaseline()) { 599 if (descendantsHaveSameLineHeightAndBaseline()) {
600 curr->adjustBlockDirectionPosition(adjustmentForChildrenWithSameLine HeightAndBaseline.toFloat()); 600 curr->moveInBlockDirection(adjustmentForChildrenWithSameLineHeightAn dBaseline.toFloat());
601 continue; 601 continue;
602 } 602 }
603 603
604 InlineFlowBox* inlineFlowBox = curr->isInlineFlowBox() ? toInlineFlowBox (curr) : nullptr; 604 InlineFlowBox* inlineFlowBox = curr->isInlineFlowBox() ? toInlineFlowBox (curr) : nullptr;
605 bool childAffectsTopBottomPos = true; 605 bool childAffectsTopBottomPos = true;
606 if (curr->verticalAlign() == TOP) { 606 if (curr->verticalAlign() == TOP) {
607 curr->setLogicalTop(top.toFloat()); 607 curr->setLogicalTop(top.toFloat());
608 } else if (curr->verticalAlign() == BOTTOM) { 608 } else if (curr->verticalAlign() == BOTTOM) {
609 curr->setLogicalTop((top + maxHeight - curr->lineHeight()).toFloat() ); 609 curr->setLogicalTop((top + maxHeight - curr->lineHeight()).toFloat() );
610 } else { 610 } else {
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 ASSERT(child->prevOnLine() == prev); 1311 ASSERT(child->prevOnLine() == prev);
1312 prev = child; 1312 prev = child;
1313 } 1313 }
1314 ASSERT(prev == m_lastChild); 1314 ASSERT(prev == m_lastChild);
1315 #endif 1315 #endif
1316 } 1316 }
1317 1317
1318 #endif 1318 #endif
1319 1319
1320 } // namespace blink 1320 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698