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

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

Issue 1183003003: Move overflow in InlineTextBox::adjustPosition() if it has glyph overflows (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/InlineBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 RootInlineBox& root = m_marker->inlineBoxWrapper()->root(); 333 RootInlineBox& root = m_marker->inlineBoxWrapper()->root();
334 bool hitSelfPaintingLayer = false; 334 bool hitSelfPaintingLayer = false;
335 335
336 LayoutUnit lineTop = root.lineTop(); 336 LayoutUnit lineTop = root.lineTop();
337 LayoutUnit lineBottom = root.lineBottom(); 337 LayoutUnit lineBottom = root.lineBottom();
338 338
339 // FIXME: Need to account for relative positioning in the layout overflo w. 339 // FIXME: Need to account for relative positioning in the layout overflo w.
340 if (style()->isLeftToRightDirection()) { 340 if (style()->isLeftToRightDirection()) {
341 LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, lo gicalLeftOffsetForLine(blockOffset, false), false); 341 LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, lo gicalLeftOffsetForLine(blockOffset, false), false);
342 markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - b orderStart() + m_marker->marginStart(); 342 markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - b orderStart() + m_marker->marginStart();
343 m_marker->inlineBoxWrapper()->adjustLineDirectionPosition((markerLog icalLeft - markerOldLogicalLeft).toFloat()); 343 m_marker->inlineBoxWrapper()->moveInInlineDirection((markerLogicalLe ft - markerOldLogicalLeft).toFloat());
344 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo x; box = box->parent()) { 344 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo x; box = box->parent()) {
345 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver flowRect(lineTop, lineBottom); 345 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver flowRect(lineTop, lineBottom);
346 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver flowRect(lineTop, lineBottom); 346 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver flowRect(lineTop, lineBottom);
347 if (markerLogicalLeft < newLogicalVisualOverflowRect.x() && !hit SelfPaintingLayer) { 347 if (markerLogicalLeft < newLogicalVisualOverflowRect.x() && !hit SelfPaintingLayer) {
348 newLogicalVisualOverflowRect.setWidth(newLogicalVisualOverfl owRect.maxX() - markerLogicalLeft); 348 newLogicalVisualOverflowRect.setWidth(newLogicalVisualOverfl owRect.maxX() - markerLogicalLeft);
349 newLogicalVisualOverflowRect.setX(markerLogicalLeft); 349 newLogicalVisualOverflowRect.setX(markerLogicalLeft);
350 if (box == root) 350 if (box == root)
351 adjustOverflow = true; 351 adjustOverflow = true;
352 } 352 }
353 if (markerLogicalLeft < newLogicalLayoutOverflowRect.x()) { 353 if (markerLogicalLeft < newLogicalLayoutOverflowRect.x()) {
354 newLogicalLayoutOverflowRect.setWidth(newLogicalLayoutOverfl owRect.maxX() - markerLogicalLeft); 354 newLogicalLayoutOverflowRect.setWidth(newLogicalLayoutOverfl owRect.maxX() - markerLogicalLeft);
355 newLogicalLayoutOverflowRect.setX(markerLogicalLeft); 355 newLogicalLayoutOverflowRect.setX(markerLogicalLeft);
356 if (box == root) 356 if (box == root)
357 adjustOverflow = true; 357 adjustOverflow = true;
358 } 358 }
359 box->setOverflowFromLogicalRects(newLogicalLayoutOverflowRect, n ewLogicalVisualOverflowRect, lineTop, lineBottom); 359 box->setOverflowFromLogicalRects(newLogicalLayoutOverflowRect, n ewLogicalVisualOverflowRect, lineTop, lineBottom);
360 if (box->boxModelObject()->hasSelfPaintingLayer()) 360 if (box->boxModelObject()->hasSelfPaintingLayer())
361 hitSelfPaintingLayer = true; 361 hitSelfPaintingLayer = true;
362 } 362 }
363 } else { 363 } else {
364 LayoutUnit rightLineOffset = logicalRightOffsetForLine(blockOffset, logicalRightOffsetForLine(blockOffset, false), false); 364 LayoutUnit rightLineOffset = logicalRightOffsetForLine(blockOffset, logicalRightOffsetForLine(blockOffset, false), false);
365 markerLogicalLeft = rightLineOffset - lineOffset + paddingStart() + borderStart() + m_marker->marginEnd(); 365 markerLogicalLeft = rightLineOffset - lineOffset + paddingStart() + borderStart() + m_marker->marginEnd();
366 m_marker->inlineBoxWrapper()->adjustLineDirectionPosition((markerLog icalLeft - markerOldLogicalLeft).toFloat()); 366 m_marker->inlineBoxWrapper()->moveInInlineDirection((markerLogicalLe ft - markerOldLogicalLeft).toFloat());
367 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo x; box = box->parent()) { 367 for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); bo x; box = box->parent()) {
368 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver flowRect(lineTop, lineBottom); 368 LayoutRect newLogicalVisualOverflowRect = box->logicalVisualOver flowRect(lineTop, lineBottom);
369 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver flowRect(lineTop, lineBottom); 369 LayoutRect newLogicalLayoutOverflowRect = box->logicalLayoutOver flowRect(lineTop, lineBottom);
370 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalVis ualOverflowRect.maxX() && !hitSelfPaintingLayer) { 370 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalVis ualOverflowRect.maxX() && !hitSelfPaintingLayer) {
371 newLogicalVisualOverflowRect.setWidth(markerLogicalLeft + m_ marker->logicalWidth() - newLogicalVisualOverflowRect.x()); 371 newLogicalVisualOverflowRect.setWidth(markerLogicalLeft + m_ marker->logicalWidth() - newLogicalVisualOverflowRect.x());
372 if (box == root) 372 if (box == root)
373 adjustOverflow = true; 373 adjustOverflow = true;
374 } 374 }
375 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalLay outOverflowRect.maxX()) { 375 if (markerLogicalLeft + m_marker->logicalWidth() > newLogicalLay outOverflowRect.maxX()) {
376 newLogicalLayoutOverflowRect.setWidth(markerLogicalLeft + m_ marker->logicalWidth() - newLogicalLayoutOverflowRect.x()); 376 newLogicalLayoutOverflowRect.setWidth(markerLogicalLeft + m_ marker->logicalWidth() - newLogicalLayoutOverflowRect.x());
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 // assume that all the following ones have too. 498 // assume that all the following ones have too.
499 // This gives us the opportunity to stop here and avoid 499 // This gives us the opportunity to stop here and avoid
500 // marking the same nodes again. 500 // marking the same nodes again.
501 break; 501 break;
502 } 502 }
503 item->updateValue(); 503 item->updateValue();
504 } 504 }
505 } 505 }
506 506
507 } // namespace blink 507 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/core/layout/line/InlineBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698