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

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2513893002: Make ifdefs consistent in WebKit/Source/core/ (Closed)
Patch Set: Limited fix to /core/ only. Created 4 years 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) 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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * 10 *
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 ? toLayoutBoxModelObject(layoutObject) 575 ? toLayoutBoxModelObject(layoutObject)
576 : nullptr; 576 : nullptr;
577 } 577 }
578 578
579 LayoutRect Node::boundingBox() const { 579 LayoutRect Node::boundingBox() const {
580 if (layoutObject()) 580 if (layoutObject())
581 return LayoutRect(layoutObject()->absoluteBoundingBoxRect()); 581 return LayoutRect(layoutObject()->absoluteBoundingBoxRect());
582 return LayoutRect(); 582 return LayoutRect();
583 } 583 }
584 584
585 #ifndef NDEBUG 585 #if DCHECK_IS_ON()
586 inline static ShadowRoot* oldestShadowRootFor(const Node* node) { 586 inline static ShadowRoot* oldestShadowRootFor(const Node* node) {
587 if (!node->isElementNode()) 587 if (!node->isElementNode())
588 return nullptr; 588 return nullptr;
589 if (ElementShadow* shadow = toElement(node)->shadow()) 589 if (ElementShadow* shadow = toElement(node)->shadow())
590 return &shadow->oldestShadowRoot(); 590 return &shadow->oldestShadowRoot();
591 return nullptr; 591 return nullptr;
592 } 592 }
593 #endif 593 #endif
594 594
595 Node& Node::shadowIncludingRoot() const { 595 Node& Node::shadowIncludingRoot() const {
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 ostream << " (focused)"; 1549 ostream << " (focused)";
1550 return ostream; 1550 return ostream;
1551 } 1551 }
1552 1552
1553 std::ostream& operator<<(std::ostream& ostream, const Node* node) { 1553 std::ostream& operator<<(std::ostream& ostream, const Node* node) {
1554 if (!node) 1554 if (!node)
1555 return ostream << "null"; 1555 return ostream << "null";
1556 return ostream << *node; 1556 return ostream << *node;
1557 } 1557 }
1558 1558
1559 #ifndef NDEBUG 1559 #if DCHECK_IS_ON()
1560 1560
1561 String Node::toString() const { 1561 String Node::toString() const {
1562 // TODO(tkent): We implemented toString() with operator<<. We should 1562 // TODO(tkent): We implemented toString() with operator<<. We should
1563 // implement operator<< with toString() instead. 1563 // implement operator<< with toString() instead.
1564 std::stringstream stream; 1564 std::stringstream stream;
1565 stream << *this; 1565 stream << *this;
1566 return String(stream.str().c_str()); 1566 return String(stream.str().c_str());
1567 } 1567 }
1568 1568
1569 String Node::toTreeStringForThis() const { 1569 String Node::toTreeStringForThis() const {
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
2518 v8::Local<v8::Object> Node::associateWithWrapper( 2518 v8::Local<v8::Object> Node::associateWithWrapper(
2519 v8::Isolate* isolate, 2519 v8::Isolate* isolate,
2520 const WrapperTypeInfo* wrapperType, 2520 const WrapperTypeInfo* wrapperType,
2521 v8::Local<v8::Object> wrapper) { 2521 v8::Local<v8::Object> wrapper) {
2522 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType, 2522 return V8DOMWrapper::associateObjectWithWrapper(isolate, this, wrapperType,
2523 wrapper); 2523 wrapper);
2524 } 2524 }
2525 2525
2526 } // namespace blink 2526 } // namespace blink
2527 2527
2528 #ifndef NDEBUG 2528 #if DCHECK_IS_ON()
2529 2529
2530 void showNode(const blink::Node* node) { 2530 void showNode(const blink::Node* node) {
2531 if (node) 2531 if (node)
2532 LOG(INFO) << *node; 2532 LOG(INFO) << *node;
2533 else 2533 else
2534 LOG(INFO) << "Cannot showNode for <null>"; 2534 LOG(INFO) << "Cannot showNode for <null>";
2535 } 2535 }
2536 2536
2537 void showTree(const blink::Node* node) { 2537 void showTree(const blink::Node* node) {
2538 if (node) 2538 if (node)
2539 LOG(INFO) << "\n" << node->toTreeStringForThis().utf8().data(); 2539 LOG(INFO) << "\n" << node->toTreeStringForThis().utf8().data();
2540 else 2540 else
2541 LOG(INFO) << "Cannot showTree for <null>"; 2541 LOG(INFO) << "Cannot showTree for <null>";
2542 } 2542 }
2543 2543
2544 void showNodePath(const blink::Node* node) { 2544 void showNodePath(const blink::Node* node) {
2545 if (node) { 2545 if (node) {
2546 std::stringstream stream; 2546 std::stringstream stream;
2547 node->printNodePathTo(stream); 2547 node->printNodePathTo(stream);
2548 LOG(INFO) << stream.str(); 2548 LOG(INFO) << stream.str();
2549 } else { 2549 } else {
2550 LOG(INFO) << "Cannot showNodePath for <null>"; 2550 LOG(INFO) << "Cannot showNodePath for <null>";
2551 } 2551 }
2552 } 2552 }
2553 2553
2554 #endif 2554 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698