Closed Bug 826834 Opened 12 years ago Closed 11 years ago

Support sharing HTML so we can share with more apps in Windows 8

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 8.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bbondy, Assigned: bbondy)

References

Details

(Whiteboard: [metro-it2][LOE:1][completed-elm])

Attachments

(1 file, 2 obsolete files)

We currently support sharing only what's selected but it is text only.
This should also support HTML text selections.
I really like this feature by the way for sharing to the mail app and to evernote. I did most of this over the holidays, just finished up today.
Attached patch Patch v1 (obsolete) — Splinter Review
Assignee: nobody → netzen
Attachment #698069 - Flags: review?(jmathies)
This line is for parity with IE10:
props->put_Description(HStringReference(url.BeginReading()).Get());

It shows up on the sharing panes better for a bunch of apps when you do that.
Comment on attachment 698069 [details] [diff] [review]
Patch v1

On the winrt bits, r+. Forwarding the review on the logic in _expandURLs to ehsan.
Attachment #698069 - Flags: review?(jmathies)
Attachment #698069 - Flags: review?(ehsan)
Attachment #698069 - Flags: review+
ehsan let me know if you can think of other important tags you think we should expand as well assuming the expanding code is OK.
Comment on attachment 698069 [details] [diff] [review]
Patch v1

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

::: widget/windows/winrt/MetroUIUtils.js
@@ +97,5 @@
> +      } else {
> +        this._expandURLs(n.children[i]);
> +      }
> +    }
> +  },

Stealing ideas from <http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsTreeSanitizer.cpp#289>, you want to handle things like:

* form.action
* link.href
* img.longdesc

etc.
Attachment #698069 - Flags: review?(ehsan) → review-
Attached patch Patch v2 (obsolete) — Splinter Review
expanded support for resolving URLs. 
Also changed to getAttribute/setAttribute because the previous trick no longer worked for some attributes.
Attachment #698069 - Attachment is obsolete: true
Attachment #698819 - Flags: review?(ehsan)
Comment on attachment 698819 [details] [diff] [review]
Patch v2

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

Actually let me replace all those toLower() calls with a single one.
Attachment #698819 - Flags: review?(ehsan)
Attached patch Patch v3.Splinter Review
Attachment #698819 - Attachment is obsolete: true
Attachment #698823 - Flags: review?(ehsan)
Comment on attachment 698823 [details] [diff] [review]
Patch v3.

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

Sorry for being pedantic, but this code can be made less horrible if you define a data table like below and just iterate over it.  r=me with that.

{
  'a': 'href',
  'img': ['src', 'longdesc'],
  ...
}
Attachment #698823 - Flags: review?(ehsan) → review+
ok sounds good.
Implemented comments as per comment 10
https://hg.mozilla.org/projects/elm/rev/6085fdcdfe88
Whiteboard: [metro-it2][LOE:1] → [metro-it2][LOE:1][completed-elm]
(In reply to comment #12)
> Implemented comments as per comment 10
> https://hg.mozilla.org/projects/elm/rev/6085fdcdfe88

Nit on https://hg.mozilla.org/projects/elm/rev/6085fdcdfe88#l3.19: you should probably use const.
No longer blocks: 801131
Blocks: 833123
This was part of the elm -> m-c migration.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
OS: Windows 8 Metro → Windows 8.1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: