-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 - ---------- On Tuesday 07 January 2003 20:31, Don Melton wrote: ---------- Subject: Our changes to KHTML and KJS Date: Tuesday 07 January 2003 20:31 From: Don Melton To: Lars Knoll , Harri Porten , Waldo Bastian , Dirk Mueller , Martin Jones , Torben Weis , Antti Koivisto , Simon Hausmann , Daniel Molkentin , Stefan Schimanski , Peter Kelly Hi, Here is the second email I promised which details our changes and additions to KHTML and KJS which were done for Safari. As it says on our open source web page at http://developer.apple.com/darwin/projects/webcore/ the sources we will post later today are based on KDE 3.0.2. The best way to see every change line by line is to diff against the originals. - -- Don Melton Safari Engineering Manager Apple Computer ================ KHTMLView & Part ================ Changes to fix crashes: - - Improved nil-document checking in some KHTMLPart code. Changes for better compatibility with web sites: - - Decode % sequences in javascript: URLs before executing them. - - Parse http-refresh delays that are not integers. - - Improved selection handling to deal with blocks inside inlines. - - Make focus happen on mousedown, not on click. Matches behavior of Gecko/WinIE. Changes to improve speed: - - Change code that checks QStrings for null to use isNull() rather than == QString::null. - - Change code that to use QConstString in more places, and to not use it when the optimization doesn't work (because the QConstString gets destroyed before the QString that's extracted from it). - - For overflow:hidden elements, added support for scheduling a layout that only repaints the overflow:hidden object. - - Added support for unscheduling layouts and repaints. Other changes: - - Change reload logic to reload if the URL has a different anchor but the rest is the same. - - Don't add so extra newlines to when extracting selected text. - - Fix problem where an empty user style sheet would cause the loader to load each page itself as a style sheet, and where not enough style recomputation was done when the user style sheet is changed. - - Changed makeprop and makevalues scripts to write out const arrays. - - Made many changes to connect with KWQ, using APPLE_CHANGES ifdef. - - Changed namespace directive use in some .cpp files to avoid ambiguity with out-of-namespace identifiers that exist in Apple headers. =============================== Style System (css subdirectory) =============================== - - Added support for an @-quirks directive, so that quirks mode rules could be specified in html4.css. - - Cleaned up @import rules to correctly indicate loading state and to inherit parse mode from parent sheets. - - Reworked font code to use 72 dpi and not 96 dpi (#ifdefed), and to not apply scaling factors in some cases (since NSFont in Cocoa does this in those cases). - - Added support for a default fixed pitch size that is independent of the serif/sans-serif size. - - Made generic family checking and font name checking faster by eliminating string compares. Also made pseudo checking faster by caching information and avoiding string compares. - - Added support for a __qem unit ("quirky" em) that is used to indicate a margin that can be collapsed away in quirks mode (for the WinIE margin collapsing quirk). - - Added support for konq-body as a font family name. Used by tables to reset to the body font in quirks mode. - - Incorporated trunk patch for handling escaped characters in the content property string. Fixed a bug in the trunk patch in order to make this patch work with the CSS W3C page. - - Improved error handling of badly named units (e.g., don't treat 10pts as valid). - - Treat overflow:scroll and auto like "hidden" for now until support for those is added. This change at least makes the overflowed objects have the correct dimensions (without screwing up the layout of the rest of the page). - - Removed konq-js-clip and cleaned up the clip code once that was removed. html4.css changes: * Changed 's margin from 10px to 8px. * Added __qem units (for collapsing margins) to elements * Removed konqblock * Changed blockquote to have top/bottom margins and to no longer flow arounds floats. * Removed the 50px width/height on s, so that they will properly be 0 by 0 when no size is set. * Changed

-

margins to match Gecko. * Removed vertical-align: middle from s rule, since inline tables should default to baseline. Added middle alignment to the body, head, and foot instead. * Eliminated the overloading of padding and cellpadding, and stopped the inheritance of padding from the parent in tables. * Eliminated many of the
rules that weren't necessary and that didn't work with center-aligned children. * Added some basic support for children within
* Stopped
from flowing around floats. * Removed rules for

and

inside
  • s, since margin collapsing now handles this. * Added a bottom margin to
    . * Added margins to form controls (since Aqua controls look very bad with no margins). * Added margins to
     elements to match Gecko/WinIE.
    * Fixed  and  to use larger and smaller instead of large
    and small.
    * Tweaked default link colors.
    * Give floating images margins in quirks mode only (matches Gecko).
    
    ======================
    DOM (dom subdirectory)
    ======================
    
    - - Added support to DocumentStyle for a CSS3 proposal for selecting
    stylesheet sets and for querying for the preferred stylesheet set.
    - - On the appropriate event objects, added support for keyCode, pageX,
    pageY, layerX, layerY and which.
    - - Implemented support on Range for createContextualFragment.
    - - Fixed doctype on Document to return null for HTML documents (only at
    the DOM level). This is per spec.
    - - Reworked DOMString for speed. Improved == operator. Inlined the
    default constructor. Eliminated the "virtual" on the destructor.
    - - Implemented setTitle on HTML documents.
    - - Added support for x and y on images (Gecko compatibility).
    
    ========================
    ECMA (ecma subdirectory)
    ========================
    
    - - get/put use identifiers instead of UStrings (for speed)
    - - Added code to deal with DOM objects to make sure they keep the same
    wrapper for the lifetime of the document and don't leak when the
    document goes away.
    - - Implement support for offsetLeft/Top/Width/Height/Parent.
    - - Added support for preferredStyleSheetSet, selectedStyleSheetSet.
    
    - - Reworked scope chains.
    - - Made sure that elements outside a  but still associated with
    the form (e.g., malformed HTML) have the  on their scope chain.
    - - Added support for keyCode, layerX, layerY, which, pageX, pageY to
    events.
    - - Pass document open calls with params to the window open.
    - - Stubbed out captureEvents and releaseEvents. Not implemented yet.
    - - Reworked  and  lookup on document to use a hash.
    - - Fixed height and width on HTML documents to use the contentsHeight
    and contentsWidth of the view.
    - - Fixed a bug with URL resolution on documents.
    - - Avoid setting of link colors to the same value by adding a check
    (this was particularly slow in i-Bench).
    - - Added support for x and y to image objects.
    - - Added support for productSub (Gecko compatibility).
    - - Improved our spoofing on various navigator object properties to work
    based off current user agent (e.g., product).
    - - Added support for createContextualFragment.
    - - To the Window object, added screenLeft, screenTop, scrollX, scrollY,
    releaseEvents, addEventListener, removeEventListener.
    
    ================================
    HTML Content (html subdirectory)
    ================================
    
    - - Lowered the tag priority of  and  to match other inlines
    (like  and ).
    - - Removed KONQBLOCK and the KONQBLOCK code completely. Elements are
    still pulled outside of the table, but they are no longer wrapped in a
    block, since that disrupts layout.
    - - Allow ID_TEXT as a child in many places where it wasn't allowed
    before. This is necessary to deal with whitespace changes (i.e., not
    eliminating whitespace from the DOM).
    - - Do not allow  and  inside the . Force them to be
    pulled out into the .
    - - Make all inlines use tag_list_1 and be very lax about allowing blocks
    inside them. With reworked block-inside-inline handling, this is now
    acceptable.
    - - Allow 
    inside

    -

    . - - Change
      and
        to allow anything from tag_list_1. They behave like other blocks now and allow content other than
      1. s within them. - - Accept