WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
129145
[GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how parameter
https://bugs.webkit.org/show_bug.cgi?id=129145
Summary
[GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how ...
Tomas Popela
Reported
2014-02-21 01:57:16 PST
In GObject DOM API there is a webkit_dom_range_compare_boundary_points function (
https://developer.mozilla.org/en-US/docs/Web/API/Range.compareBoundaryPoints
) that takes second argument "how" that's type is CompareHow (in GObject DOM API it is defined as gushort). CompareHow is enum defined in
http://trac.webkit.org/browser/trunk/Source/WebCore/dom/Range.h#L87
. The problem is that START_TO_START is defined first so it has value 0, but the generator is not counting with it and it generates g_return_val_if_fail (how, 0) in WebKitDOMRange.cpp. Thus we will get a nice runtime warning: CRITICAL **: gshort webkit_dom_range_compare_boundary_points(WebKitDOMRange*, gushort, WebKitDOMRange*, GError**): assertion 'how' failed . So the generator should be aware of CompareHow while generating the g_return_* macros.
Attachments
Proposed patch
(2.43 KB, patch)
2014-02-21 02:06 PST
,
Tomas Popela
cgarcia
: review-
cgarcia
: commit-queue-
Details
Formatted Diff
Diff
Proposed patch v2
(2.88 KB, patch)
2014-03-03 01:23 PST
,
Tomas Popela
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tomas Popela
Comment 1
2014-02-21 02:06:56 PST
Created
attachment 224845
[details]
Proposed patch
Carlos Garcia Campos
Comment 2
2014-02-21 02:27:44 PST
Comment on
attachment 224845
[details]
Proposed patch View in context:
https://bugs.webkit.org/attachment.cgi?id=224845&action=review
Thanks for the patch. I think we should add a test case for this.
> Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm:897 > + if ($paramIDLType eq "CompareHow") { > + return ""; > + }
This is not correct, this method should not be called for non pointer types. We are currently checking whether the param type is primitve or not, but we should actually check that is a pointer type. my $paramTypeIsPrimitive = $codeGenerator->IsPrimitiveType($paramIDLType); my $paramIsGDOMType = IsGDOMClassType($paramIDLType); if (!$paramTypeIsPrimitive) { $gReturnMacro = GetGReturnMacro($paramName, $paramIDLType, $returnType, $functionName); push(@cBody, $gReturnMacro); } We should use my $paramTypeIsPointer = !$codeGenerator->IsNonPointerType($paramIDLType); You can also remove the paramIsGDOMType that is unused :-)
Tomas Popela
Comment 3
2014-03-03 01:23:37 PST
Created
attachment 225638
[details]
Proposed patch v2
Carlos Garcia Campos
Comment 4
2014-03-03 01:32:23 PST
Comment on
attachment 225638
[details]
Proposed patch v2 Thanks!
WebKit Commit Bot
Comment 5
2014-03-03 02:11:18 PST
Comment on
attachment 225638
[details]
Proposed patch v2 Clearing flags on attachment: 225638 Committed
r164980
: <
http://trac.webkit.org/changeset/164980
>
WebKit Commit Bot
Comment 6
2014-03-03 02:11:21 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug