| 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) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 if (RenderBox* renderer = renderBox()) | 365 if (RenderBox* renderer = renderBox()) |
| 366 return roundToInt(renderer->clientTop()); | 366 return roundToInt(renderer->clientTop()); |
| 367 return 0; | 367 return 0; |
| 368 } | 368 } |
| 369 | 369 |
| 370 int Element::clientWidth() | 370 int Element::clientWidth() |
| 371 { | 371 { |
| 372 document().updateLayout(); | 372 document().updateLayout(); |
| 373 | 373 |
| 374 // FIXME(sky): Can we just use getBoundingClientRect() instead? | |
| 375 if (document().documentElement() == this) { | |
| 376 if (FrameView* view = document().view()) | |
| 377 return view->layoutSize().width(); | |
| 378 } | |
| 379 | |
| 380 if (RenderBox* renderer = renderBox()) | 374 if (RenderBox* renderer = renderBox()) |
| 381 return renderer->pixelSnappedClientWidth(); | 375 return renderer->pixelSnappedClientWidth(); |
| 382 return 0; | 376 return 0; |
| 383 } | 377 } |
| 384 | 378 |
| 385 int Element::clientHeight() | 379 int Element::clientHeight() |
| 386 { | 380 { |
| 387 document().updateLayout(); | 381 document().updateLayout(); |
| 388 | 382 |
| 389 // FIXME(sky): Can we just use getBoundingClientRect() instead? | |
| 390 if (document().documentElement() == this) { | |
| 391 if (FrameView* view = document().view()) | |
| 392 return view->layoutSize().height(); | |
| 393 } | |
| 394 | |
| 395 if (RenderBox* renderer = renderBox()) | 383 if (RenderBox* renderer = renderBox()) |
| 396 return renderer->pixelSnappedClientHeight(); | 384 return renderer->pixelSnappedClientHeight(); |
| 397 return 0; | 385 return 0; |
| 398 } | 386 } |
| 399 | 387 |
| 400 PassRefPtr<ClientRectList> Element::getClientRects() | 388 PassRefPtr<ClientRectList> Element::getClientRects() |
| 401 { | 389 { |
| 402 document().updateLayout(); | 390 document().updateLayout(); |
| 403 | 391 |
| 404 RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject(); | 392 RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject(); |
| (...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1586 return false; | 1574 return false; |
| 1587 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) | 1575 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) |
| 1588 return true; | 1576 return true; |
| 1589 // Host rules could also have effects. | 1577 // Host rules could also have effects. |
| 1590 if (ShadowRoot* shadowRoot = this->shadowRoot()) | 1578 if (ShadowRoot* shadowRoot = this->shadowRoot()) |
| 1591 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); | 1579 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); |
| 1592 return false; | 1580 return false; |
| 1593 } | 1581 } |
| 1594 | 1582 |
| 1595 } // namespace blink | 1583 } // namespace blink |
| OLD | NEW |