Title: [90272] tags/Safari-534.50.2/Source/WebKit/mac
- Revision
- 90272
- Author
- [email protected]
- Date
- 2011-07-01 13:42:08 -0700 (Fri, 01 Jul 2011)
Log Message
Merge 90223.
Modified Paths
Diff
Modified: tags/Safari-534.50.2/Source/WebKit/mac/ChangeLog (90271 => 90272)
--- tags/Safari-534.50.2/Source/WebKit/mac/ChangeLog 2011-07-01 20:29:55 UTC (rev 90271)
+++ tags/Safari-534.50.2/Source/WebKit/mac/ChangeLog 2011-07-01 20:42:08 UTC (rev 90272)
@@ -1,3 +1,31 @@
+2011-07-01 Lucas Forschler <[email protected]>
+
+ Merged 90233.
+
+ 2011-07-01 Andy Estes <[email protected]>
+
+ Reviewed by Mark Rowe.
+
+ Simplify MailQuirksUserScript.js
+ https://bugs.webkit.org/show_bug.cgi?id=63800
+
+ MailQuirksUserScript.js is injected into WebViews in Mail.app on
+ Leopard to resolve an incompatibility between it and the HTML5 parser.
+ It did so by taking all nodes in the document between <html> and <body>
+ and moving them to be children of <body>. This maintains Mail.app's
+ assumption that document.firstChild.firstChild == document.body.
+
+ While this script fixed a specific issue with the Signature panel in
+ Mail.app, it caused regressions in other WebViews. Since the issue with
+ the Signature panel is with the empty <head> node implicitly created by
+ the parser, we can simplify this script by removing this implicit
+ <head> in the case it has no attributes and no children. This fixes the
+ Signature panel without affecting other WebViews that have non-trivial
+ <head> nodes.
+
+ * Misc/MailQuirksUserScript.js: If <head> exists but has no attributes
+ and no children, remove it.
+
2011-06-14 Lucas Forschler <[email protected]>
Merged 88833.
Modified: tags/Safari-534.50.2/Source/WebKit/mac/Misc/MailQuirksUserScript.js (90271 => 90272)
--- tags/Safari-534.50.2/Source/WebKit/mac/Misc/MailQuirksUserScript.js 2011-07-01 20:29:55 UTC (rev 90271)
+++ tags/Safari-534.50.2/Source/WebKit/mac/Misc/MailQuirksUserScript.js 2011-07-01 20:42:08 UTC (rev 90272)
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,29 +30,11 @@
*/
(function() {
- function childrenBefore(parent, stopAt)
- {
- var children = [];
- for (var child = parent.firstChild; child != stopAt; child = child.nextSibling)
- children.push(child);
- return children;
- }
-
- // If html or body is missing, Mail.app's assumption that
- // document.firstChild.firstChild == document.body is wrong anyway,
- // so return null to not move anything.
- if (!document.documentElement || !document.body)
- return;
-
- var children = childrenBefore(document, document.documentElement);
- children = children.concat(childrenBefore(document.documentElement, document.body));
-
- for (var i = children.length - 1; i >= 0; i--) {
- var child = children[i];
- // It's not possible to move doctype nodes into the body, so just remove them.
- if (child.nodeType == child.DOCUMENT_TYPE_NODE)
- child.parentNode.removeChild(child);
- else
- document.body.insertBefore(child, document.body.firstChild);
- }
+ // The Mail.app signature panel makes the assumption that
+ // document.firstChild.firstChild == document.body. This is no longer true
+ // now that WebKit implements the HTML5 parser, which creates an implicit
+ // <head> node if not explicitly specified in content. Remove this implicit
+ // <head> so that Mail.app's assumption remains true.
+ if (document.head && !document.head.childNodes.length && !document.head.attributes.length)
+ document.documentElement.removeChild(document.head);
})();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes