|
|
Chromium Code Reviews
DescriptionInternals methods return 0 instead of false when they fail
Some Internals method explicitly return 0 although they expect
boolean value.
BUG=
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=189813
Patch Set 1 #Patch Set 2 : rebased #Messages
Total messages: 22 (10 generated)
g.czajkowski@samsung.com changed reviewers: + shinyak@chromium.org, sigbjornf@opera.com
This brings no value but makes code base more consistent. I guess this mistake comes from Copy/Paste.
lgtm
The CQ bit was checked by g.czajkowski@samsung.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/884763003/1
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for Source/core/testing/Internals.cpp:
While running patch -p1 --forward --force --no-backup-if-mismatch;
patching file Source/core/testing/Internals.cpp
Hunk #8 succeeded at 1473 (offset -21 lines).
Hunk #9 FAILED at 1547.
1 out of 9 hunks FAILED -- saving rejects to file
Source/core/testing/Internals.cpp.rej
Patch: Source/core/testing/Internals.cpp
Index: Source/core/testing/Internals.cpp
diff --git a/Source/core/testing/Internals.cpp
b/Source/core/testing/Internals.cpp
index
ee8dd6bc0606838698ee53d8df29afeb99a22a2b..ec8d71e98bc673fc5387c5841816bcbce5300aef
100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -370,7 +370,7 @@ bool Internals::hasSelectorForIdInShadow(Element* host,
const AtomicString& idVa
ASSERT(host);
if (!host->shadow()) {
exceptionState.throwDOMException(InvalidAccessError, "The host element
does not have a shadow.");
- return 0;
+ return false;
}
return host->shadow()->ensureSelectFeatureSet().hasSelectorForId(idValue);
@@ -381,7 +381,7 @@ bool Internals::hasSelectorForClassInShadow(Element* host,
const AtomicString& c
ASSERT(host);
if (!host->shadow()) {
exceptionState.throwDOMException(InvalidAccessError, "The host element
does not have a shadow.");
- return 0;
+ return false;
}
return
host->shadow()->ensureSelectFeatureSet().hasSelectorForClass(className);
@@ -392,7 +392,7 @@ bool Internals::hasSelectorForAttributeInShadow(Element*
host, const AtomicStrin
ASSERT(host);
if (!host->shadow()) {
exceptionState.throwDOMException(InvalidAccessError, "The host element
does not have a shadow.");
- return 0;
+ return false;
}
return
host->shadow()->ensureSelectFeatureSet().hasSelectorForAttribute(attributeName);
@@ -438,7 +438,7 @@ bool Internals::hasShadowInsertionPoint(const Node* root,
ExceptionState& except
ASSERT(root);
if (!root->isShadowRoot()) {
exceptionState.throwDOMException(InvalidAccessError, "The node argument
is not a shadow root.");
- return 0;
+ return false;
}
return toShadowRoot(root)->containsShadowElements();
}
@@ -448,7 +448,7 @@ bool Internals::hasContentElement(const Node* root,
ExceptionState& exceptionSta
ASSERT(root);
if (!root->isShadowRoot()) {
exceptionState.throwDOMException(InvalidAccessError, "The node argument
is not a shadow root.");
- return 0;
+ return false;
}
return toShadowRoot(root)->containsContentElements();
}
@@ -1399,7 +1399,7 @@ bool Internals::hasSpellingMarker(Document* document, int
from, int length)
{
ASSERT(document);
if (!document->frame())
- return 0;
+ return false;
return
document->frame()->spellChecker().selectionStartHasMarkerFor(DocumentMarker::Spelling,
from, length);
}
@@ -1417,7 +1417,7 @@ bool Internals::isOverwriteModeEnabled(Document* document)
{
ASSERT(document);
if (!document->frame())
- return 0;
+ return false;
return document->frame()->editor().isOverwriteModeEnabled();
}
@@ -1494,7 +1494,7 @@ bool Internals::hasGrammarMarker(Document* document, int
from, int length)
{
ASSERT(document);
if (!document->frame())
- return 0;
+ return false;
return
document->frame()->spellChecker().selectionStartHasMarkerFor(DocumentMarker::Grammar,
from, length);
}
@@ -1547,18 +1547,18 @@ bool Internals::scrollsWithRespectTo(Element* element1,
Element* element2, Excep
RenderObject* renderer2 = element2->renderer();
if (!renderer1 || !renderer1->isBox()) {
exceptionState.throwDOMException(InvalidAccessError, renderer1 ? "The
first provided element's renderer is not a box." : "The first provided element
has no renderer.");
- return 0;
+ return false;
}
if (!renderer2 || !renderer2->isBox()) {
exceptionState.throwDOMException(InvalidAccessError, renderer2 ? "The
second provided element's renderer is not a box." : "The second provided element
has no renderer.");
- return 0;
+ return false;
}
RenderLayer* layer1 = toRenderBox(renderer1)->layer();
RenderLayer* layer2 = toRenderBox(renderer2)->layer();
if (!layer1 || !layer2) {
exceptionState.throwDOMException(InvalidAccessError, String::format("No
render layer can be obtained from the %s provided element.", layer1 ? "second" :
"first"));
- return 0;
+ return false;
}
return layer1->scrollsWithRespectTo(layer2);
The CQ bit was unchecked by commit-bot@chromium.org
New patchsets have been uploaded after l-g-t-m from sigbjornf@opera.com
The CQ bit was checked by g.czajkowski@samsung.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/884763003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_gpu on tryserver.chromium.gpu (JOB_TIMED_OUT, http://build.chromium.org/p/tryserver.chromium.gpu/builders/win_gpu/builds/12...) Timed out jobs are not retried to avoid causing additional load on the builders with large pending queues.
The CQ bit was checked by g.czajkowski@samsung.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/884763003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/4...)
On 2015/02/09 11:54:54, I haz the power (commit-bot) wrote: > Try jobs failed on following builders: > linux_blink_rel on tryserver.blink (JOB_FAILED, > http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/4...) I didn't have lucky today :)
The CQ bit was checked by g.czajkowski@samsung.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/884763003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://src.chromium.org/viewvc/blink?view=rev&revision=189813 |
