Closed Bug 859616 Opened 11 years ago Closed 11 years ago

WebSMS: return undefined if the API is unsupported on the platform, not null

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 838146

People

(Reporter: jsmith, Assigned: vicamo)

References

Details

Attachments

(1 file)

See the discussion on bug 859554 for context. Any WebAPI that is not supported on a platform should return undefined, not null. null is only returned if the API is supported on the platform, but the web content does not have access to that API.
Blocks: 859554
blocking-b2g: --- → tef?
Summary: mozSms API - return undefined if the API is unsupported on the platform, not null → WebSMS: return undefined if the API is unsupported on the platform, not null
I selectively clicked a few depending bugs of bug 859554, only this one is nominated for tef+. Is this on purpose?
Flags: needinfo?(jsmith)
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #1)
> I selectively clicked a few depending bugs of bug 859554, only this one is
> nominated for tef+. Is this on purpose?

Nope. I forgot to clear it. Thanks for the reminder.

Technically the important piece is to fix this for Android and Desktop, not B2G, so this won't block.
blocking-b2g: tef? → ---
Flags: needinfo?(jsmith)
Blocks: 889898
Depends on: 859764
This is going to be pretty simple to do when WebSMS will be converted to WebIDL.
Hmm, it might be Navigator actually.
Depends on: 838146
No longer depends on: 859764
I believe the patches in bug 838146 do this, in fact.  Please double-check that?
Attached patch patch (deleted) — Splinter Review
This patch basically put everything related to MobileMessage into MOZ_WEBSMS_BACKEND preprocessor section.  The only exception is IPDL files because they're required even WebSMS is disabled.  No convenient way known to avoid them.

Like my bug 889898 comment 4, some of other components have a global switch to completely turn off their functions by removing them from build targets.  It's really nice to have that for WebSMS as well so that we can avoid creating problems, overheads on platforms that don't have WebSMS.  Besides, we may also skip fixing these avoidable issues when we're running out of time to deliver mandatory solution for B2G only.
Assignee: nobody → vyang
Attachment #772653 - Flags: review?(mounir)
The navigator parts of this look like they will conflict with bug 838146, for what it's worth.  I can probably merge as needed, but just FYI.

Note that with the webidl-navigator patch mozMobileMessage and mozSms are in fact conditioned on MOZ_WEBSMS_BACKEND.
(In reply to Boris Zbarsky (:bz) from comment #8)
> The navigator parts of this look like they will conflict with bug 838146,
> for what it's worth.  I can probably merge as needed, but just FYI.

Thank you.

> Note that with the webidl-navigator patch mozMobileMessage and mozSms are in
> fact conditioned on MOZ_WEBSMS_BACKEND.

Well, I mean I wish no a single line of WebSMS code is ever *COMPILED* if there is no WebSMS on that platform.  I've just had a quick scan of your patches, and you basically moved a few lines around, not really make WebSMS "conditioned on MOZ_WEBSMS_BACKEND" for me.
> Well, I mean I wish no a single line of WebSMS code is ever *COMPILED*

Sure.  That's not what this bug asked for initially, but I understand your goal.  The WebIDL patch makes those two properties invisible to page script ifndef MOZ_WEBSMS_BACKEND but the C++ code is still there, of course.
(In reply to Boris Zbarsky (:bz) from comment #10)
> Sure.  That's not what this bug asked for initially, but I understand your
> goal.  The WebIDL patch makes those two properties invisible to page script
> ifndef MOZ_WEBSMS_BACKEND but the C++ code is still there, of course.

Yes, we had a problem in last Madrid Work Week.  WebSMS is currently disabled on Fennec build, but somehow Fennec test cases were still included in B2G Birch CI and failed to run.  I really want to do something to prevent such things from happening again. :(
Comment on attachment 772653 [details] [diff] [review]
patch

Review of attachment 772653 [details] [diff] [review]:
-----------------------------------------------------------------

The Mozilla project is heading in the exact opposite direction: we want to reduce the number of compile-time options because those options are a pain to maintain. When we added the MOZ_WEBSMS_BACKEND compile option, that was mostly to prevent the permission to show up at install time on Android, it was never in order to reduce the LOC being compiled. Usually, Gecko will not expose features that are disabled but will still have them compiled and we should keep that as is IMO.
Attachment #772653 - Flags: review?(mounir) → review-
According to Mounir's comment 13, marked as duplicate of bug 838146 instead.
Status: NEW → RESOLVED
Closed: 11 years ago
No longer depends on: 838146
Resolution: --- → DUPLICATE
No longer blocks: 889898
Shall I re-open this bug?
Flags: needinfo?(VYV03354)
Flags: needinfo?(Ms2ger)
Let's do this in bug 914182.
Flags: needinfo?(VYV03354)
Ah, are you asking about SmsMessage/SmsEvent/MmsMessage/etc. ? I think it would be better to file a new bug.
Flags: needinfo?(Ms2ger)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: