Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 | 295 |
| 296 LayoutUnit LayoutMultiColumnFlowThread::tallestUnbreakableLogicalHeight(LayoutUn it offsetInFlowThread) const | 296 LayoutUnit LayoutMultiColumnFlowThread::tallestUnbreakableLogicalHeight(LayoutUn it offsetInFlowThread) const |
| 297 { | 297 { |
| 298 if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offsetInFlowT hread)) | 298 if (LayoutMultiColumnSet* multicolSet = columnSetAtBlockOffset(offsetInFlowT hread)) |
| 299 return multicolSet->tallestUnbreakableLogicalHeight(); | 299 return multicolSet->tallestUnbreakableLogicalHeight(); |
| 300 return LayoutUnit(); | 300 return LayoutUnit(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 LayoutSize LayoutMultiColumnFlowThread::columnOffset(const LayoutPoint& point) c onst | 303 LayoutSize LayoutMultiColumnFlowThread::columnOffset(const LayoutPoint& point) c onst |
| 304 { | 304 { |
| 305 if (!hasValidColumnSetInfo()) | 305 return flowThreadTranslationAtPoint(point, CoordinateSpaceConversion::Contai ning); |
| 306 return LayoutSize(0, 0); | |
| 307 | |
| 308 LayoutPoint flowThreadPoint = flipForWritingMode(point); | |
| 309 LayoutUnit blockOffset = isHorizontalWritingMode() ? flowThreadPoint.y() : f lowThreadPoint.x(); | |
| 310 return flowThreadTranslationAtOffset(blockOffset); | |
| 311 } | 306 } |
| 312 | 307 |
| 313 bool LayoutMultiColumnFlowThread::needsNewWidth() const | 308 bool LayoutMultiColumnFlowThread::needsNewWidth() const |
| 314 { | 309 { |
| 315 LayoutUnit newWidth; | 310 LayoutUnit newWidth; |
| 316 unsigned dummyColumnCount; // We only care if used column-width changes. | 311 unsigned dummyColumnCount; // We only care if used column-width changes. |
| 317 calculateColumnCountAndWidth(newWidth, dummyColumnCount); | 312 calculateColumnCountAndWidth(newWidth, dummyColumnCount); |
| 318 return newWidth != logicalWidth(); | 313 return newWidth != logicalWidth(); |
| 319 } | 314 } |
| 320 | 315 |
| 321 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 316 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
| 322 { | 317 { |
| 323 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 318 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
| 324 return columnSet->isPageLogicalHeightKnown(); | 319 return columnSet->isPageLogicalHeightKnown(); |
| 325 return false; | 320 return false; |
| 326 } | 321 } |
| 327 | 322 |
| 328 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) const | 323 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread, CoordinateSpaceConversion mode) const |
| 329 { | 324 { |
| 325 if (!hasValidColumnSetInfo()) | |
| 326 return LayoutSize(0, 0); | |
| 330 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread) ; | 327 LayoutMultiColumnSet* columnSet = columnSetAtBlockOffset(offsetInFlowThread) ; |
| 331 if (!columnSet) | 328 if (!columnSet) |
| 332 return LayoutSize(0, 0); | 329 return LayoutSize(0, 0); |
| 333 return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread); | 330 return columnSet->flowThreadTranslationAtOffset(offsetInFlowThread, mode); |
| 331 } | |
| 332 | |
| 333 LayoutSize LayoutMultiColumnFlowThread::flowThreadTranslationAtPoint(const Layou tPoint& flowThreadPoint, CoordinateSpaceConversion mode) const | |
| 334 { | |
| 335 LayoutPoint flippedPoint = flipForWritingMode(flowThreadPoint); | |
| 336 LayoutUnit blockOffset = isHorizontalWritingMode() ? flippedPoint.y() : flip pedPoint.x(); | |
|
Xianzhu
2016/04/20 20:50:12
This CL also changes how we handle writing-mode in
mstensho (USE GERRIT)
2016/04/20 21:02:24
Yes, we have tests for multicol + writing modes, b
| |
| 337 return flowThreadTranslationAtOffset(blockOffset, mode); | |
| 338 } | |
| 339 | |
| 340 LayoutPoint LayoutMultiColumnFlowThread::flowThreadPointToVisualPoint(const Layo utPoint& flowThreadPoint) const | |
| 341 { | |
| 342 return flowThreadPoint + flowThreadTranslationAtPoint(flowThreadPoint, Coord inateSpaceConversion::Visual); | |
| 334 } | 343 } |
| 335 | 344 |
| 336 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo utPoint& visualPoint) const | 345 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo utPoint& visualPoint) const |
| 337 { | 346 { |
| 338 LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visua lPoint.x(); | 347 LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visua lPoint.x(); |
| 339 const LayoutMultiColumnSet* columnSet = nullptr; | 348 const LayoutMultiColumnSet* columnSet = nullptr; |
| 340 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat e; candidate = candidate->nextSiblingMultiColumnSet()) { | 349 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat e; candidate = candidate->nextSiblingMultiColumnSet()) { |
| 341 columnSet = candidate; | 350 columnSet = candidate; |
| 342 if (candidate->logicalBottom() > blockOffset) | 351 if (candidate->logicalBottom() > blockOffset) |
| 343 break; | 352 break; |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1020 } | 1029 } |
| 1021 if (canContainSpannerInParentFragmentationContext(*object)) | 1030 if (canContainSpannerInParentFragmentationContext(*object)) |
| 1022 next = object->nextInPreOrder(&root); | 1031 next = object->nextInPreOrder(&root); |
| 1023 else | 1032 else |
| 1024 next = object->nextInPreOrderAfterChildren(&root); | 1033 next = object->nextInPreOrderAfterChildren(&root); |
| 1025 } | 1034 } |
| 1026 return true; | 1035 return true; |
| 1027 } | 1036 } |
| 1028 | 1037 |
| 1029 } // namespace blink | 1038 } // namespace blink |
| OLD | NEW |