Skip to content
Snippets Groups Projects
  1. Jan 17, 2022
  2. Jan 05, 2022
  3. Jan 04, 2022
  4. Jan 01, 2022
    • Bobby Holley's avatar
      Bug 1746996 - Ensure that storeRawNames is always called. r=peterv · 65ffce97
      Bobby Holley authored
      To avoid copying in the common case, expat points directly into the
      (internal) input buffer for strings referenced from the tag stack. When
      expat unwinds back to the caller, it attempts to call storeRawNames() to
      walk the tag stack and copy any such strings into persistent memory
      before the caller potentially invokes XML_Parse() again and shuffles the
      input buffer, thereby invalidating these references.
      
      Unfortunately, it doesn't do it in all the right places. Because
      different parsing states set |processor| to different callbacks (so that
      parsing can resume in the right context), there are a number of
      non-obvious entry points. In this case, the input stream was chunked so
      that parsing paused in middle of processing an internal entity [1], so
      |processor| was set to internalEntityProcessor(), which invokes
      doContent() but does not call storeRawNames(). The doContent() call then
      parsed some nested tags from the entity. Tags within an entity are
      generally required to be balanced, but a host callback returned an error
      code to interrupt parsing midway through. This caused Expat to return to
      the caller with a tag stack still referencing the input buffer, which
      got clobbered in the next call to XML_Parse, causing a tag mismatch on
      the next close tag.
      
      Conceptually, this optimization should be managed by doContent(), and I
      believe the only reason that isn't the case is that doContent() has so
      many return paths (and we don't have RAII in C). We can fix this by
      wrapping doContent() in a helper.
      
      [1] &certerror.expiredCert.whatCanYouDoAboutIt2;
      
      Differential Revision: https://phabricator.services.mozilla.com/D134878
      65ffce97
  5. Dec 27, 2021
  6. Dec 25, 2021
  7. Dec 23, 2021
  8. Dec 22, 2021
  9. Dec 20, 2021
  10. Dec 19, 2021
  11. Dec 18, 2021
  12. Dec 14, 2021
  13. Dec 13, 2021
  14. Dec 20, 2021
  15. Dec 09, 2021
  16. Dec 08, 2021
  17. Dec 09, 2021
  18. Dec 08, 2021
    • Henri Sivonen's avatar
      Bug 1701828 - meta charset rewrite. r=smaug · 649a5b63
      Henri Sivonen authored
      Implements https://github.com/whatwg/html/issues/6962 . Improves performance
      when <meta charset> occurs in head but after the first kilobyte and aligns
      behavior better with WebKit and Blink.
      
      The main change is to avoid reloads when meta appears within head but
      after the first kilobyte. Prior to this change, Gecko reloaded in that
      case (in compliance with the spec!) even though WebKit and Blink did not.
      
      Differences from WebKit and Blink:
      
      * WebKit and Blink honor <meta charset> in <noscript>. This implementation
        does not.
      * WebKit and Blink look for meta as if the tree builder was unaware of
        foreign content. This implementation is foreign content-aware. This
        makes a difference for CDATA sections that contain a > before the meta
        as well as style and script elements within foreign content. This could
        happen if the CDATA section that has mysteriously been introduced around
        a what looks like a meta tag also contains another prior tag-looking
        run of text.
      * This implementation processes rel=preload and speculative loads that are
        seen before <meta charset> has been seen. WebKit and Blink instead first
        look for the meta and rewind before starting speculative parsing.
      * Unlike WebKit, if there is neither an honored meta nor syntax resembling
        an XML declaration, detection from content takes place (as in Blink).
      * Unlike Blink, if there is neither an honored meta nor syntax resembling
        an XML declaration, the detection from content is not dependent of network
        buffer boundaries.
      * Unlike Blink, detection from content can trigger a reload at the end of
        the stream if the guess made at that point differs from the first guess.
        (See below for the definition of the input to the first guess.)
      
      Differences from the old spec and Gecko previously:
      
      * Meta inside script and RCDATA elements is no longer honored.
      * Late meta is now ignored and no longer triggers a reload.
      * Later meta counts as early enough meta: In addition to the previous
        meta within the first 1024 bytes, now a meta that started within the first
        1024 bytes counts as early enough. Additionally, if by then there hasn't
        been a template start tag and head hasn't ended, meta occurring before the
        earlier of the end of the head or a template start tag counts as early
        enough.
      * Meta now counts as not-late even if the encoding label has numeric
        character reference escapes.
      * Syntax resembling an XML declaration longer than a kilobyte is honored if
        there is no honored meta.
      * If there is neither an honored meta nor syntax resembling an XML declaration,
        the initial chardetng scan is potentially longer than before: the first 1024
        bytes, the token spanning the 1024-byte boundary if there is such a token,
        and, if by then head hasn't ended and there hasn't been a template start tag
        until the end of the template start tag or the end of the token that causes
        head to end, ever comes first. However, if the token implying the end of the
        head is a text token, bytes only to the end of the previous non-text token is
        considered. (This definition avoids depending on network buffer boundaries.)
      * XML View Source now uses the code for syntax resembling an XML declaration
        instead of expat for extracting the internal encoding label.
      
      Reftest are added as both WPT and Gecko reftests in order to test both http:
      and file: URL scenarios. The Gecko tests retain the WPT <link> tags in order
      to use the exact same bytes.
      
      An encoding declaration has been added to a number of old tests that didn't
      intend to test the new speculation behavior especially in the context of
      https://bugzilla.mozilla.org/show_bug.cgi?id=1727750 .
      
      Differential Revision: https://phabricator.services.mozilla.com/D125808
      649a5b63
    • Cosmin Sabou's avatar
      Backed out changeset 1778ca2ab291 (bug 1744425) for bc failures on... · fdf40d5a
      Cosmin Sabou authored
      Backed out changeset 1778ca2ab291 (bug 1744425) for bc failures on browser_xpcom_graph_wait.js. CLOSED TREE
      fdf40d5a
    • Chris Peterson's avatar
      Bug 1744425 - Replace nsContentUtils::GenerateUUID() to nsID::GenerateUUID(). r=nika · aae95e46
      Chris Peterson authored
      Bug 1723674 added a new nsID::GenerateUUID() static factory function to generate UUIDs without the overhead of querying and instantiating an nsIUUIDGenerator object. nsContentUtils::GenerateUUID() is a utility function that amortizes that overhead by holding an nsIUUIDGenerator singleton. That's no longer necessary because code that calls nsContentUtils::GenerateUUID() can now just call nsID::GenerateUUID(). No nsIUUDGenerator is needed.
      
      Differential Revision: https://phabricator.services.mozilla.com/D132866
      aae95e46
  19. Dec 07, 2021
    • Norisz Fay's avatar
      Backed out changeset 3dfd3c94a105 (bug 1701828) for causing mochitest failures... · 1d6984bc
      Norisz Fay authored
      Backed out changeset 3dfd3c94a105 (bug 1701828) for causing mochitest failures on browser_hsts_host.js CLOSED TREE
      1d6984bc
    • Henri Sivonen's avatar
      Bug 1701828 - meta charset rewrite. r=smaug · 58476d7f
      Henri Sivonen authored
      Implements https://github.com/whatwg/html/issues/6962 . Improves performance
      when <meta charset> occurs in head but after the first kilobyte and aligns
      behavior better with WebKit and Blink.
      
      The main change is to avoid reloads when meta appears within head but
      after the first kilobyte. Prior to this change, Gecko reloaded in that
      case (in compliance with the spec!) even though WebKit and Blink did not.
      
      Differences from WebKit and Blink:
      
      * WebKit and Blink honor <meta charset> in <noscript>. This implementation
        does not.
      * WebKit and Blink look for meta as if the tree builder was unaware of
        foreign content. This implementation is foreign content-aware. This
        makes a difference for CDATA sections that contain a > before the meta
        as well as style and script elements within foreign content. This could
        happen if the CDATA section that has mysteriously been introduced around
        a what looks like a meta tag also contains another prior tag-looking
        run of text.
      * This implementation processes rel=preload and speculative loads that are
        seen before <meta charset> has been seen. WebKit and Blink instead first
        look for the meta and rewind before starting speculative parsing.
      * Unlike WebKit, if there is neither an honored meta nor syntax resembling
        an XML declaration, detection from content takes place (as in Blink).
      * Unlike Blink, if there is neither an honored meta nor syntax resembling
        an XML declaration, the detection from content is not dependent of network
        buffer boundaries.
      * Unlike Blink, detection from content can trigger a reload at the end of
        the stream if the guess made at that point differs from the first guess.
        (See below for the definition of the input to the first guess.)
      
      Differences from the old spec and Gecko previously:
      
      * Meta inside script and RCDATA elements is no longer honored.
      * Late meta is now ignored and no longer triggers a reload.
      * Later meta counts as early enough meta: In addition to the previous
        meta within the first 1024 bytes, now a meta that started within the first
        1024 bytes counts as early enough. Additionally, if by then there hasn't
        been a template start tag and head hasn't ended, meta occurring before the
        earlier of the end of the head or a template start tag counts as early
        enough.
      * Meta now counts as not-late even if the encoding label has numeric
        character reference escapes.
      * Syntax resembling an XML declaration longer than a kilobyte is honored if
        there is no honored meta.
      * If there is neither an honored meta nor syntax resembling an XML declaration,
        the initial chardetng scan is potentially longer than before: the first 1024
        bytes, the token spanning the 1024-byte boundary if there is such a token,
        and, if by then head hasn't ended and there hasn't been a template start tag
        until the end of the template start tag or the end of the token that causes
        head to end, ever comes first. However, if the token implying the end of the
        head is a text token, bytes only to the end of the previous non-text token is
        considered. (This definition avoids depending on network buffer boundaries.)
      * XML View Source now uses the code for syntax resembling an XML declaration
        instead of expat for extracting the internal encoding label.
      
      Reftest are added as both WPT and Gecko reftests in order to test both http:
      and file: URL scenarios. The Gecko tests retain the WPT <link> tags in order
      to use the exact same bytes.
      
      An encoding declaration has been added to a number of old tests that didn't
      intend to test the new speculation behavior especially in the context of
      https://bugzilla.mozilla.org/show_bug.cgi?id=1727750 .
      
      Differential Revision: https://phabricator.services.mozilla.com/D125808
      58476d7f
  20. Dec 02, 2021
  21. Dec 01, 2021
  22. Nov 27, 2021
  23. Nov 25, 2021
  24. Nov 22, 2021
  25. Nov 20, 2021
Loading