OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 // FIXME: when dropping the -webkit prefix on transform-style, we should als
o have opacity < 1 cause flattening. | 356 // FIXME: when dropping the -webkit prefix on transform-style, we should als
o have opacity < 1 cause flattening. |
357 if (style->preserves3D() && (style->overflowX() != OVISIBLE | 357 if (style->preserves3D() && (style->overflowX() != OVISIBLE |
358 || style->overflowY() != OVISIBLE | 358 || style->overflowY() != OVISIBLE |
359 || style->hasFilter())) | 359 || style->hasFilter())) |
360 style->setTransformStyle3D(TransformStyle3DFlat); | 360 style->setTransformStyle3D(TransformStyle3DFlat); |
361 | 361 |
362 // Seamless iframes behave like blocks. Map their display to inline-block wh
en marked inline. | 362 // Seamless iframes behave like blocks. Map their display to inline-block wh
en marked inline. |
363 if (e && e->hasTagName(iframeTag) && style->display() == INLINE && toHTMLIFr
ameElement(e)->shouldDisplaySeamlessly()) | 363 if (e && e->hasTagName(iframeTag) && style->display() == INLINE && toHTMLIFr
ameElement(e)->shouldDisplaySeamlessly()) |
364 style->setDisplay(INLINE_BLOCK); | 364 style->setDisplay(INLINE_BLOCK); |
365 | 365 |
366 adjustGridItemPosition(style); | 366 adjustGridItemPosition(style, parentStyle); |
367 | 367 |
368 if (e && e->isSVGElement()) { | 368 if (e && e->isSVGElement()) { |
369 // Spec: http://www.w3.org/TR/SVG/masking.html#OverflowProperty | 369 // Spec: http://www.w3.org/TR/SVG/masking.html#OverflowProperty |
370 if (style->overflowY() == OSCROLL) | 370 if (style->overflowY() == OSCROLL) |
371 style->setOverflowY(OHIDDEN); | 371 style->setOverflowY(OHIDDEN); |
372 else if (style->overflowY() == OAUTO) | 372 else if (style->overflowY() == OAUTO) |
373 style->setOverflowY(OVISIBLE); | 373 style->setOverflowY(OVISIBLE); |
374 | 374 |
375 if (style->overflowX() == OSCROLL) | 375 if (style->overflowX() == OSCROLL) |
376 style->setOverflowX(OHIDDEN); | 376 style->setOverflowX(OHIDDEN); |
377 else if (style->overflowX() == OAUTO) | 377 else if (style->overflowX() == OAUTO) |
378 style->setOverflowX(OVISIBLE); | 378 style->setOverflowX(OVISIBLE); |
379 | 379 |
380 // Only the root <svg> element in an SVG document fragment tree honors c
ss position | 380 // Only the root <svg> element in an SVG document fragment tree honors c
ss position |
381 if (!(e->hasTagName(SVGNames::svgTag) && e->parentNode() && !e->parentNo
de()->isSVGElement())) | 381 if (!(e->hasTagName(SVGNames::svgTag) && e->parentNode() && !e->parentNo
de()->isSVGElement())) |
382 style->setPosition(RenderStyle::initialPosition()); | 382 style->setPosition(RenderStyle::initialPosition()); |
383 | 383 |
384 // RenderSVGRoot handles zooming for the whole SVG subtree, so foreignOb
ject content should | 384 // RenderSVGRoot handles zooming for the whole SVG subtree, so foreignOb
ject content should |
385 // not be scaled again. | 385 // not be scaled again. |
386 if (e->hasTagName(SVGNames::foreignObjectTag)) | 386 if (e->hasTagName(SVGNames::foreignObjectTag)) |
387 style->setEffectiveZoom(RenderStyle::initialZoom()); | 387 style->setEffectiveZoom(RenderStyle::initialZoom()); |
388 } | 388 } |
389 } | 389 } |
390 | 390 |
391 void StyleAdjuster::adjustGridItemPosition(RenderStyle* style) const | 391 void StyleAdjuster::adjustGridItemPosition(RenderStyle* style, RenderStyle* pare
ntStyle) const |
392 { | 392 { |
| 393 const GridPosition& columnStartPosition = style->gridColumnStart(); |
| 394 const GridPosition& columnEndPosition = style->gridColumnEnd(); |
| 395 const GridPosition& rowStartPosition = style->gridRowStart(); |
| 396 const GridPosition& rowEndPosition = style->gridRowEnd(); |
| 397 |
393 // If opposing grid-placement properties both specify a grid span, they both
compute to ‘auto’. | 398 // If opposing grid-placement properties both specify a grid span, they both
compute to ‘auto’. |
394 if (style->gridColumnStart().isSpan() && style->gridColumnEnd().isSpan()) { | 399 if (columnStartPosition.isSpan() && columnEndPosition.isSpan()) { |
395 style->setGridColumnStart(GridPosition()); | 400 style->setGridColumnStart(GridPosition()); |
396 style->setGridColumnEnd(GridPosition()); | 401 style->setGridColumnEnd(GridPosition()); |
397 } | 402 } |
398 | 403 |
399 if (style->gridRowStart().isSpan() && style->gridRowEnd().isSpan()) { | 404 if (rowStartPosition.isSpan() && rowEndPosition.isSpan()) { |
400 style->setGridRowStart(GridPosition()); | 405 style->setGridRowStart(GridPosition()); |
401 style->setGridRowEnd(GridPosition()); | 406 style->setGridRowEnd(GridPosition()); |
402 } | 407 } |
| 408 |
| 409 // Unknown named grid area compute to 'auto'. |
| 410 const NamedGridAreaMap& map = parentStyle->namedGridArea(); |
| 411 |
| 412 #define CLEAR_UNKNOWN_NAMED_AREA(prop, Prop) \ |
| 413 if (prop.isNamedGridArea() && !map.contains(prop.namedGridLine())) \ |
| 414 style->setGrid##Prop(GridPosition()); |
| 415 |
| 416 CLEAR_UNKNOWN_NAMED_AREA(columnStartPosition, ColumnStart); |
| 417 CLEAR_UNKNOWN_NAMED_AREA(columnEndPosition, ColumnEnd); |
| 418 CLEAR_UNKNOWN_NAMED_AREA(rowStartPosition, RowStart); |
| 419 CLEAR_UNKNOWN_NAMED_AREA(rowEndPosition, RowEnd); |
403 } | 420 } |
404 | 421 |
405 | |
406 | |
407 } | 422 } |
OLD | NEW |