)]}'
{
  "commit": "d7949dc47dd9ed9ee1d3b34ffdcf3bce28cde435",
  "tree": "7f36618f5faf1150e9fdd9c0022da902718744e8",
  "parents": [
    "117f22084be55d51fd9c5fbffd880bc92127d6c8"
  ],
  "author": {
    "name": "Samuel Huang",
    "email": "huangs@chromium.org",
    "time": "Tue Sep 16 18:30:44 2025"
  },
  "committer": {
    "name": "Gijs Kruitbosch",
    "email": "gijskruitbosch@gmail.com",
    "time": "Mon Sep 29 22:46:40 2025"
  },
  "message": "Improve paragraph wrapping and DOM implementation\n\nThis change improves the logic for wrapping phrasing content in\nparagraphs, fixing two bugs:\n\n1. Trailing whitespace was not always trimmed correctly from phrasing\n   content at the end of a container \u0026lt;div\u0026gt;.\n2. Leading whitespace nodes could be left behind as direct children of\n   the \u003cdiv\u003e instead of being discarded.\n\nThe logic in Readability.js has been refactored to use a more robust\n\"collect and transform\" pattern. It now uses a DocumentFragment to\ngather all consecutive phrasing content, correctly trims leading /\ntrailing whitespace, and then wraps the non-empty result in a \u003cp\u003e tag.\nThis produces cleaner HTML, as reflected in the updated test pages.\n\nTo support this, several enhancements were made to the JSDOMParser.js\nDOM implementation:\n* Added support for DocumentFragment, including\n  doc.createDocumentFragment().\n* Centralized DOM insertion logic (appendChild(), insertBefore(),\n  and replaceChild()) into a single, efficient _insertNodesAtIndex()\n  private helper, ensuring consistency.\n* Made replaceChild() more robust by simplifying its implementation\n  and fixing an edge case where replacing a node with itself failed.\n* Fixed a bug in remove() where it incorrectly modified\n  element-specific properties on non-element nodes.\n\nThe test suite in test-jsdomparser.js was expanded to validate\nthese improvements, with new tests for DocumentFragment handling,\nnode moving, and self-insertion/replacement edge cases.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "4d7fccc7d00f712c746eb0b1b9654fca45d8681e",
      "old_mode": 33188,
      "old_path": "JSDOMParser.js",
      "new_id": "e93c020259f3c06ce618b5f765c269c1d50544a1",
      "new_mode": 33188,
      "new_path": "JSDOMParser.js"
    },
    {
      "type": "modify",
      "old_id": "53dacaca37aa7c110d94738b48006472e0fc073e",
      "old_mode": 33188,
      "old_path": "Readability.js",
      "new_id": "5cff4540c63fa2dd1471804ac7c919bd988638ce",
      "new_mode": 33188,
      "new_path": "Readability.js"
    },
    {
      "type": "modify",
      "old_id": "99cec50d0c203102ace7c3af4fa83bd8ba27605e",
      "old_mode": 33188,
      "old_path": "test/test-jsdomparser.js",
      "new_id": "9da4af1a25a01b80032dd584a02340d4f9f13fa5",
      "new_mode": 33188,
      "new_path": "test/test-jsdomparser.js"
    },
    {
      "type": "modify",
      "old_id": "03bc38f9bb13da7b544e5cd4ee8bd8a3d593b9a7",
      "old_mode": 33188,
      "old_path": "test/test-pages/lwn-1/expected.html",
      "new_id": "27bc8836b7b79b8796c4e056154fe1d24a52db44",
      "new_mode": 33188,
      "new_path": "test/test-pages/lwn-1/expected.html"
    },
    {
      "type": "modify",
      "old_id": "22bf83a564740871f0322fd268057a361e167585",
      "old_mode": 33188,
      "old_path": "test/test-pages/wapo-1/expected.html",
      "new_id": "b59a8aaa174cd113dcfadb19939336cd994fa60d",
      "new_mode": 33188,
      "new_path": "test/test-pages/wapo-1/expected.html"
    }
  ]
}
