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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/modules/accessibility/AXNodeObject.cpp » ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 LayoutObject* renderer2 = element2->renderer(); 1512 LayoutObject* renderer2 = element2->renderer();
1513 if (!renderer1 || !renderer1->isBox()) { 1513 if (!renderer1 || !renderer1->isBox()) {
1514 exceptionState.throwDOMException(InvalidAccessError, renderer1 ? "The fi rst provided element's renderer is not a box." : "The first provided element has no renderer."); 1514 exceptionState.throwDOMException(InvalidAccessError, renderer1 ? "The fi rst provided element's renderer is not a box." : "The first provided element has no renderer.");
1515 return false; 1515 return false;
1516 } 1516 }
1517 if (!renderer2 || !renderer2->isBox()) { 1517 if (!renderer2 || !renderer2->isBox()) {
1518 exceptionState.throwDOMException(InvalidAccessError, renderer2 ? "The se cond provided element's renderer is not a box." : "The second provided element h as no renderer."); 1518 exceptionState.throwDOMException(InvalidAccessError, renderer2 ? "The se cond provided element's renderer is not a box." : "The second provided element h as no renderer.");
1519 return false; 1519 return false;
1520 } 1520 }
1521 1521
1522 Layer* layer1 = toRenderBox(renderer1)->layer(); 1522 Layer* layer1 = toLayoutBox(renderer1)->layer();
1523 Layer* layer2 = toRenderBox(renderer2)->layer(); 1523 Layer* layer2 = toLayoutBox(renderer2)->layer();
1524 if (!layer1 || !layer2) { 1524 if (!layer1 || !layer2) {
1525 exceptionState.throwDOMException(InvalidAccessError, String::format("No render layer can be obtained from the %s provided element.", layer1 ? "second" : "first")); 1525 exceptionState.throwDOMException(InvalidAccessError, String::format("No render layer can be obtained from the %s provided element.", layer1 ? "second" : "first"));
1526 return false; 1526 return false;
1527 } 1527 }
1528 1528
1529 return layer1->scrollsWithRespectTo(layer2); 1529 return layer1->scrollsWithRespectTo(layer2);
1530 } 1530 }
1531 1531
1532 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionS tate& exceptionState) const 1532 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionS tate& exceptionState) const
1533 { 1533 {
(...skipping 12 matching lines...) Expand all
1546 { 1546 {
1547 ASSERT(element); 1547 ASSERT(element);
1548 element->document().updateLayout(); 1548 element->document().updateLayout();
1549 1549
1550 LayoutObject* renderer = element->renderer(); 1550 LayoutObject* renderer = element->renderer();
1551 if (!renderer || !renderer->isBox()) { 1551 if (!renderer || !renderer->isBox()) {
1552 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro vided element's renderer is not a box." : "The provided element has no renderer. "); 1552 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro vided element's renderer is not a box." : "The provided element has no renderer. ");
1553 return String(); 1553 return String();
1554 } 1554 }
1555 1555
1556 Layer* layer = toRenderBox(renderer)->layer(); 1556 Layer* layer = toLayoutBox(renderer)->layer();
1557 if (!layer 1557 if (!layer
1558 || !layer->hasCompositedLayerMapping() 1558 || !layer->hasCompositedLayerMapping()
1559 || !layer->compositedLayerMapping()->mainGraphicsLayer()) { 1559 || !layer->compositedLayerMapping()->mainGraphicsLayer()) {
1560 // Don't raise exception in these cases which may be normally used in te sts. 1560 // Don't raise exception in these cases which may be normally used in te sts.
1561 return String(); 1561 return String();
1562 } 1562 }
1563 1563
1564 return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText (flags); 1564 return layer->compositedLayerMapping()->mainGraphicsLayer()->layerTreeAsText (flags);
1565 } 1565 }
1566 1566
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 { 2322 {
2323 ThreadState::current()->schedulePreciseGC(); 2323 ThreadState::current()->schedulePreciseGC();
2324 } 2324 }
2325 2325
2326 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&) 2326 ValueIterable<int>::IterationSource* Internals::startIteration(ScriptState*, Exc eptionState&)
2327 { 2327 {
2328 return new InternalsIterationSource(); 2328 return new InternalsIterationSource();
2329 } 2329 }
2330 2330
2331 } // namespace blink 2331 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/graphics/SVGImage.cpp ('k') | Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698