OLD | NEW |
---|---|
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 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 | 348 |
349 int RenderBox::pixelSnappedOffsetHeight() const | 349 int RenderBox::pixelSnappedOffsetHeight() const |
350 { | 350 { |
351 return snapSizeToPixel(offsetHeight(), y() + clientTop()); | 351 return snapSizeToPixel(offsetHeight(), y() + clientTop()); |
352 } | 352 } |
353 | 353 |
354 bool RenderBox::canDetermineWidthWithoutLayout() const | 354 bool RenderBox::canDetermineWidthWithoutLayout() const |
355 { | 355 { |
356 // FIXME: This optimization is incorrect as written. | 356 // FIXME: This optimization is incorrect as written. |
357 // We need to be able to opt-in to this behavior only when | 357 // We need to be able to opt-in to this behavior only when |
358 // it's guarentted correct. | 358 // it's guaranteed correct. |
359 // Until then disabling this optimization to be safe. | 359 // Until then disabling this optimization to be safe. |
360 #if 1 | |
Nico
2014/03/18 17:47:51
Just delete this code; if Eric wants to pick this
eseidel
2014/03/18 18:10:23
Sorry, this was an emergency fix done for a stable
Peter Kasting
2014/03/18 20:58:04
Eric, would you be willing to make this change sep
Nico
2014/03/19 10:20:05
You can change the function body to "
// FIXME:
Peter Kasting
2014/03/19 20:50:01
Done.
| |
360 return false; | 361 return false; |
361 | 362 #else |
362 // FIXME: There are likely many subclasses of RenderBlockFlow which | 363 // FIXME: There are likely many subclasses of RenderBlockFlow which |
363 // cannot determine their layout just from style! | 364 // cannot determine their layout just from style! |
364 // Perhaps we should create a "PlainRenderBlockFlow" | 365 // Perhaps we should create a "PlainRenderBlockFlow" |
365 // and move this optimization there? | 366 // and move this optimization there? |
366 if (!isRenderBlockFlow() | 367 if (!isRenderBlockFlow() |
367 // Flexbox items can be expanded beyond their width. | 368 // Flexbox items can be expanded beyond their width. |
368 || isFlexItemIncludingDeprecated() | 369 || isFlexItemIncludingDeprecated() |
369 // Table Layout controls cell size and can expand beyond width. | 370 // Table Layout controls cell size and can expand beyond width. |
370 || isTableCell()) | 371 || isTableCell()) |
371 return false; | 372 return false; |
372 | 373 |
373 RenderStyle* style = this->style(); | 374 RenderStyle* style = this->style(); |
374 return style->width().isFixed() | 375 return style->width().isFixed() |
375 && style->minWidth().isFixed() | 376 && style->minWidth().isFixed() |
376 && (style->maxWidth().isUndefined() || style->maxWidth().isFixed()) | 377 && (style->maxWidth().isUndefined() || style->maxWidth().isFixed()) |
377 && style->paddingLeft().isFixed() | 378 && style->paddingLeft().isFixed() |
378 && style->paddingRight().isFixed() | 379 && style->paddingRight().isFixed() |
379 && style->boxSizing() == CONTENT_BOX; | 380 && style->boxSizing() == CONTENT_BOX; |
381 #endif | |
380 } | 382 } |
381 | 383 |
382 LayoutUnit RenderBox::fixedOffsetWidth() const | 384 LayoutUnit RenderBox::fixedOffsetWidth() const |
383 { | 385 { |
384 ASSERT(canDetermineWidthWithoutLayout()); | 386 ASSERT(canDetermineWidthWithoutLayout()); |
385 | 387 |
386 RenderStyle* style = this->style(); | 388 RenderStyle* style = this->style(); |
387 | 389 |
388 LayoutUnit width = std::max(LayoutUnit(style->minWidth().value()), LayoutUni t(style->width().value())); | 390 LayoutUnit width = std::max(LayoutUnit(style->minWidth().value()), LayoutUni t(style->width().value())); |
389 if (style->maxWidth().isFixed()) | 391 if (style->maxWidth().isFixed()) |
(...skipping 4315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4705 return 0; | 4707 return 0; |
4706 | 4708 |
4707 if (!layoutState && !flowThreadContainingBlock()) | 4709 if (!layoutState && !flowThreadContainingBlock()) |
4708 return 0; | 4710 return 0; |
4709 | 4711 |
4710 RenderBlock* containerBlock = containingBlock(); | 4712 RenderBlock* containerBlock = containingBlock(); |
4711 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4713 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4712 } | 4714 } |
4713 | 4715 |
4714 } // namespace WebCore | 4716 } // namespace WebCore |
OLD | NEW |