| Index: third_party/WebKit/Source/core/testing/Internals.cpp
|
| diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| index fac050ef188f617790871c85d04c10e0e52999d6..f637f0968eebc039e1f487f2efbd117f9de3e4bf 100644
|
| --- a/third_party/WebKit/Source/core/testing/Internals.cpp
|
| +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| @@ -220,7 +220,7 @@ static ScrollableArea* scrollableAreaForNode(Node* node) {
|
| static RuntimeEnabledFeatures::Backup* sFeaturesBackup = nullptr;
|
|
|
| void Internals::resetToConsistentState(Page* page) {
|
| - ASSERT(page);
|
| + DCHECK(page);
|
|
|
| if (!sFeaturesBackup)
|
| sFeaturesBackup = new RuntimeEnabledFeatures::Backup;
|
| @@ -286,7 +286,7 @@ String Internals::address(Node* node) {
|
|
|
| GCObservation* Internals::observeGC(ScriptValue scriptValue) {
|
| v8::Local<v8::Value> observedValue = scriptValue.v8Value();
|
| - ASSERT(!observedValue.IsEmpty());
|
| + DCHECK(!observedValue.IsEmpty());
|
| if (observedValue->IsNull() || observedValue->IsUndefined()) {
|
| V8ThrowException::throwTypeError(v8::Isolate::GetCurrent(),
|
| "value to observe is null or undefined");
|
| @@ -444,13 +444,13 @@ String Internals::getResourceHeader(const String& url,
|
| }
|
|
|
| bool Internals::isSharingStyle(Element* element1, Element* element2) const {
|
| - ASSERT(element1 && element2);
|
| + DCHECK(element1 && element2);
|
| return element1->computedStyle() == element2->computedStyle();
|
| }
|
|
|
| bool Internals::isValidContentSelect(Element* insertionPoint,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(insertionPoint);
|
| + DCHECK(insertionPoint);
|
| if (!insertionPoint->isInsertionPoint()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The element is not an insertion point.");
|
| @@ -462,12 +462,12 @@ bool Internals::isValidContentSelect(Element* insertionPoint,
|
| }
|
|
|
| Node* Internals::treeScopeRootNode(Node* node) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| return &node->treeScope().rootNode();
|
| }
|
|
|
| Node* Internals::parentTreeScope(Node* node) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| const TreeScope* parentTreeScope = node->treeScope().parentTreeScope();
|
| return parentTreeScope ? &parentTreeScope->rootNode() : 0;
|
| }
|
| @@ -475,7 +475,7 @@ Node* Internals::parentTreeScope(Node* node) {
|
| bool Internals::hasSelectorForIdInShadow(Element* host,
|
| const AtomicString& idValue,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(host);
|
| + DCHECK(host);
|
| if (!host->shadow() || host->shadow()->isV1()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError, "The host element does not have a v0 shadow.");
|
| @@ -489,7 +489,7 @@ bool Internals::hasSelectorForIdInShadow(Element* host,
|
| bool Internals::hasSelectorForClassInShadow(Element* host,
|
| const AtomicString& className,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(host);
|
| + DCHECK(host);
|
| if (!host->shadow() || host->shadow()->isV1()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError, "The host element does not have a v0 shadow.");
|
| @@ -504,7 +504,7 @@ bool Internals::hasSelectorForAttributeInShadow(
|
| Element* host,
|
| const AtomicString& attributeName,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(host);
|
| + DCHECK(host);
|
| if (!host->shadow() || host->shadow()->isV1()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError, "The host element does not have a v0 shadow.");
|
| @@ -519,7 +519,7 @@ unsigned short Internals::compareTreeScopePosition(
|
| const Node* node1,
|
| const Node* node2,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(node1 && node2);
|
| + DCHECK(node1 && node2);
|
| const TreeScope* treeScope1 =
|
| node1->isDocumentNode()
|
| ? static_cast<const TreeScope*>(toDocument(node1))
|
| @@ -574,7 +574,7 @@ void Internals::disableCSSAdditiveAnimations() {
|
| void Internals::advanceTimeForImage(Element* image,
|
| double deltaTimeInSeconds,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(image);
|
| + DCHECK(image);
|
| if (deltaTimeInSeconds < 0) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError, ExceptionMessages::indexExceedsMinimumBound(
|
| @@ -611,7 +611,7 @@ void Internals::advanceTimeForImage(Element* image,
|
|
|
| void Internals::advanceImageAnimation(Element* image,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(image);
|
| + DCHECK(image);
|
|
|
| ImageResourceContent* resource = nullptr;
|
| if (isHTMLImageElement(*image)) {
|
| @@ -636,7 +636,7 @@ void Internals::advanceImageAnimation(Element* image,
|
|
|
| bool Internals::hasShadowInsertionPoint(const Node* root,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(root);
|
| + DCHECK(root);
|
| if (!root->isShadowRoot()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The node argument is not a shadow root.");
|
| @@ -647,7 +647,7 @@ bool Internals::hasShadowInsertionPoint(const Node* root,
|
|
|
| bool Internals::hasContentElement(const Node* root,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(root);
|
| + DCHECK(root);
|
| if (!root->isShadowRoot()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The node argument is not a shadow root.");
|
| @@ -658,7 +658,7 @@ bool Internals::hasContentElement(const Node* root,
|
|
|
| size_t Internals::countElementShadow(const Node* root,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(root);
|
| + DCHECK(root);
|
| if (!root->isShadowRoot()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The node argument is not a shadow root.");
|
| @@ -669,7 +669,7 @@ size_t Internals::countElementShadow(const Node* root,
|
|
|
| Node* Internals::nextSiblingInFlatTree(Node* node,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| if (!node->canParticipateInFlatTree()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError,
|
| @@ -681,7 +681,7 @@ Node* Internals::nextSiblingInFlatTree(Node* node,
|
|
|
| Node* Internals::firstChildInFlatTree(Node* node,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| if (!node->canParticipateInFlatTree()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError,
|
| @@ -693,7 +693,7 @@ Node* Internals::firstChildInFlatTree(Node* node,
|
|
|
| Node* Internals::lastChildInFlatTree(Node* node,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| if (!node->canParticipateInFlatTree()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError,
|
| @@ -704,7 +704,7 @@ Node* Internals::lastChildInFlatTree(Node* node,
|
| }
|
|
|
| Node* Internals::nextInFlatTree(Node* node, ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| if (!node->canParticipateInFlatTree()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError,
|
| @@ -716,7 +716,7 @@ Node* Internals::nextInFlatTree(Node* node, ExceptionState& exceptionState) {
|
|
|
| Node* Internals::previousInFlatTree(Node* node,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| if (!node->canParticipateInFlatTree()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError,
|
| @@ -728,7 +728,7 @@ Node* Internals::previousInFlatTree(Node* node,
|
|
|
| String Internals::elementLayoutTreeAsText(Element* element,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| element->document().view()->updateAllLifecyclePhases();
|
|
|
| String representation = externalRepresentation(element);
|
| @@ -744,13 +744,13 @@ String Internals::elementLayoutTreeAsText(Element* element,
|
|
|
| CSSStyleDeclaration* Internals::computedStyleIncludingVisitedInfo(
|
| Node* node) const {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| bool allowVisitedStyle = true;
|
| return CSSComputedStyleDeclaration::create(node, allowVisitedStyle);
|
| }
|
|
|
| ShadowRoot* Internals::createUserAgentShadowRoot(Element* host) {
|
| - ASSERT(host);
|
| + DCHECK(host);
|
| return &host->ensureUserAgentShadowRoot();
|
| }
|
|
|
| @@ -762,14 +762,14 @@ ShadowRoot* Internals::shadowRoot(Element* host) {
|
| }
|
|
|
| ShadowRoot* Internals::youngestShadowRoot(Element* host) {
|
| - ASSERT(host);
|
| + DCHECK(host);
|
| if (ElementShadow* shadow = host->shadow())
|
| return &shadow->youngestShadowRoot();
|
| return 0;
|
| }
|
|
|
| ShadowRoot* Internals::oldestShadowRoot(Element* host) {
|
| - ASSERT(host);
|
| + DCHECK(host);
|
| if (ElementShadow* shadow = host->shadow())
|
| return &shadow->oldestShadowRoot();
|
| return 0;
|
| @@ -777,7 +777,7 @@ ShadowRoot* Internals::oldestShadowRoot(Element* host) {
|
|
|
| ShadowRoot* Internals::youngerShadowRoot(Node* shadow,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(shadow);
|
| + DCHECK(shadow);
|
| if (!shadow->isShadowRoot()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The node provided is not a shadow root.");
|
| @@ -789,7 +789,7 @@ ShadowRoot* Internals::youngerShadowRoot(Node* shadow,
|
|
|
| String Internals::shadowRootType(const Node* root,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(root);
|
| + DCHECK(root);
|
| if (!root->isShadowRoot()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The node provided is not a shadow root.");
|
| @@ -812,7 +812,7 @@ String Internals::shadowRootType(const Node* root,
|
| }
|
|
|
| const AtomicString& Internals::shadowPseudoId(Element* element) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| return element->shadowPseudoId();
|
| }
|
|
|
| @@ -832,7 +832,7 @@ String Internals::visiblePlaceholder(Element* element) {
|
|
|
| void Internals::selectColorInColorChooser(Element* element,
|
| const String& colorValue) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!isHTMLInputElement(*element))
|
| return;
|
| Color color;
|
| @@ -842,7 +842,7 @@ void Internals::selectColorInColorChooser(Element* element,
|
| }
|
|
|
| void Internals::endColorChooser(Element* element) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!isHTMLInputElement(*element))
|
| return;
|
| toHTMLInputElement(*element).endColorChooser();
|
| @@ -906,7 +906,7 @@ ClientRect* Internals::absoluteCaretBounds(ExceptionState& exceptionState) {
|
| }
|
|
|
| ClientRect* Internals::boundingBox(Element* element) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
|
|
| element->document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| LayoutObject* layoutObject = element->layoutObject();
|
| @@ -942,7 +942,7 @@ void Internals::setMarker(Document* document,
|
| unsigned Internals::markerCountForNode(Node* node,
|
| const String& markerType,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| WTF::Optional<DocumentMarker::MarkerTypes> markerTypes =
|
| markerTypesFrom(markerType);
|
| if (!markerTypes) {
|
| @@ -959,7 +959,7 @@ unsigned Internals::markerCountForNode(Node* node,
|
| }
|
|
|
| unsigned Internals::activeMarkerCountForNode(Node* node) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
|
|
| // Only TextMatch markers can be active.
|
| DocumentMarker::MarkerType markerType = DocumentMarker::TextMatch;
|
| @@ -979,7 +979,7 @@ DocumentMarker* Internals::markerAt(Node* node,
|
| const String& markerType,
|
| unsigned index,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| WTF::Optional<DocumentMarker::MarkerTypes> markerTypes =
|
| markerTypesFrom(markerType);
|
| if (!markerTypes) {
|
| @@ -1000,7 +1000,7 @@ Range* Internals::markerRangeForNode(Node* node,
|
| const String& markerType,
|
| unsigned index,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| DocumentMarker* marker = markerAt(node, markerType, index, exceptionState);
|
| if (!marker)
|
| return nullptr;
|
| @@ -1019,7 +1019,7 @@ String Internals::markerDescriptionForNode(Node* node,
|
| }
|
|
|
| void Internals::addTextMatchMarker(const Range* range, bool isActive) {
|
| - ASSERT(range);
|
| + DCHECK(range);
|
| range->ownerDocument().updateStyleAndLayoutIgnorePendingStylesheets();
|
| range->ownerDocument().markers().addTextMatchMarker(EphemeralRange(range),
|
| isActive);
|
| @@ -1064,7 +1064,7 @@ void Internals::setMarkersActive(Node* node,
|
| unsigned startOffset,
|
| unsigned endOffset,
|
| bool active) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| node->document().markers().setMarkersActive(node, startOffset, endOffset,
|
| active);
|
| }
|
| @@ -1081,7 +1081,7 @@ void Internals::setFrameViewPosition(Document* document,
|
| long x,
|
| long y,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->view()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1101,7 +1101,7 @@ String Internals::viewportAsText(Document* document,
|
| int availableWidth,
|
| int availableHeight,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->page()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1147,7 +1147,7 @@ String Internals::viewportAsText(Document* document,
|
|
|
| bool Internals::elementShouldAutoComplete(Element* element,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (isHTMLInputElement(*element))
|
| return toHTMLInputElement(*element).shouldAutocomplete();
|
|
|
| @@ -1158,7 +1158,7 @@ bool Internals::elementShouldAutoComplete(Element* element,
|
|
|
| String Internals::suggestedValue(Element* element,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!element->isFormControlElement()) {
|
| exceptionState.throwDOMException(
|
| InvalidNodeTypeError,
|
| @@ -1182,7 +1182,7 @@ String Internals::suggestedValue(Element* element,
|
| void Internals::setSuggestedValue(Element* element,
|
| const String& value,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!element->isFormControlElement()) {
|
| exceptionState.throwDOMException(
|
| InvalidNodeTypeError,
|
| @@ -1203,7 +1203,7 @@ void Internals::setSuggestedValue(Element* element,
|
| void Internals::setEditingValue(Element* element,
|
| const String& value,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!isHTMLInputElement(*element)) {
|
| exceptionState.throwDOMException(InvalidNodeTypeError,
|
| "The element provided is not an INPUT.");
|
| @@ -1216,7 +1216,7 @@ void Internals::setEditingValue(Element* element,
|
| void Internals::setAutofilled(Element* element,
|
| bool enabled,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!element->isFormControlElement()) {
|
| exceptionState.throwDOMException(
|
| InvalidNodeTypeError,
|
| @@ -1229,7 +1229,7 @@ void Internals::setAutofilled(Element* element,
|
| Range* Internals::rangeFromLocationAndLength(Element* scope,
|
| int rangeLocation,
|
| int rangeLength) {
|
| - ASSERT(scope);
|
| + DCHECK(scope);
|
|
|
| // TextIterator depends on Layout information, make sure layout it up to date.
|
| scope->document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| @@ -1239,7 +1239,7 @@ Range* Internals::rangeFromLocationAndLength(Element* scope,
|
| }
|
|
|
| unsigned Internals::locationFromRange(Element* scope, const Range* range) {
|
| - ASSERT(scope && range);
|
| + DCHECK(scope && range);
|
| // PlainTextRange depends on Layout information, make sure layout it up to
|
| // date.
|
| scope->document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| @@ -1248,7 +1248,7 @@ unsigned Internals::locationFromRange(Element* scope, const Range* range) {
|
| }
|
|
|
| unsigned Internals::lengthFromRange(Element* scope, const Range* range) {
|
| - ASSERT(scope && range);
|
| + DCHECK(scope && range);
|
| // PlainTextRange depends on Layout information, make sure layout it up to
|
| // date.
|
| scope->document().updateStyleAndLayoutIgnorePendingStylesheets();
|
| @@ -1257,7 +1257,7 @@ unsigned Internals::lengthFromRange(Element* scope, const Range* range) {
|
| }
|
|
|
| String Internals::rangeAsText(const Range* range) {
|
| - ASSERT(range);
|
| + DCHECK(range);
|
| // Clean layout is required by plain text extraction.
|
| range->ownerDocument().updateStyleAndLayoutIgnorePendingStylesheets();
|
|
|
| @@ -1274,7 +1274,7 @@ DOMPoint* Internals::touchPositionAdjustedToBestClickableNode(
|
| long height,
|
| Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1311,7 +1311,7 @@ Node* Internals::touchNodeAdjustedToBestClickableNode(
|
| long height,
|
| Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1344,7 +1344,7 @@ DOMPoint* Internals::touchPositionAdjustedToBestContextMenuNode(
|
| long height,
|
| Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1381,7 +1381,7 @@ Node* Internals::touchNodeAdjustedToBestContextMenuNode(
|
| long height,
|
| Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1414,7 +1414,7 @@ ClientRect* Internals::bestZoomableAreaForTouchPoint(
|
| long height,
|
| Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1479,7 +1479,7 @@ void Internals::setUserPreferredLanguages(const Vector<String>& languages) {
|
| }
|
|
|
| unsigned Internals::activeDOMObjectCount(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return document->activeDOMObjectCount();
|
| }
|
|
|
| @@ -1500,17 +1500,17 @@ static unsigned eventHandlerCount(
|
| }
|
|
|
| unsigned Internals::wheelEventHandlerCount(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return eventHandlerCount(*document, EventHandlerRegistry::WheelEventBlocking);
|
| }
|
|
|
| unsigned Internals::scrollEventHandlerCount(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return eventHandlerCount(*document, EventHandlerRegistry::ScrollEvent);
|
| }
|
|
|
| unsigned Internals::touchStartOrMoveEventHandlerCount(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return eventHandlerCount(
|
| *document, EventHandlerRegistry::TouchStartOrMoveEventBlocking) +
|
| eventHandlerCount(*document,
|
| @@ -1518,7 +1518,7 @@ unsigned Internals::touchStartOrMoveEventHandlerCount(Document* document) {
|
| }
|
|
|
| unsigned Internals::touchEndOrCancelEventHandlerCount(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return eventHandlerCount(
|
| *document, EventHandlerRegistry::TouchEndOrCancelEventBlocking) +
|
| eventHandlerCount(*document,
|
| @@ -1705,7 +1705,7 @@ static void accumulateLayerRectList(PaintLayerCompositor* compositor,
|
| LayerRectList* Internals::touchEventTargetLayerRects(
|
| Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->view() || !document->page() || document != m_document) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1734,7 +1734,7 @@ bool Internals::executeCommand(Document* document,
|
| const String& name,
|
| const String& value,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -1781,7 +1781,7 @@ StaticNodeList* Internals::nodesFromRect(Document* document,
|
| bool ignoreClipping,
|
| bool allowChildFrameContent,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame() || !document->frame()->view()) {
|
| exceptionState.throwDOMException(
|
| InvalidAccessError,
|
| @@ -1880,7 +1880,7 @@ void Internals::setMockHyphenation(const AtomicString& locale) {
|
| }
|
|
|
| bool Internals::isOverwriteModeEnabled(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame())
|
| return false;
|
|
|
| @@ -1888,7 +1888,7 @@ bool Internals::isOverwriteModeEnabled(Document* document) {
|
| }
|
|
|
| void Internals::toggleOverwriteModeEnabled(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame())
|
| return;
|
|
|
| @@ -1924,7 +1924,7 @@ bool Internals::hasGrammarMarker(Document* document,
|
| }
|
|
|
| unsigned Internals::numberOfScrollableAreas(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame())
|
| return 0;
|
|
|
| @@ -1944,7 +1944,7 @@ unsigned Internals::numberOfScrollableAreas(Document* document) {
|
| }
|
|
|
| bool Internals::isPageBoxVisible(Document* document, int pageNumber) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return document->isPageBoxVisible(pageNumber);
|
| }
|
|
|
| @@ -1955,7 +1955,7 @@ String Internals::layerTreeAsText(Document* document,
|
|
|
| String Internals::elementLayerTreeAsText(Element* element,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| FrameView* frameView = element->document().view();
|
| frameView->updateAllLifecyclePhases();
|
|
|
| @@ -1965,7 +1965,7 @@ String Internals::elementLayerTreeAsText(Element* element,
|
| bool Internals::scrollsWithRespectTo(Element* element1,
|
| Element* element2,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element1 && element2);
|
| + DCHECK(element1 && element2);
|
| element1->document().view()->updateAllLifecyclePhases();
|
|
|
| LayoutObject* layoutObject1 = element1->layoutObject();
|
| @@ -2004,7 +2004,7 @@ bool Internals::scrollsWithRespectTo(Element* element1,
|
| String Internals::layerTreeAsText(Document* document,
|
| unsigned flags,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2019,7 +2019,7 @@ String Internals::layerTreeAsText(Document* document,
|
| String Internals::elementLayerTreeAsText(Element* element,
|
| unsigned flags,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| element->document().updateStyleAndLayout();
|
|
|
| LayoutObject* layoutObject = element->layoutObject();
|
| @@ -2049,7 +2049,7 @@ String Internals::scrollingStateTreeAsText(Document*) const {
|
| String Internals::mainThreadScrollingReasons(
|
| Document* document,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2068,7 +2068,7 @@ String Internals::mainThreadScrollingReasons(
|
| ClientRectList* Internals::nonFastScrollableRects(
|
| Document* document,
|
| ExceptionState& exceptionState) const {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->frame()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2224,7 +2224,7 @@ bool Internals::magnifyScaleAroundAnchor(float scaleFactor, float x, float y) {
|
| void Internals::setIsCursorVisible(Document* document,
|
| bool isVisible,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->page()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "No context document can be obtained.");
|
| @@ -2234,14 +2234,14 @@ void Internals::setIsCursorVisible(Document* document,
|
| }
|
|
|
| String Internals::effectivePreload(HTMLMediaElement* mediaElement) {
|
| - ASSERT(mediaElement);
|
| + DCHECK(mediaElement);
|
| return mediaElement->effectivePreload();
|
| }
|
|
|
| void Internals::mediaPlayerRemoteRouteAvailabilityChanged(
|
| HTMLMediaElement* mediaElement,
|
| bool available) {
|
| - ASSERT(mediaElement);
|
| + DCHECK(mediaElement);
|
| mediaElement->remoteRouteAvailabilityChanged(
|
| available ? WebRemotePlaybackAvailability::DeviceAvailable
|
| : WebRemotePlaybackAvailability::SourceNotSupported);
|
| @@ -2250,7 +2250,7 @@ void Internals::mediaPlayerRemoteRouteAvailabilityChanged(
|
| void Internals::mediaPlayerPlayingRemotelyChanged(
|
| HTMLMediaElement* mediaElement,
|
| bool remote) {
|
| - ASSERT(mediaElement);
|
| + DCHECK(mediaElement);
|
| if (remote)
|
| mediaElement->connectedToRemoteDevice();
|
| else
|
| @@ -2309,9 +2309,39 @@ Vector<String> Internals::getReferencedFilePaths() const {
|
| return frame()->loader().currentItem()->getReferencedFilePaths();
|
| }
|
|
|
| +void Internals::startStoringCompositedLayerDebugInfo(
|
| + Document* document,
|
| + ExceptionState& exceptionState) {
|
| + DCHECK(document);
|
| + if (!document->view()) {
|
| + exceptionState.throwDOMException(InvalidAccessError,
|
| + "The document provided is invalid.");
|
| + return;
|
| + }
|
| +
|
| + FrameView* frameView = document->view();
|
| + frameView->setIsStoringCompositedLayerDebugInfo(true);
|
| + frameView->updateAllLifecyclePhases();
|
| +}
|
| +
|
| +void Internals::stopStoringCompositedLayerDebugInfo(
|
| + Document* document,
|
| + ExceptionState& exceptionState) {
|
| + DCHECK(document);
|
| + if (!document->view()) {
|
| + exceptionState.throwDOMException(InvalidAccessError,
|
| + "The document provided is invalid.");
|
| + return;
|
| + }
|
| +
|
| + FrameView* frameView = document->view();
|
| + frameView->setIsStoringCompositedLayerDebugInfo(false);
|
| + frameView->updateAllLifecyclePhases();
|
| +}
|
| +
|
| void Internals::startTrackingRepaints(Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->view()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2325,7 +2355,7 @@ void Internals::startTrackingRepaints(Document* document,
|
|
|
| void Internals::stopTrackingRepaints(Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->view()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2360,7 +2390,7 @@ void Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(
|
|
|
| void Internals::forceFullRepaint(Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->view()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2385,7 +2415,7 @@ ClientRectList* Internals::nonDraggableRegions(Document* document,
|
| ClientRectList* Internals::annotatedRegions(Document* document,
|
| bool draggable,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (!document->view()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2572,17 +2602,17 @@ ClientRect* Internals::selectionBounds(ExceptionState& exceptionState) {
|
| }
|
|
|
| String Internals::markerTextForListItem(Element* element) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| return blink::markerTextForListItem(element);
|
| }
|
|
|
| String Internals::getImageSourceURL(Element* element) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| return element->imageSourceURL();
|
| }
|
|
|
| String Internals::selectMenuListText(HTMLSelectElement* select) {
|
| - ASSERT(select);
|
| + DCHECK(select);
|
| LayoutObject* layoutObject = select->layoutObject();
|
| if (!layoutObject || !layoutObject->isMenuList())
|
| return String();
|
| @@ -2593,7 +2623,7 @@ String Internals::selectMenuListText(HTMLSelectElement* select) {
|
| }
|
|
|
| bool Internals::isSelectPopupVisible(Node* node) {
|
| - ASSERT(node);
|
| + DCHECK(node);
|
| if (!isHTMLSelectElement(*node))
|
| return false;
|
| return toHTMLSelectElement(*node).popupIsVisible();
|
| @@ -2632,7 +2662,7 @@ int Internals::selectPopupItemStyleFontHeight(Node* node, int itemIndex) {
|
| }
|
|
|
| void Internals::resetTypeAheadSession(HTMLSelectElement* select) {
|
| - ASSERT(select);
|
| + DCHECK(select);
|
| select->resetTypeAheadSessionForTesting();
|
| }
|
|
|
| @@ -2654,7 +2684,7 @@ bool Internals::loseSharedGraphicsContext3D() {
|
|
|
| void Internals::forceCompositingUpdate(Document* document,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| if (document->layoutViewItem().isNull()) {
|
| exceptionState.throwDOMException(InvalidAccessError,
|
| "The document provided is invalid.");
|
| @@ -2674,7 +2704,7 @@ void Internals::setZoomFactor(float factor) {
|
| void Internals::setShouldRevealPassword(Element* element,
|
| bool reveal,
|
| ExceptionState& exceptionState) {
|
| - ASSERT(element);
|
| + DCHECK(element);
|
| if (!isHTMLInputElement(element)) {
|
| exceptionState.throwDOMException(InvalidNodeTypeError,
|
| "The element provided is not an INPUT.");
|
| @@ -2699,7 +2729,7 @@ class AddOneFunction : public ScriptFunction {
|
|
|
| ScriptValue call(ScriptValue value) override {
|
| v8::Local<v8::Value> v8Value = value.v8Value();
|
| - ASSERT(v8Value->IsNumber());
|
| + DCHECK(v8Value->IsNumber());
|
| int intValue = v8Value.As<v8::Integer>()->Value();
|
| return ScriptValue(
|
| getScriptState(),
|
| @@ -2831,7 +2861,7 @@ void Internals::setInitialFocus(bool reverse) {
|
| }
|
|
|
| bool Internals::ignoreLayoutWithPendingStylesheets(Document* document) {
|
| - ASSERT(document);
|
| + DCHECK(document);
|
| return document->ignoreLayoutWithPendingStylesheets();
|
| }
|
|
|
| @@ -3023,9 +3053,9 @@ double Internals::monotonicTimeToZeroBasedDocumentTime(
|
|
|
| void Internals::setMediaElementNetworkState(HTMLMediaElement* mediaElement,
|
| int state) {
|
| - ASSERT(mediaElement);
|
| - ASSERT(state >= WebMediaPlayer::NetworkState::NetworkStateEmpty);
|
| - ASSERT(state <= WebMediaPlayer::NetworkState::NetworkStateDecodeError);
|
| + DCHECK(mediaElement);
|
| + DCHECK(state >= WebMediaPlayer::NetworkState::NetworkStateEmpty);
|
| + DCHECK(state <= WebMediaPlayer::NetworkState::NetworkStateDecodeError);
|
| mediaElement->setNetworkState(
|
| static_cast<WebMediaPlayer::NetworkState>(state));
|
| }
|
|
|