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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp

Issue 2339973002: Handle exclusive end offsets when translating from flow thread coordinates. (Closed)
Patch Set: Documentation Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 return newWidth != logicalWidth(); 325 return newWidth != logicalWidth();
326 } 326 }
327 327
328 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const 328 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const
329 { 329 {
330 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) 330 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet())
331 return columnSet->isPageLogicalHeightKnown(); 331 return columnSet->isPageLogicalHeightKnown();
332 return false; 332 return false;
333 } 333 }
334 334
335 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread, CoordinateSpaceConversion mode) const 335 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread, PageBoundaryRule rule, CoordinateSpaceConversion mode) cons t
336 { 336 {
337 if (!hasValidColumnSetInfo()) 337 if (!hasValidColumnSetInfo())
338 return LayoutSize(0, 0); 338 return LayoutSize(0, 0);
339 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread) ; 339 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread) ;
340 if (!columnSet) 340 if (!columnSet)
341 return LayoutSize(0, 0); 341 return LayoutSize(0, 0);
342 return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread, mode); 342 return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread, rule, mo de);
343 } 343 }
344 344
345 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtPoint(const Layou tPoint& flowThreadPoint, CoordinateSpaceConversion mode) const 345 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtPoint(const Layou tPoint& flowThreadPoint, CoordinateSpaceConversion mode) const
346 { 346 {
347 LayoutPoint flippedPoint = flipForWritingMode(flowThreadPoint); 347 LayoutPoint flippedPoint = flipForWritingMode(flowThreadPoint);
348 LayoutUnit blockOffset = isHorizontalWritingMode() ? flippedPoint.y() : flip pedPoint.x(); 348 LayoutUnit blockOffset = isHorizontalWritingMode() ? flippedPoint.y() : flip pedPoint.x();
349 return flowThreadTranslationAtOffset(blockOffset, mode); 349
350 // If block direction is flipped, points at a column boundary belong in the former column, not
351 // the latter.
352 PageBoundaryRule rule = hasFlippedBlocksWritingMode() ? AssociateWithFormerP age : AssociateWithLatterPage;
353
354 return flowThreadTranslationAtOffset(blockOffset, rule, mode);
350 } 355 }
351 356
352 LayoutPoint LayoutMultiColumnFlowThread::flowThreadPointToVisualPoint(const Layo utPoint& flowThreadPoint) const 357 LayoutPoint LayoutMultiColumnFlowThread::flowThreadPointToVisualPoint(const Layo utPoint& flowThreadPoint) const
353 { 358 {
354 return flowThreadPoint + flowThreadTranslationAtPoint(flowThreadPoint, Coord inateSpaceConversion::Visual); 359 return flowThreadPoint + flowThreadTranslationAtPoint(flowThreadPoint, Coord inateSpaceConversion::Visual);
355 } 360 }
356 361
357 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo utPoint& visualPoint) const 362 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo utPoint& visualPoint) const
358 { 363 {
359 LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visua lPoint.x(); 364 LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visua lPoint.x();
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 { 1056 {
1052 return MultiColumnLayoutState(m_lastSetWorkedOn); 1057 return MultiColumnLayoutState(m_lastSetWorkedOn);
1053 } 1058 }
1054 1059
1055 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState(const MultiColum nLayoutState& state) 1060 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState(const MultiColum nLayoutState& state)
1056 { 1061 {
1057 m_lastSetWorkedOn = state.columnSet(); 1062 m_lastSetWorkedOn = state.columnSet();
1058 } 1063 }
1059 1064
1060 } // namespace blink 1065 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698