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 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); | 366 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); |
367 | 367 |
368 if (layer()->groupedMapping()) { | 368 if (layer()->groupedMapping()) { |
369 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing
Layer()) | 369 if (GraphicsLayer* squashingLayer = layer()->groupedMapping()->squashing
Layer()) |
370 squashingLayer->invalidateDisplayItemClient(displayItemClient); | 370 squashingLayer->invalidateDisplayItemClient(displayItemClient); |
371 } else if (CompositedDeprecatedPaintLayerMapping* compositedDeprecatedPaintL
ayerMapping = layer()->compositedDeprecatedPaintLayerMapping()) { | 371 } else if (CompositedDeprecatedPaintLayerMapping* compositedDeprecatedPaintL
ayerMapping = layer()->compositedDeprecatedPaintLayerMapping()) { |
372 compositedDeprecatedPaintLayerMapping->invalidateDisplayItemClient(displ
ayItemClient); | 372 compositedDeprecatedPaintLayerMapping->invalidateDisplayItemClient(displ
ayItemClient); |
373 } | 373 } |
374 } | 374 } |
375 | 375 |
376 void LayoutBoxModelObject::addFocusRingRectsForNormalChildren(Vector<LayoutRect>
& rects, const LayoutPoint& additionalOffset) const | 376 void LayoutBoxModelObject::addOutlineRectsForNormalChildren(Vector<LayoutRect>&
rects, const LayoutPoint& additionalOffset) const |
377 { | 377 { |
378 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 378 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
379 // Focus rings of out-of-flow positioned descendants are handled in Layo
utBlock::addFocusRingRects(). | 379 // Outlines of out-of-flow positioned descendants are handled in LayoutB
lock::addOutlineRects(). |
380 if (child->isOutOfFlowPositioned()) | 380 if (child->isOutOfFlowPositioned()) |
381 continue; | 381 continue; |
382 | 382 |
383 // Focus ring of an element continuation or anonymous block continuation
is added when we iterate the continuation chain. | 383 // Outline of an element continuation or anonymous block continuation is
added when we iterate the continuation chain. |
384 // See LayoutBlock::addFocusRingRects() and LayoutInline::addFocusRingRe
cts(). | 384 // See LayoutBlock::addOutlineRects() and LayoutInline::addOutlineRects(
). |
385 if (child->isElementContinuation() | 385 if (child->isElementContinuation() |
386 || (child->isLayoutBlock() && toLayoutBlock(child)->isAnonymousBlock
Continuation())) | 386 || (child->isLayoutBlock() && toLayoutBlock(child)->isAnonymousBlock
Continuation())) |
387 continue; | 387 continue; |
388 | 388 |
389 addFocusRingRectsForDescendant(*child, rects, additionalOffset); | 389 addOutlineRectsForDescendant(*child, rects, additionalOffset); |
390 } | 390 } |
391 } | 391 } |
392 | 392 |
393 void LayoutBoxModelObject::addFocusRingRectsForDescendant(const LayoutObject& de
scendant, Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) const | 393 void LayoutBoxModelObject::addOutlineRectsForDescendant(const LayoutObject& desc
endant, Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) const |
394 { | 394 { |
395 if (descendant.isText() || descendant.isListMarker()) | 395 if (descendant.isText() || descendant.isListMarker()) |
396 return; | 396 return; |
397 | 397 |
398 if (descendant.hasLayer()) { | 398 if (descendant.hasLayer()) { |
399 Vector<LayoutRect> layerFocusRingRects; | 399 Vector<LayoutRect> layerOutlineRects; |
400 descendant.addFocusRingRects(layerFocusRingRects, LayoutPoint()); | 400 descendant.addOutlineRects(layerOutlineRects, LayoutPoint()); |
401 for (size_t i = 0; i < layerFocusRingRects.size(); ++i) { | 401 for (size_t i = 0; i < layerOutlineRects.size(); ++i) { |
402 FloatQuad quadInBox = toLayoutBoxModelObject(descendant).localToCont
ainerQuad(FloatQuad(layerFocusRingRects[i]), this); | 402 FloatQuad quadInBox = toLayoutBoxModelObject(descendant).localToCont
ainerQuad(FloatQuad(layerOutlineRects[i]), this); |
403 LayoutRect rect = LayoutRect(quadInBox.boundingBox()); | 403 LayoutRect rect = LayoutRect(quadInBox.boundingBox()); |
404 if (!rect.isEmpty()) { | 404 if (!rect.isEmpty()) { |
405 rect.moveBy(additionalOffset); | 405 rect.moveBy(additionalOffset); |
406 rects.append(rect); | 406 rects.append(rect); |
407 } | 407 } |
408 } | 408 } |
409 return; | 409 return; |
410 } | 410 } |
411 | 411 |
412 if (descendant.isBox()) { | 412 if (descendant.isBox()) { |
413 descendant.addFocusRingRects(rects, additionalOffset + toLayoutBox(desce
ndant).locationOffset()); | 413 descendant.addOutlineRects(rects, additionalOffset + toLayoutBox(descend
ant).locationOffset()); |
414 return; | 414 return; |
415 } | 415 } |
416 | 416 |
417 descendant.addFocusRingRects(rects, additionalOffset); | 417 descendant.addOutlineRects(rects, additionalOffset); |
418 } | 418 } |
419 | 419 |
420 bool LayoutBoxModelObject::calculateHasBoxDecorations() const | 420 bool LayoutBoxModelObject::calculateHasBoxDecorations() const |
421 { | 421 { |
422 const ComputedStyle& styleToUse = styleRef(); | 422 const ComputedStyle& styleToUse = styleRef(); |
423 return hasBackground() || styleToUse.hasBorderDecoration() || styleToUse.has
Appearance() || styleToUse.boxShadow(); | 423 return hasBackground() || styleToUse.hasBorderDecoration() || styleToUse.has
Appearance() || styleToUse.boxShadow(); |
424 } | 424 } |
425 | 425 |
426 bool LayoutBoxModelObject::hasNonEmptyLayoutSize() const | 426 bool LayoutBoxModelObject::hasNonEmptyLayoutSize() const |
427 { | 427 { |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 if (rootElementStyle->hasBackground()) | 1003 if (rootElementStyle->hasBackground()) |
1004 return false; | 1004 return false; |
1005 | 1005 |
1006 if (node() != document().firstBodyElement()) | 1006 if (node() != document().firstBodyElement()) |
1007 return false; | 1007 return false; |
1008 | 1008 |
1009 return true; | 1009 return true; |
1010 } | 1010 } |
1011 | 1011 |
1012 } // namespace blink | 1012 } // namespace blink |
OLD | NEW |