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

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

Issue 686973002: Remove isUnclippedDescendant. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests Created 6 years, 1 month 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/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('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 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1565 RenderLayer* layer1 = toRenderBox(renderer1)->layer(); 1565 RenderLayer* layer1 = toRenderBox(renderer1)->layer();
1566 RenderLayer* layer2 = toRenderBox(renderer2)->layer(); 1566 RenderLayer* layer2 = toRenderBox(renderer2)->layer();
1567 if (!layer1 || !layer2) { 1567 if (!layer1 || !layer2) {
1568 exceptionState.throwDOMException(InvalidAccessError, String::format("No render layer can be obtained from the %s provided element.", layer1 ? "second" : "first")); 1568 exceptionState.throwDOMException(InvalidAccessError, String::format("No render layer can be obtained from the %s provided element.", layer1 ? "second" : "first"));
1569 return 0; 1569 return 0;
1570 } 1570 }
1571 1571
1572 return layer1->scrollsWithRespectTo(layer2); 1572 return layer1->scrollsWithRespectTo(layer2);
1573 } 1573 }
1574 1574
1575 bool Internals::isUnclippedDescendant(Element* element, ExceptionState& exceptio nState)
1576 {
1577 ASSERT(element);
1578 element->document().view()->updateLayoutAndStyleForPainting();
1579
1580 RenderObject* renderer = element->renderer();
1581 if (!renderer || !renderer->isBox()) {
1582 exceptionState.throwDOMException(InvalidAccessError, renderer ? "The pro vided element's renderer is not a box." : "The provided element has no renderer. ");
1583 return 0;
1584 }
1585
1586 RenderLayer* layer = toRenderBox(renderer)->layer();
1587 if (!layer) {
1588 exceptionState.throwDOMException(InvalidAccessError, "No render layer ca n be obtained from the provided element.");
1589 return 0;
1590 }
1591
1592 return layer->isUnclippedDescendant();
1593 }
1594
1595 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionS tate& exceptionState) const 1575 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionS tate& exceptionState) const
1596 { 1576 {
1597 ASSERT(document); 1577 ASSERT(document);
1598 if (!document->frame()) { 1578 if (!document->frame()) {
1599 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid."); 1579 exceptionState.throwDOMException(InvalidAccessError, "The document provi ded is invalid.");
1600 return String(); 1580 return String();
1601 } 1581 }
1602 1582
1603 document->view()->updateLayoutAndStyleForPainting(); 1583 document->view()->updateLayoutAndStyleForPainting();
1604 1584
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 } 2290 }
2311 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options)); 2291 toHTMLPlugInElement(element)->setPlaceholder(DictionaryPluginPlaceholder::cr eate(element->document(), options));
2312 } 2292 }
2313 2293
2314 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState) 2294 Iterator* Internals::iterator(ScriptState* scriptState, ExceptionState& exceptio nState)
2315 { 2295 {
2316 return new InternalsIterator; 2296 return new InternalsIterator;
2317 } 2297 }
2318 2298
2319 } // namespace blink 2299 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.h ('k') | Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698