Closed Bug 1869726 Opened 1 year ago Closed 1 year ago

Use latin-1 external string for UTF8String with ASCII content

Categories

(Core :: DOM: Bindings (WebIDL), enhancement)

enhancement

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: arai, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

bug 1869688 is going to add external string API for UTF-8, which uses external string if the UTF-8 contains ASCII string.

With prototype patch stack, the following cases are covered in browser startup:

NOTE: External string is used only when the string doesn't fit inline (16 bytes). If it fits inline, the behavior is equivalent to the existing code.

Convert to external string (mostly localization string (see bug 1869688 comment #4)):

  • "End Private Session"
  • "Personalize new tab"
  • "Search with Google or enter address"
  • "A selection of recent sites and content"
  • "Change search settings"
  • "Copy Without Site Tracking"
  • "End Private Session"
  • "Exceptional content curated by Pocket, part of the Firefox family"
  • "Follow the operating system setting for buttons, menus, and windows."
  • "Import bookmarks from another browser to Nightly."
  • "Manage extensions"
  • "Manage more settings"
  • "Open Developer Tools"
  • "Open context menu for " + <web page title>
  • "Open private window"
  • "Personalize new tab"
  • "Recommended by Pocket"
  • "Search in New Tab"
  • "Search with Google or enter address"
  • "Set as Default Search Engine"
  • "Set as Default Search Engine for Private Windows"
  • "Sites you save or visit"
  • "Sponsored shortcuts"
  • "Sync and save data"
  • "Take a screenshot"
  • "This plugin enables playback of encrypted media in compliance with the Encrypted Media Extensions specification. Encrypted media is typically used by sites to protect against copying of premium media content. Visit https://www.w3.org/TR/encrypted-media/ for more information on Encrypted Media Extensions."
  • "This plugin is automatically installed by Mozilla to comply with the WebRTC specification and to enable WebRTC calls with devices that require the H.264 video codec. Visit https://www.openh264.org/ to view the codec source code and learn more about the implementation."
  • "This time, search with:"
  • "inspector, devtools"
  • "logins, passwords"
  • "settings, preferences, options"
  • "view source, source"
  • ".ds-layout > .ds-column:nth-child(1) .ds-column-grid > :nth-child(2) .ds-navigation"
  • "file:///.../mozilla-unified/obj-*/tmp/profile-default/settings/main/ms-language-packs/browser/newtab/asrouter.ftl"

Converted to external string, and then assigned back to nsString:

  • "Change search settings"
  • "Copy Without Site Tracking"
  • "End Private Session"
  • "Import bookmarks from another browser to Nightly."
  • "Manage extensions"
  • "Search in New Tab"
  • "Search with Google or enter address"
  • "Set as Default Search Engine"
  • "Set as Default Search Engine for Private Windows"
  • "This time, search with:"
Blocks: 1874376
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/9b061f42271e Part 1: Add XPCStringConvert methods for conversion from UTF8 string to JS::Value. r=nika https://hg.mozilla.org/integration/autoland/rev/d819bf7b53fa Part 2: Add xpc::{UTF8StringToJsval,NonVoidUTF8StringToJsval}. r=nika https://hg.mozilla.org/integration/autoland/rev/580bab49ba2c Part 3: Add XPCStringConvert methods for conversion from possibly external string JS::Value to UTF8 string. r=nika https://hg.mozilla.org/integration/autoland/rev/4b6d579ac625 Part 4: Use latin1 JSExternalString for WebIDL UTF8String with ASCII case. r=emilio
Backout by abutkovits@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/53d4d65c33f1 Backed out 5 changesets (bug 1869726, bug 1874376) for causing build bustages at xpcpublic.h. CLOSED TREE
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/f1e6b9b10043 Part 1: Add XPCStringConvert methods for conversion from UTF8 string to JS::Value. r=nika https://hg.mozilla.org/integration/autoland/rev/14280467a98b Part 2: Add xpc::{UTF8StringToJsval,NonVoidUTF8StringToJsval}. r=nika https://hg.mozilla.org/integration/autoland/rev/2942452a2bef Part 3: Add XPCStringConvert methods for conversion from possibly external string JS::Value to UTF8 string. r=nika https://hg.mozilla.org/integration/autoland/rev/f8ff2e0342cd Part 4: Use latin1 JSExternalString for WebIDL UTF8String with ASCII case. r=emilio

Is bug 1231541 a duplicate of this? I see these patches added UTF8ToJSVal.

Flags: needinfo?(arai.unmht)

(In reply to Mathew Hodson from comment #9)

Is bug 1231541 a duplicate of this? I see these patches added UTF8ToJSVal.

I don't think so.

Flags: needinfo?(arai.unmht)
Regressions: 1878862
No longer regressions: 1878862
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: