Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1765933003: style: Rename the PseudoId enum values to CamelCase and prefix them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enum-clash-PseudoId: none Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (Settings* settings = m_frame->settings()) { 462 if (Settings* settings = m_frame->settings()) {
463 if (!settings->allowCustomScrollbarInMainFrame() && m_frame->isMainFrame ()) 463 if (!settings->allowCustomScrollbarInMainFrame() && m_frame->isMainFrame ())
464 return false; 464 return false;
465 } 465 }
466 466
467 // FIXME: We need to update the scrollbar dynamically as documents change (o r as doc elements and bodies get discovered that have custom styles). 467 // FIXME: We need to update the scrollbar dynamically as documents change (o r as doc elements and bodies get discovered that have custom styles).
468 Document* doc = m_frame->document(); 468 Document* doc = m_frame->document();
469 469
470 // Try the <body> element first as a scrollbar source. 470 // Try the <body> element first as a scrollbar source.
471 Element* body = doc ? doc->body() : 0; 471 Element* body = doc ? doc->body() : 0;
472 if (body && body->layoutObject() && body->layoutObject()->style()->hasPseudo Style(SCROLLBAR)) { 472 if (body && body->layoutObject() && body->layoutObject()->style()->hasPseudo Style(PseudoIdScrollbar)) {
473 customScrollbarElement = body; 473 customScrollbarElement = body;
474 return true; 474 return true;
475 } 475 }
476 476
477 // If the <body> didn't have a custom style, then the root element might. 477 // If the <body> didn't have a custom style, then the root element might.
478 Element* docElement = doc ? doc->documentElement() : 0; 478 Element* docElement = doc ? doc->documentElement() : 0;
479 if (docElement && docElement->layoutObject() && docElement->layoutObject()-> style()->hasPseudoStyle(SCROLLBAR)) { 479 if (docElement && docElement->layoutObject() && docElement->layoutObject()-> style()->hasPseudoStyle(PseudoIdScrollbar)) {
480 customScrollbarElement = docElement; 480 customScrollbarElement = docElement;
481 return true; 481 return true;
482 } 482 }
483 483
484 // If we have an owning ipage/LocalFrame element, then it can set the custom scrollbar also. 484 // If we have an owning ipage/LocalFrame element, then it can set the custom scrollbar also.
485 LayoutPart* frameLayoutObject = m_frame->ownerLayoutObject(); 485 LayoutPart* frameLayoutObject = m_frame->ownerLayoutObject();
486 if (frameLayoutObject && frameLayoutObject->style()->hasPseudoStyle(SCROLLBA R)) { 486 if (frameLayoutObject && frameLayoutObject->style()->hasPseudoStyle(PseudoId Scrollbar)) {
487 customScrollbarFrame = m_frame.get(); 487 customScrollbarFrame = m_frame.get();
488 return true; 488 return true;
489 } 489 }
490 490
491 return false; 491 return false;
492 } 492 }
493 493
494 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio n orientation) 494 PassRefPtrWillBeRawPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientatio n orientation)
495 { 495 {
496 Element* customScrollbarElement = nullptr; 496 Element* customScrollbarElement = nullptr;
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 void FrameView::updateScrollCorner() 2307 void FrameView::updateScrollCorner()
2308 { 2308 {
2309 RefPtr<ComputedStyle> cornerStyle; 2309 RefPtr<ComputedStyle> cornerStyle;
2310 IntRect cornerRect = scrollCornerRect(); 2310 IntRect cornerRect = scrollCornerRect();
2311 Document* doc = m_frame->document(); 2311 Document* doc = m_frame->document();
2312 2312
2313 if (doc && !cornerRect.isEmpty()) { 2313 if (doc && !cornerRect.isEmpty()) {
2314 // Try the <body> element first as a scroll corner source. 2314 // Try the <body> element first as a scroll corner source.
2315 if (Element* body = doc->body()) { 2315 if (Element* body = doc->body()) {
2316 if (LayoutObject* layoutObject = body->layoutObject()) 2316 if (LayoutObject* layoutObject = body->layoutObject())
2317 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoStyleRe quest(SCROLLBAR_CORNER), layoutObject->style()); 2317 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoStyleRe quest(PseudoIdScrollbarCorner), layoutObject->style());
2318 } 2318 }
2319 2319
2320 if (!cornerStyle) { 2320 if (!cornerStyle) {
2321 // If the <body> didn't have a custom style, then the root element m ight. 2321 // If the <body> didn't have a custom style, then the root element m ight.
2322 if (Element* docElement = doc->documentElement()) { 2322 if (Element* docElement = doc->documentElement()) {
2323 if (LayoutObject* layoutObject = docElement->layoutObject()) 2323 if (LayoutObject* layoutObject = docElement->layoutObject())
2324 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoSty leRequest(SCROLLBAR_CORNER), layoutObject->style()); 2324 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoSty leRequest(PseudoIdScrollbarCorner), layoutObject->style());
2325 } 2325 }
2326 } 2326 }
2327 2327
2328 if (!cornerStyle) { 2328 if (!cornerStyle) {
2329 // If we have an owning ipage/LocalFrame element, then it can set th e custom scrollbar also. 2329 // If we have an owning ipage/LocalFrame element, then it can set th e custom scrollbar also.
2330 if (LayoutPart* layoutObject = m_frame->ownerLayoutObject()) 2330 if (LayoutPart* layoutObject = m_frame->ownerLayoutObject())
2331 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoStyleRe quest(SCROLLBAR_CORNER), layoutObject->style()); 2331 cornerStyle = layoutObject->getUncachedPseudoStyle(PseudoStyleRe quest(PseudoIdScrollbarCorner), layoutObject->style());
2332 } 2332 }
2333 } 2333 }
2334 2334
2335 if (cornerStyle) { 2335 if (cornerStyle) {
2336 if (!m_scrollCorner) 2336 if (!m_scrollCorner)
2337 m_scrollCorner = LayoutScrollbarPart::createAnonymous(doc); 2337 m_scrollCorner = LayoutScrollbarPart::createAnonymous(doc);
2338 m_scrollCorner->setStyleWithWritingModeOfParent(cornerStyle.release()); 2338 m_scrollCorner->setStyleWithWritingModeOfParent(cornerStyle.release());
2339 setScrollCornerNeedsPaintInvalidation(); 2339 setScrollCornerNeedsPaintInvalidation();
2340 } else if (m_scrollCorner) { 2340 } else if (m_scrollCorner) {
2341 m_scrollCorner->destroy(); 2341 m_scrollCorner->destroy();
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after
4114 return m_hiddenForThrottling && m_crossOriginForThrottling; 4114 return m_hiddenForThrottling && m_crossOriginForThrottling;
4115 } 4115 }
4116 4116
4117 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4117 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4118 { 4118 {
4119 ASSERT(layoutView()); 4119 ASSERT(layoutView());
4120 return *layoutView(); 4120 return *layoutView();
4121 } 4121 }
4122 4122
4123 } // namespace blink 4123 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698