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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 711173003: Rename a few functions now that we don't have zooming. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/dom/Range.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 500
501 RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject(); 501 RenderBoxModelObject* renderBoxModelObject = this->renderBoxModelObject();
502 if (!renderBoxModelObject) 502 if (!renderBoxModelObject)
503 return ClientRectList::create(); 503 return ClientRectList::create();
504 504
505 // FIXME: Handle SVG elements. 505 // FIXME: Handle SVG elements.
506 // FIXME: Handle table/inline-table with a caption. 506 // FIXME: Handle table/inline-table with a caption.
507 507
508 Vector<FloatQuad> quads; 508 Vector<FloatQuad> quads;
509 renderBoxModelObject->absoluteQuads(quads); 509 renderBoxModelObject->absoluteQuads(quads);
510 document().adjustFloatQuadsForScrollAndAbsoluteZoom(quads, *renderBoxModelOb ject); 510 document().adjustFloatQuadsForScroll(quads);
511 return ClientRectList::create(quads); 511 return ClientRectList::create(quads);
512 } 512 }
513 513
514 PassRefPtr<ClientRect> Element::getBoundingClientRect() 514 PassRefPtr<ClientRect> Element::getBoundingClientRect()
515 { 515 {
516 document().updateLayoutIgnorePendingStylesheets(); 516 document().updateLayoutIgnorePendingStylesheets();
517 517
518 Vector<FloatQuad> quads; 518 Vector<FloatQuad> quads;
519 // Get the bounding rectangle from the box model. 519 // Get the bounding rectangle from the box model.
520 if (renderBoxModelObject()) 520 if (renderBoxModelObject())
521 renderBoxModelObject()->absoluteQuads(quads); 521 renderBoxModelObject()->absoluteQuads(quads);
522 522
523 if (quads.isEmpty()) 523 if (quads.isEmpty())
524 return ClientRect::create(); 524 return ClientRect::create();
525 525
526 FloatRect result = quads[0].boundingBox(); 526 FloatRect result = quads[0].boundingBox();
527 for (size_t i = 1; i < quads.size(); ++i) 527 for (size_t i = 1; i < quads.size(); ++i)
528 result.unite(quads[i].boundingBox()); 528 result.unite(quads[i].boundingBox());
529 529
530 ASSERT(renderer()); 530 document().adjustFloatRectForScroll(result);
531 document().adjustFloatRectForScrollAndAbsoluteZoom(result, *renderer());
532 return ClientRect::create(result); 531 return ClientRect::create(result);
533 } 532 }
534 533
535 void Element::setAttribute(const AtomicString& localName, const AtomicString& va lue, ExceptionState& exceptionState) 534 void Element::setAttribute(const AtomicString& localName, const AtomicString& va lue, ExceptionState& exceptionState)
536 { 535 {
537 if (!Document::isValidName(localName)) { 536 if (!Document::isValidName(localName)) {
538 exceptionState.throwDOMException(InvalidCharacterError, "'" + localName + "' is not a valid attribute name."); 537 exceptionState.throwDOMException(InvalidCharacterError, "'" + localName + "' is not a valid attribute name.");
539 return; 538 return;
540 } 539 }
541 540
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1806 return false; 1805 return false;
1807 // Turn off style sharing for elements that can gain layers for reasons outs ide of the style system. 1806 // Turn off style sharing for elements that can gain layers for reasons outs ide of the style system.
1808 // See comments in RenderObject::setStyle(). 1807 // See comments in RenderObject::setStyle().
1809 // FIXME: Why does gaining a layer from outside the style system require dis abling sharing? 1808 // FIXME: Why does gaining a layer from outside the style system require dis abling sharing?
1810 if (isHTMLCanvasElement(*this)) 1809 if (isHTMLCanvasElement(*this))
1811 return false; 1810 return false;
1812 return true; 1811 return true;
1813 } 1812 }
1814 1813
1815 } // namespace blink 1814 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Document.cpp ('k') | sky/engine/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698