Bug 78191 - WebCore::Range's setStart() and setEnd() should be called with exception code variable
Summary: WebCore::Range's setStart() and setEnd() should be called with exception code...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 18:29 PST by Sean Wang
Modified: 2012-03-28 01:02 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2012-02-08 19:47 PST, Sean Wang
ap: review-
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Wang 2012-02-08 18:29:36 PST
The declaration of WebCore::Range::setStart and WebCore::Range::setEnd are:
    void setStart(PassRefPtr<Node> container, int offset, ExceptionCode& = ASSERT_NO_EXCEPTION);
    void setEnd(PassRefPtr<Node> container, int offset, ExceptionCode& = ASSERT_NO_EXCEPTION);
They assert that the exception code parameter should not be bypassed, but in the WebCore::Range::Range(), it calls them without the ExceptionCode parameter, that will cause an assertion failure.
The code is at Source/WebCore/dom/Range.cpp:94
    setStart(startContainer, startOffset);
    setEnd(endContainer, endOffset);
Comment 1 Sean Wang 2012-02-08 19:47:52 PST
Created attachment 126225 [details]
Patch
Comment 2 Alexey Proskuryakov 2012-02-09 10:27:51 PST
Comment on attachment 126225 [details]
Patch

This change doesn't make sense to me. The whole reason for having a default argument is to not pass an argument explicitly.

Why is passing it explicitly needed in this particular case? Bug description says that an assertion is triggered, but ChangeLog says that no logic is changed. Does this fix an assertion failure or not? If there is an assertion sometimes, what test case triggers it?
Comment 3 Sean Wang 2012-03-28 01:02:53 PDT
Sorry, I misunderstood the macro ASSERT_NO_EXCEPTION.
So close this bug.