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

Side by Side Diff: sky/engine/core/rendering/RenderView.cpp

Issue 878303002: Remove more scrolling code from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/rendering/RenderView.h ('k') | sky/engine/core/rendering/style/FillLayer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 389 }
390 390
391 IntRect RenderView::documentRect() const 391 IntRect RenderView::documentRect() const
392 { 392 {
393 FloatRect overflowRect(unscaledDocumentRect()); 393 FloatRect overflowRect(unscaledDocumentRect());
394 if (hasTransform()) 394 if (hasTransform())
395 overflowRect = layer()->currentTransform().mapRect(overflowRect); 395 overflowRect = layer()->currentTransform().mapRect(overflowRect);
396 return IntRect(overflowRect); 396 return IntRect(overflowRect);
397 } 397 }
398 398
399 int RenderView::viewHeight(IncludeScrollbarsInRect scrollbarInclusion) const 399 int RenderView::viewHeight() const
400 { 400 {
401 if (m_frameView) 401 if (m_frameView)
402 return m_frameView->layoutSize(scrollbarInclusion).height(); 402 return m_frameView->layoutSize().height();
403 return 0; 403 return 0;
404 } 404 }
405 405
406 int RenderView::viewWidth(IncludeScrollbarsInRect scrollbarInclusion) const 406 int RenderView::viewWidth() const
407 { 407 {
408 if (m_frameView) 408 if (m_frameView)
409 return m_frameView->layoutSize(scrollbarInclusion).width(); 409 return m_frameView->layoutSize().width();
410 return 0; 410 return 0;
411 } 411 }
412 412
413 int RenderView::viewLogicalHeight() const 413 int RenderView::viewLogicalHeight() const
414 { 414 {
415 return viewHeight(ExcludeScrollbars); 415 return viewHeight();
416 } 416 }
417 417
418 LayoutUnit RenderView::viewLogicalHeightForPercentages() const 418 LayoutUnit RenderView::viewLogicalHeightForPercentages() const
419 { 419 {
420 return viewLogicalHeight(); 420 return viewLogicalHeight();
421 } 421 }
422 422
423 void RenderView::updateHitTestResult(HitTestResult& result, const LayoutPoint& p oint) 423 void RenderView::updateHitTestResult(HitTestResult& result, const LayoutPoint& p oint)
424 { 424 {
425 if (result.innerNode()) 425 if (result.innerNode())
426 return; 426 return;
427 427
428 Node* node = document().documentElement(); 428 Node* node = document().documentElement();
429 if (node) { 429 if (node) {
430 result.setInnerNode(node); 430 result.setInnerNode(node);
431 if (!result.innerNonSharedNode()) 431 if (!result.innerNonSharedNode())
432 result.setInnerNonSharedNode(node); 432 result.setInnerNonSharedNode(node);
433 433 result.setLocalPoint(point);
434 LayoutPoint adjustedPoint = point;
435 offsetForContents(adjustedPoint);
436
437 result.setLocalPoint(adjustedPoint);
438 } 434 }
439 } 435 }
440 436
441 void RenderView::pushLayoutState(LayoutState& layoutState) 437 void RenderView::pushLayoutState(LayoutState& layoutState)
442 { 438 {
443 m_layoutState = &layoutState; 439 m_layoutState = &layoutState;
444 } 440 }
445 441
446 void RenderView::popLayoutState() 442 void RenderView::popLayoutState()
447 { 443 {
448 ASSERT(m_layoutState); 444 ASSERT(m_layoutState);
449 m_layoutState = m_layoutState->next(); 445 m_layoutState = m_layoutState->next();
450 } 446 }
451 447
452 // FIXME(sky): remove 448 // FIXME(sky): remove
453 double RenderView::layoutViewportWidth() const 449 double RenderView::layoutViewportWidth() const
454 { 450 {
455 return viewWidth(IncludeScrollbars); 451 return viewWidth();
456 } 452 }
457 453
458 // FIXME(sky): remove 454 // FIXME(sky): remove
459 double RenderView::layoutViewportHeight() const 455 double RenderView::layoutViewportHeight() const
460 { 456 {
461 return viewHeight(IncludeScrollbars); 457 return viewHeight();
462 } 458 }
463 459
464 void RenderView::addIFrame(RenderIFrame* iframe) 460 void RenderView::addIFrame(RenderIFrame* iframe)
465 { 461 {
466 m_iframes.add(iframe); 462 m_iframes.add(iframe);
467 } 463 }
468 464
469 void RenderView::removeIFrame(RenderIFrame* iframe) 465 void RenderView::removeIFrame(RenderIFrame* iframe)
470 { 466 {
471 m_iframes.remove(iframe); 467 m_iframes.remove(iframe);
472 } 468 }
473 469
474 void RenderView::updateIFramesAfterLayout() 470 void RenderView::updateIFramesAfterLayout()
475 { 471 {
476 for (auto& iframe: m_iframes) 472 for (auto& iframe: m_iframes)
477 iframe->updateWidgetBounds(); 473 iframe->updateWidgetBounds();
478 } 474 }
479 475
480 } // namespace blink 476 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderView.h ('k') | sky/engine/core/rendering/style/FillLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698