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

Side by Side Diff: Source/WebCore/rendering/RenderTable.cpp

Issue 9271029: Revert 105788 - Merge 105768 - Incorrect positioning of floating pseudo-elements in table captions (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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 | « Source/WebCore/rendering/RenderTable.h ('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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 setMarginStart(0); 258 setMarginStart(0);
259 setMarginEnd(0); 259 setMarginEnd(0);
260 if (!hasPerpendicularContainingBlock) 260 if (!hasPerpendicularContainingBlock)
261 computeInlineDirectionMargins(cb, availableLogicalWidth, logicalWidth()) ; 261 computeInlineDirectionMargins(cb, availableLogicalWidth, logicalWidth()) ;
262 else { 262 else {
263 setMarginStart(style()->marginStart().calcMinValue(availableLogicalWidth )); 263 setMarginStart(style()->marginStart().calcMinValue(availableLogicalWidth ));
264 setMarginEnd(style()->marginEnd().calcMinValue(availableLogicalWidth)); 264 setMarginEnd(style()->marginEnd().calcMinValue(availableLogicalWidth));
265 } 265 }
266 } 266 }
267 267
268 void RenderTable::layoutCaption(RenderTableCaption* caption) 268 void RenderTable::adjustLogicalHeightForCaption(RenderBlock* caption)
269 { 269 {
270 IntRect captionRect(caption->x(), caption->y(), caption->width(), caption->h eight()); 270 IntRect captionRect(caption->x(), caption->y(), caption->width(), caption->h eight());
271 271
272 if (caption->needsLayout()) {
273 // The margins may not be available but ensure the caption is at least l ocated beneath any previous sibling caption
274 // so that it does not mistakenly think any floats in the previous capti on intrude into it.
275 caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->ma rginBefore() + logicalHeight()));
276 // If RenderTableCaption ever gets a layout() function, use it here.
277 caption->layoutIfNeeded();
278 }
279 // Apply the margins to the location now that they are definitely available from layout
280 caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->margin Before() + logicalHeight())); 272 caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->margin Before() + logicalHeight()));
281
282 if (!selfNeedsLayout() && caption->checkForRepaintDuringLayout()) 273 if (!selfNeedsLayout() && caption->checkForRepaintDuringLayout())
283 caption->repaintDuringLayoutIfMoved(captionRect); 274 caption->repaintDuringLayoutIfMoved(captionRect);
284 275
285 setLogicalHeight(logicalHeight() + caption->logicalHeight() + caption->margi nBefore() + caption->marginAfter()); 276 setLogicalHeight(logicalHeight() + caption->logicalHeight() + caption->margi nBefore() + caption->marginAfter());
286 } 277 }
287 278
288 void RenderTable::layout() 279 void RenderTable::layout()
289 { 280 {
290 ASSERT(needsLayout()); 281 ASSERT(needsLayout());
291 282
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 totalSectionLogicalHeight += section->calcRowLogicalHeight(); 323 totalSectionLogicalHeight += section->calcRowLogicalHeight();
333 if (collapsing) 324 if (collapsing)
334 section->recalcOuterBorder(); 325 section->recalcOuterBorder();
335 ASSERT(!section->needsLayout()); 326 ASSERT(!section->needsLayout());
336 } else if (child->isTableCol()) { 327 } else if (child->isTableCol()) {
337 child->layoutIfNeeded(); 328 child->layoutIfNeeded();
338 ASSERT(!child->needsLayout()); 329 ASSERT(!child->needsLayout());
339 } 330 }
340 } 331 }
341 332
333 // Only lay out one caption, since it's the only one we're going to end up p ainting.
334 for (unsigned i = 0; i < m_captions.size(); i++)
335 m_captions[i]->layoutIfNeeded();
336
342 // If any table section moved vertically, we will just repaint everything fr om that 337 // If any table section moved vertically, we will just repaint everything fr om that
343 // section down (it is quite unlikely that any of the following sections 338 // section down (it is quite unlikely that any of the following sections
344 // did not shift). 339 // did not shift).
345 bool sectionMoved = false; 340 bool sectionMoved = false;
346 LayoutUnit movedSectionLogicalTop = 0; 341 LayoutUnit movedSectionLogicalTop = 0;
347 342
348 // FIXME: Collapse caption margin. 343 // FIXME: Collapse caption margin.
349 if (!m_captions.isEmpty()) { 344 if (!m_captions.isEmpty()) {
350 for (unsigned i = 0; i < m_captions.size(); i++) { 345 for (unsigned i = 0; i < m_captions.size(); i++) {
351 if (m_captions[i]->style()->captionSide() == CAPBOTTOM) 346 if (m_captions[i]->style()->captionSide() == CAPBOTTOM)
352 continue; 347 continue;
353 layoutCaption(m_captions[i]); 348 adjustLogicalHeightForCaption(m_captions[i]);
354 } 349 }
355 if (logicalHeight() != oldTableLogicalTop) { 350 if (logicalHeight() != oldTableLogicalTop) {
356 sectionMoved = true; 351 sectionMoved = true;
357 movedSectionLogicalTop = min(logicalHeight(), oldTableLogicalTop); 352 movedSectionLogicalTop = min(logicalHeight(), oldTableLogicalTop);
358 } 353 }
359 } 354 }
360 355
361 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? 0 : paddi ngBefore()); 356 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? 0 : paddi ngBefore());
362 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? 0 : padding After()); 357 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? 0 : padding After());
363 358
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 398
404 setLogicalHeight(logicalHeight() + section->logicalHeight()); 399 setLogicalHeight(logicalHeight() + section->logicalHeight());
405 section = sectionBelow(section); 400 section = sectionBelow(section);
406 } 401 }
407 402
408 setLogicalHeight(logicalHeight() + borderAndPaddingAfter); 403 setLogicalHeight(logicalHeight() + borderAndPaddingAfter);
409 404
410 for (unsigned i = 0; i < m_captions.size(); i++) { 405 for (unsigned i = 0; i < m_captions.size(); i++) {
411 if (m_captions[i]->style()->captionSide() != CAPBOTTOM) 406 if (m_captions[i]->style()->captionSide() != CAPBOTTOM)
412 continue; 407 continue;
413 layoutCaption(m_captions[i]); 408 adjustLogicalHeightForCaption(m_captions[i]);
414 } 409 }
415 410
416 if (isPositioned()) 411 if (isPositioned())
417 computeLogicalHeight(); 412 computeLogicalHeight();
418 413
419 // table can be containing block of positioned elements. 414 // table can be containing block of positioned elements.
420 // FIXME: Only pass true if width or height changed. 415 // FIXME: Only pass true if width or height changed.
421 layoutPositionedObjects(true); 416 layoutPositionedObjects(true);
422 417
423 updateLayerTransform(); 418 updateLayerTransform();
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointI nContainer))) { 1228 if (visibleToHitTesting() && (action == HitTestBlockBackground || action == HitTestChildBlockBackground) && boundsRect.intersects(result.rectForPoint(pointI nContainer))) {
1234 updateHitTestResult(result, flipForWritingMode(pointInContainer - toLayo utSize(adjustedLocation))); 1229 updateHitTestResult(result, flipForWritingMode(pointInContainer - toLayo utSize(adjustedLocation)));
1235 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, bound sRect)) 1230 if (!result.addNodeToRectBasedTestResult(node(), pointInContainer, bound sRect))
1236 return true; 1231 return true;
1237 } 1232 }
1238 1233
1239 return false; 1234 return false;
1240 } 1235 }
1241 1236
1242 } 1237 }
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderTable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698