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

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

Issue 2715243004: [blink] Support (semi-)transparent background colors in WebView/Frame. (Closed)
Patch Set: add unit test for remote frame transparency Created 3 years, 8 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 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 ASSERT(!m_view || m_view != view); 263 ASSERT(!m_view || m_view != view);
264 ASSERT(!document() || !document()->isActive()); 264 ASSERT(!document() || !document()->isActive());
265 265
266 eventHandler().clear(); 266 eventHandler().clear();
267 267
268 m_view = view; 268 m_view = view;
269 } 269 }
270 270
271 void LocalFrame::createView(const IntSize& viewportSize, 271 void LocalFrame::createView(const IntSize& viewportSize,
272 const Color& backgroundColor, 272 const Color& backgroundColor,
273 bool transparent,
274 ScrollbarMode horizontalScrollbarMode, 273 ScrollbarMode horizontalScrollbarMode,
275 bool horizontalLock, 274 bool horizontalLock,
276 ScrollbarMode verticalScrollbarMode, 275 ScrollbarMode verticalScrollbarMode,
277 bool verticalLock) { 276 bool verticalLock) {
278 ASSERT(this); 277 ASSERT(this);
279 ASSERT(page()); 278 ASSERT(page());
280 279
281 bool isLocalRoot = this->isLocalRoot(); 280 bool isLocalRoot = this->isLocalRoot();
282 281
283 if (isLocalRoot && view()) 282 if (isLocalRoot && view())
284 view()->setParentVisible(false); 283 view()->setParentVisible(false);
285 284
286 setView(nullptr); 285 setView(nullptr);
287 286
288 FrameView* frameView = nullptr; 287 FrameView* frameView = nullptr;
289 if (isLocalRoot) { 288 if (isLocalRoot) {
290 frameView = FrameView::create(*this, viewportSize); 289 frameView = FrameView::create(*this, viewportSize);
291 290
292 // The layout size is set by WebViewImpl to support @viewport 291 // The layout size is set by WebViewImpl to support @viewport
293 frameView->setLayoutSizeFixedToFrameSize(false); 292 frameView->setLayoutSizeFixedToFrameSize(false);
294 } else { 293 } else {
295 frameView = FrameView::create(*this); 294 frameView = FrameView::create(*this);
296 } 295 }
297 296
298 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode, 297 frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode,
299 horizontalLock, verticalLock); 298 horizontalLock, verticalLock);
300 299
301 setView(frameView); 300 setView(frameView);
302 301
303 frameView->updateBackgroundRecursively(backgroundColor, transparent); 302 frameView->updateBaseBackgroundColorRecursively(backgroundColor);
304 303
305 if (isLocalRoot) 304 if (isLocalRoot)
306 frameView->setParentVisible(true); 305 frameView->setParentVisible(true);
307 306
308 // FIXME: Not clear what the right thing for OOPI is here. 307 // FIXME: Not clear what the right thing for OOPI is here.
309 if (!ownerLayoutItem().isNull()) { 308 if (!ownerLayoutItem().isNull()) {
310 HTMLFrameOwnerElement* owner = deprecatedLocalOwner(); 309 HTMLFrameOwnerElement* owner = deprecatedLocalOwner();
311 ASSERT(owner); 310 ASSERT(owner);
312 // FIXME: OOPI might lead to us temporarily lying to a frame and telling it 311 // FIXME: OOPI might lead to us temporarily lying to a frame and telling it
313 // that it's owned by a FrameOwner that knows nothing about it. If we're 312 // that it's owned by a FrameOwner that knows nothing about it. If we're
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 900 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
902 m_frame->client()->frameBlameContext()->Enter(); 901 m_frame->client()->frameBlameContext()->Enter();
903 } 902 }
904 903
905 ScopedFrameBlamer::~ScopedFrameBlamer() { 904 ScopedFrameBlamer::~ScopedFrameBlamer() {
906 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 905 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
907 m_frame->client()->frameBlameContext()->Leave(); 906 m_frame->client()->frameBlameContext()->Leave();
908 } 907 }
909 908
910 } // namespace blink 909 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698