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

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

Issue 1908393002: Don't allow column spanners inside transforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Documentation. Created 4 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/span/invalid-spanner-in-transform-expected.html ('k') | no next file » | 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) 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return nullptr; 74 return nullptr;
75 } 75 }
76 76
77 static inline bool isMultiColumnContainer(const LayoutObject& object) 77 static inline bool isMultiColumnContainer(const LayoutObject& object)
78 { 78 {
79 if (!object.isLayoutBlockFlow()) 79 if (!object.isLayoutBlockFlow())
80 return false; 80 return false;
81 return toLayoutBlockFlow(object).multiColumnFlowThread(); 81 return toLayoutBlockFlow(object).multiColumnFlowThread();
82 } 82 }
83 83
84 // Return true if there's nothing that prevents the specified object from being in the ancestor
85 // chain between some column spanner and its containing multicol container. A co lumn spanner needs
86 // the multicol container to be its containing block, so that the spanner is abl e to escape the flow
87 // thread. (Everything contained by the flow thread is split into columns, but t his is precisely
88 // what shouldn't be done to a spanner, since it's supposed to span all columns. )
89 //
90 // We require that the parent of the spanner participate in the block formatting context established
91 // by the multicol container (i.e. that there are no BFCs or other formatting co ntexts
92 // in-between). We also require that there be no transforms, since transforms in sist on being in the
93 // containing block chain for everything inside it, which conflicts with a spann ers's need to have
94 // the multicol container as its direct containing block. We may also not put sp anners inside
95 // objects that don't support fragmentation.
84 static inline bool canContainSpannerInParentFragmentationContext(const LayoutObj ect& object) 96 static inline bool canContainSpannerInParentFragmentationContext(const LayoutObj ect& object)
85 { 97 {
86 if (!object.isLayoutBlockFlow()) 98 if (!object.isLayoutBlockFlow())
87 return false; 99 return false;
88 const LayoutBlockFlow& blockFlow = toLayoutBlockFlow(object); 100 const LayoutBlockFlow& blockFlow = toLayoutBlockFlow(object);
89 return !blockFlow.createsNewFormattingContext() 101 return !blockFlow.createsNewFormattingContext()
102 && !blockFlow.hasTransformRelatedProperty()
90 && blockFlow.getPaginationBreakability() != LayoutBox::ForbidBreaks 103 && blockFlow.getPaginationBreakability() != LayoutBox::ForbidBreaks
91 && !isMultiColumnContainer(blockFlow); 104 && !isMultiColumnContainer(blockFlow);
92 } 105 }
93 106
94 static inline bool hasAnyColumnSpanners(const LayoutMultiColumnFlowThread& flowT hread) 107 static inline bool hasAnyColumnSpanners(const LayoutMultiColumnFlowThread& flowT hread)
95 { 108 {
96 LayoutBox* firstBox = flowThread.firstMultiColumnBox(); 109 LayoutBox* firstBox = flowThread.firstMultiColumnBox();
97 return firstBox && (firstBox != flowThread.lastMultiColumnBox() || firstBox- >isLayoutMultiColumnSpannerPlaceholder()); 110 return firstBox && (firstBox != flowThread.lastMultiColumnBox() || firstBox- >isLayoutMultiColumnSpannerPlaceholder());
98 } 111 }
99 112
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1042 }
1030 if (canContainSpannerInParentFragmentationContext(*object)) 1043 if (canContainSpannerInParentFragmentationContext(*object))
1031 next = object->nextInPreOrder(&root); 1044 next = object->nextInPreOrder(&root);
1032 else 1045 else
1033 next = object->nextInPreOrderAfterChildren(&root); 1046 next = object->nextInPreOrderAfterChildren(&root);
1034 } 1047 }
1035 return true; 1048 return true;
1036 } 1049 }
1037 1050
1038 } // namespace blink 1051 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/span/invalid-spanner-in-transform-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698