OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 } | 475 } |
476 | 476 |
477 PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientatio
n) | 477 PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientatio
n) |
478 { | 478 { |
479 // FIXME: We need to update the scrollbar dynamically as documents change (o
r as doc elements and bodies get discovered that have custom styles). | 479 // FIXME: We need to update the scrollbar dynamically as documents change (o
r as doc elements and bodies get discovered that have custom styles). |
480 Document* doc = m_frame->document(); | 480 Document* doc = m_frame->document(); |
481 | 481 |
482 // Try the <body> element first as a scrollbar source. | 482 // Try the <body> element first as a scrollbar source. |
483 Element* body = doc ? doc->body() : 0; | 483 Element* body = doc ? doc->body() : 0; |
484 if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(SC
ROLLBAR)) | 484 if (body && body->renderer() && body->renderer()->style()->hasPseudoStyle(SC
ROLLBAR)) |
485 return RenderScrollbar::createCustomScrollbar(this, orientation, body->r
enderer()->enclosingBox()); | 485 return RenderScrollbar::createCustomScrollbar(this, orientation, body); |
486 | 486 |
487 // If the <body> didn't have a custom style, then the root element might. | 487 // If the <body> didn't have a custom style, then the root element might. |
488 Element* docElement = doc ? doc->documentElement() : 0; | 488 Element* docElement = doc ? doc->documentElement() : 0; |
489 if (docElement && docElement->renderer() && docElement->renderer()->style()-
>hasPseudoStyle(SCROLLBAR)) | 489 if (docElement && docElement->renderer() && docElement->renderer()->style()-
>hasPseudoStyle(SCROLLBAR)) |
490 return RenderScrollbar::createCustomScrollbar(this, orientation, docElem
ent->renderBox()); | 490 return RenderScrollbar::createCustomScrollbar(this, orientation, docElem
ent); |
491 | 491 |
492 // If we have an owning iframe/frame element, then it can set the custom scr
ollbar also. | 492 // If we have an owning iframe/frame element, then it can set the custom scr
ollbar also. |
493 RenderPart* frameRenderer = m_frame->ownerRenderer(); | 493 RenderPart* frameRenderer = m_frame->ownerRenderer(); |
494 if (frameRenderer && frameRenderer->style()->hasPseudoStyle(SCROLLBAR)) | 494 if (frameRenderer && frameRenderer->style()->hasPseudoStyle(SCROLLBAR)) |
495 return RenderScrollbar::createCustomScrollbar(this, orientation, 0, m_fr
ame.get()); | 495 return RenderScrollbar::createCustomScrollbar(this, orientation, 0, m_fr
ame.get()); |
496 | 496 |
497 // Nobody set a custom style, so we just use a native scrollbar. | 497 // Nobody set a custom style, so we just use a native scrollbar. |
498 return ScrollView::createScrollbar(orientation); | 498 return ScrollView::createScrollbar(orientation); |
499 } | 499 } |
500 | 500 |
(...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2905 } else if (widget->isScrollbar()) { | 2905 } else if (widget->isScrollbar()) { |
2906 Scrollbar* scrollbar = static_cast<Scrollbar*>(widget); | 2906 Scrollbar* scrollbar = static_cast<Scrollbar*>(widget); |
2907 if (scrollbar->isCustomScrollbar()) | 2907 if (scrollbar->isCustomScrollbar()) |
2908 return true; | 2908 return true; |
2909 } | 2909 } |
2910 } | 2910 } |
2911 | 2911 |
2912 return false; | 2912 return false; |
2913 } | 2913 } |
2914 | 2914 |
2915 void FrameView::clearOwningRendererForCustomScrollbars(RenderBox* box) | |
2916 { | |
2917 const HashSet<RefPtr<Widget> >* viewChildren = children(); | |
2918 HashSet<RefPtr<Widget> >::const_iterator end = viewChildren->end(); | |
2919 for (HashSet<RefPtr<Widget> >::const_iterator current = viewChildren->begin(
); current != end; ++current) { | |
2920 Widget* widget = current->get(); | |
2921 if (widget->isScrollbar()) { | |
2922 Scrollbar* scrollbar = static_cast<Scrollbar*>(widget); | |
2923 if (scrollbar->isCustomScrollbar()) { | |
2924 RenderScrollbar* customScrollbar = toRenderScrollbar(scrollbar); | |
2925 if (customScrollbar->owningRenderer() == box) | |
2926 customScrollbar->clearOwningRenderer(); | |
2927 } | |
2928 } | |
2929 } | |
2930 } | |
2931 | |
2932 FrameView* FrameView::parentFrameView() const | 2915 FrameView* FrameView::parentFrameView() const |
2933 { | 2916 { |
2934 if (Widget* parentView = parent()) { | 2917 if (Widget* parentView = parent()) { |
2935 if (parentView->isFrameView()) | 2918 if (parentView->isFrameView()) |
2936 return static_cast<FrameView*>(parentView); | 2919 return static_cast<FrameView*>(parentView); |
2937 } | 2920 } |
2938 return 0; | 2921 return 0; |
2939 } | 2922 } |
2940 | 2923 |
2941 bool FrameView::isInChildFrameWithFrameFlattening() | 2924 bool FrameView::isInChildFrameWithFrameFlattening() |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3568 } | 3551 } |
3569 | 3552 |
3570 AXObjectCache* FrameView::axObjectCache() const | 3553 AXObjectCache* FrameView::axObjectCache() const |
3571 { | 3554 { |
3572 if (frame() && frame()->document() && frame()->document()->axObjectCacheExis
ts()) | 3555 if (frame() && frame()->document() && frame()->document()->axObjectCacheExis
ts()) |
3573 return frame()->document()->axObjectCache(); | 3556 return frame()->document()->axObjectCache(); |
3574 return 0; | 3557 return 0; |
3575 } | 3558 } |
3576 | 3559 |
3577 } // namespace WebCore | 3560 } // namespace WebCore |
OLD | NEW |