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 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 int RenderBoxModelObject::paddingRight(bool) const | 297 int RenderBoxModelObject::paddingRight(bool) const |
298 { | 298 { |
299 int w = 0; | 299 int w = 0; |
300 Length padding = style()->paddingRight(); | 300 Length padding = style()->paddingRight(); |
301 if (padding.isPercent()) | 301 if (padding.isPercent()) |
302 w = containingBlock()->availableWidth(); | 302 w = containingBlock()->availableWidth(); |
303 return padding.calcMinValue(w); | 303 return padding.calcMinValue(w); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
nst Color& c, const FillLayer* bgLayer, int tx, int ty, int w, int h, InlineFlow
Box* box, CompositeOperator op) | 307 void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
nst Color& c, const FillLayer* bgLayer, int tx, int ty, int w, int h, InlineFlow
Box* box, CompositeOperator op, RenderObject* backgroundObject) |
308 { | 308 { |
309 GraphicsContext* context = paintInfo.context; | 309 GraphicsContext* context = paintInfo.context; |
310 bool includeLeftEdge = box ? box->includeLeftEdge() : true; | 310 bool includeLeftEdge = box ? box->includeLeftEdge() : true; |
311 bool includeRightEdge = box ? box->includeRightEdge() : true; | 311 bool includeRightEdge = box ? box->includeRightEdge() : true; |
312 int bLeft = includeLeftEdge ? borderLeft() : 0; | 312 int bLeft = includeLeftEdge ? borderLeft() : 0; |
313 int bRight = includeRightEdge ? borderRight() : 0; | 313 int bRight = includeRightEdge ? borderRight() : 0; |
314 int pLeft = includeLeftEdge ? paddingLeft() : 0; | 314 int pLeft = includeLeftEdge ? paddingLeft() : 0; |
315 int pRight = includeRightEdge ? paddingRight() : 0; | 315 int pRight = includeRightEdge ? paddingRight() : 0; |
316 | 316 |
317 bool clippedToBorderRadius = false; | 317 bool clippedToBorderRadius = false; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 IntRect destRect; | 456 IntRect destRect; |
457 IntPoint phase; | 457 IntPoint phase; |
458 IntSize tileSize; | 458 IntSize tileSize; |
459 | 459 |
460 calculateBackgroundImageGeometry(bgLayer, tx, ty, w, h, destRect, phase,
tileSize); | 460 calculateBackgroundImageGeometry(bgLayer, tx, ty, w, h, destRect, phase,
tileSize); |
461 IntPoint destOrigin = destRect.location(); | 461 IntPoint destOrigin = destRect.location(); |
462 destRect.intersect(paintInfo.rect); | 462 destRect.intersect(paintInfo.rect); |
463 if (!destRect.isEmpty()) { | 463 if (!destRect.isEmpty()) { |
464 phase += destRect.location() - destOrigin; | 464 phase += destRect.location() - destOrigin; |
465 CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer-
>composite() : op; | 465 CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer-
>composite() : op; |
466 RenderObject* clientForBackgroundImage = this; | 466 RenderObject* clientForBackgroundImage = backgroundObject ? backgrou
ndObject : this; |
467 // Check if this is the root element painting a background layer pro
pagated from <body>, | |
468 // and pass the body's renderer as the client in that case. | |
469 if (isRoot && !style()->hasBackground()) { | |
470 ASSERT(node()->hasTagName(htmlTag)); | |
471 HTMLElement* body = document()->body(); | |
472 ASSERT(body); | |
473 ASSERT(body->hasLocalName(bodyTag)); | |
474 ASSERT(body->renderer()); | |
475 if (body) { | |
476 if (RenderObject* bodyRenderer = body->renderer()) | |
477 clientForBackgroundImage = bodyRenderer; | |
478 } | |
479 } | |
480 context->drawTiledImage(bg->image(clientForBackgroundImage, tileSize
), destRect, phase, tileSize, compositeOp); | 467 context->drawTiledImage(bg->image(clientForBackgroundImage, tileSize
), destRect, phase, tileSize, compositeOp); |
481 } | 468 } |
482 } | 469 } |
483 | 470 |
484 if (bgLayer->clip() != BorderFillBox) | 471 if (bgLayer->clip() != BorderFillBox) |
485 // Undo the background clip | 472 // Undo the background clip |
486 context->restore(); | 473 context->restore(); |
487 | 474 |
488 if (clippedToBorderRadius) | 475 if (clippedToBorderRadius) |
489 // Undo the border radius clip | 476 // Undo the border radius clip |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 } | 1315 } |
1329 } | 1316 } |
1330 } | 1317 } |
1331 | 1318 |
1332 int RenderBoxModelObject::containingBlockWidthForContent() const | 1319 int RenderBoxModelObject::containingBlockWidthForContent() const |
1333 { | 1320 { |
1334 return containingBlock()->availableWidth(); | 1321 return containingBlock()->availableWidth(); |
1335 } | 1322 } |
1336 | 1323 |
1337 } // namespace WebCore | 1324 } // namespace WebCore |
OLD | NEW |