Reviewed by Dave.
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2004-05-07  Maciej Stachowiak  <mjs@apple.com>
2
3         Reviewed by Dave.
4
5         - change things around so extremely hot TokenizerString::current()
6         method doesn't have to do any work. It's cheaper to maintain the
7         relevant state than to always compute it.
8         
9         * khtml/misc/stringit.h:
10         (khtml::TokenizerString::TokenizerString): Initialize m_currentChar
11         (khtml::TokenizerString::push): update m_currentChar
12         (khtml::TokenizerString::advance): ditto
13         (khtml::TokenizerString::current): return m_currentChar
14         * khtml/misc/stringit.cpp:
15         (khtml::TokenizerString::clear): update m_currentChar
16         (khtml::TokenizerString::append): update m_currentChar
17         (khtml::TokenizerString::prepend): update m_currentChar
18
19 2004-05-07  Don Melton  <gramps@apple.com>
20
21         Reviewed by Dave.
22
23         Fixed minor, edge-case regression in KEYGEN RSA logic caused by Dave's
24         "atomic string" patch back in January.
25
26         * khtml/html/html_formimpl.cpp:
27         (HTMLKeygenElementImpl::encoding):
28
29 === Safari-139 ===
30
31 2004-05-06  Maciej Stachowiak  <mjs@apple.com>
32
33         Reviewed by Darin.
34
35         - two trivial changes for a 1% speedup, thanks to Shark
36         
37         * khtml/dom/dom_string.cpp:
38         * khtml/dom/dom_string.h:
39         (DOM::DOMString::~DOMString): inline this method because it's hot and the
40         function call overhead was very costly.
41         * WebCore.pbproj/project.pbxproj: Add -falign-loops=16
42         optimization flag, as suggested by Shark.
43
44 2004-05-06  Chris Blumenberg  <cblu@apple.com>
45
46         Added alpha to DOMRGBColor as an extension.
47
48         Reviewed by dave.
49
50         * kwq/DOM-CSS.mm:
51         (-[DOMRGBColor alpha]): new
52         * kwq/DOMExtensions.h:
53
54 2004-05-05  David Hyatt  <hyatt@apple.com>
55
56         Fix whitespace rendering for brs inside pres. The bug is 3640711.
57         
58         Reviewed by kocienda
59
60         * khtml/rendering/bidi.cpp:
61         (khtml::RenderBlock::layoutInlineChildren):
62         (khtml::RenderBlock::findNextLineBreak):
63
64 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
65
66         Reviewed by Darin.
67
68         * khtml/ecma/kjs_events.cpp:
69         (JSLazyEventListener::parseCode): Make sure to protect the
70         permanent "event" string object.
71
72 2004-05-05  David Hyatt  <hyatt@apple.com>
73
74         Fixes for 3637924, 3643356, and 3558513, all crashes in recalcStyle.  Make sure the tree is always in a
75         sane state when removing children while changing .innerHTML.
76         
77         Reviewed by darin
78
79         * khtml/xml/dom_nodeimpl.cpp:
80
81 2004-05-05  David Hyatt  <hyatt@apple.com>
82
83         A collection of fixes.
84
85         (1) Fix a regression from the style sharing landing that made visited and unvisited links accidentally share.
86         (2) Make sure 100% height divs fill the <body> in quirks mode, even if the body has no height specified.
87         (3) Make sure table cell percentage heights exclude border/padding.
88         (4) Make sure that before flexing auto height is used for the contents of the cells.
89         
90         Reviewed by darin
91
92         * khtml/css/cssstyleselector.cpp:
93         (khtml::CSSStyleSelector::canShareStyleWithElement):
94         (khtml::CSSStyleSelector::locateSharedStyle):
95         * khtml/rendering/render_box.cpp:
96         (RenderBox::calcPercentageHeight):
97         * khtml/rendering/render_table.cpp:
98         (RenderTable::layout):
99         (RenderTableSection::layoutRows):
100
101 2004-05-05  Chris Blumenberg  <cblu@apple.com>
102
103         - DOM Extensions API tweaks
104         - Implemented outerHTML
105
106         Reviewed by kocienda.
107
108         * WebCore-combined.exp:
109         * khtml/html/html_elementimpl.cpp:
110         (HTMLElementImpl::outerHTML): new
111         (HTMLElementImpl::setOuterHTML): mew
112         * khtml/html/html_elementimpl.h:
113         * kwq/DOMExtensions.h: removed background methods on table and table cell since these are unnecessary conveniences
114         * kwq/DOMHTML.mm:
115         (-[DOMHTMLElement outerHTML]): new
116         (-[DOMHTMLElement setOuterHTML:]): mew
117
118 2004-05-04  David Hyatt  <hyatt@apple.com>
119
120         Fix for 3641331, make sure <th> elements don't reset text-align to center if they inherit a specified
121         value.
122
123         Also remove the styles from <abbr> and <acronym>.
124         
125         Reviewed by darin
126
127         * khtml/css/cssstyleselector.cpp:
128         (khtml::CSSStyleSelector::adjustRenderStyle):
129         * khtml/css/html4.css:
130         * khtml/css/quirks.css:
131
132 2004-05-04  Ken Kocienda  <kocienda@apple.com>
133
134         Reviewed by Hyatt
135         
136         Fix for behavior which extends selection drawing to beginning and end of blocks.
137         I added this feature a few days ago, but my checks to see if the extension should
138         be done was naive: Is first or last item in root line box selected? Clearly this 
139         needs to be "selection is *beyond* first or last item in root line box. Done.
140
141         * khtml/rendering/render_image.cpp:
142         (RenderImage::paint): Add selectionState() == SelectionInside check.
143         * khtml/rendering/render_text.cpp:
144         (InlineTextBox::paintSelection): Constrain passed-in offsets to be relative to box.
145         Use passed-in offsets to check whether selection extends beyond this box. Also, now
146         passes in flag to tell whether the whole RenderText has selectionState() == SelectionInside
147         (in which case you always want to extend).
148         (RenderText::paint): Remove box offset constraining from here. Now done in above function.
149         * khtml/rendering/render_text.h: Modify paintSelection interface to add 
150         selectionState() == SelectionInside flag.
151
152 2004-05-04  Ken Kocienda  <kocienda@apple.com>
153
154         Reviewed by me
155         
156         Added layout tests for DOM traversal objects.
157
158         * layout-tests/traversal/node-iterator-001-expected.txt: Added.
159         * layout-tests/traversal/node-iterator-001.html: Added.
160         * layout-tests/traversal/node-iterator-002-expected.txt: Added.
161         * layout-tests/traversal/node-iterator-002.html: Added.
162         * layout-tests/traversal/node-iterator-003-expected.txt: Added.
163         * layout-tests/traversal/node-iterator-003.html: Added.
164         * layout-tests/traversal/node-iterator-004-expected.txt: Added.
165         * layout-tests/traversal/node-iterator-004.html: Added.
166         * layout-tests/traversal/node-iterator-005-expected.txt: Added.
167         * layout-tests/traversal/node-iterator-005.html: Added.
168         * layout-tests/traversal/node-iterator-006-expected.txt: Added.
169         * layout-tests/traversal/node-iterator-006.html: Added.
170         * layout-tests/traversal/node-iterator-007-expected.txt: Added.
171         * layout-tests/traversal/node-iterator-007.html: Added.
172         * layout-tests/traversal/traversal.js: Added.
173         * layout-tests/traversal/tree-walker-001-expected.txt: Added.
174         * layout-tests/traversal/tree-walker-001.html: Added.
175         * layout-tests/traversal/tree-walker-002-expected.txt: Added.
176         * layout-tests/traversal/tree-walker-002.html: Added.
177         * layout-tests/traversal/tree-walker-003-expected.txt: Added.
178         * layout-tests/traversal/tree-walker-003.html: Added.
179         * layout-tests/traversal/tree-walker-004-expected.txt: Added.
180         * layout-tests/traversal/tree-walker-004.html: Added.
181
182 2004-05-04  Ken Kocienda  <kocienda@apple.com>
183
184         Reviewed by Hyatt
185
186         * khtml/xml/dom2_traversalimpl.cpp:
187         (DOM::NodeIteratorImpl::nextNode): Change to make NodeIterators behave like the spec in that
188         reference node is null until you iterate the first time. 
189         (DOM::NodeIteratorImpl::previousNode): Ditto.
190
191 2004-05-04  Ken Kocienda  <kocienda@apple.com>
192
193         Reviewed by me
194
195         * WebCore.pbproj/project.pbxproj: Backed out unintentional
196         change.
197
198 2004-05-04  Ken Kocienda  <kocienda@apple.com>
199
200         Reviewed by Hyatt
201         
202         Implemented DOM traversal objects, NodeIterator and TreeWalker.
203
204         * WebCore-combined.exp: Regenerate
205         * WebCore.exp: Export DOMNodeFilter protocol
206         * khtml/dom/dom2_traversal.cpp: Completed half-done implementation pulled from KDE tree.
207         * khtml/dom/dom2_traversal.h: Ditto.
208         * khtml/dom/dom_doc.cpp:
209         (DOM::Document::createNodeIterator): Ditto.
210         (DOM::Document::createTreeWalker): Ditto.
211         * khtml/dom/dom_doc.h: Ditto.
212         * khtml/ecma/kjs_dom.cpp:
213         (DOMDocumentProtoFunc::tryCall): Fix cases that create traversal objects.
214         * khtml/ecma/kjs_traversal.cpp:
215         (DOMNodeIterator::getValueProperty): Add referenceNode and pointerBeforeReferenceNode
216         properties to node interator.
217         (DOMTreeWalkerProtoFunc::tryCall): Fix typo where DOMTreeWalker::PreviousNode case called previousSibling function.
218         (JSNodeFilterCondition::JSNodeFilterCondition): Implement JS glue class for node filter conditions.
219         (JSNodeFilterCondition::acceptNode): Ditto.
220         * khtml/ecma/kjs_traversal.h:
221         (KJS::DOMNodeIterator::): Add ReferenceNode and PointerBeforeReferenceNode constants.
222         * khtml/ecma/kjs_traversal.lut.h:
223         (KJS::): Regenerated
224         * khtml/xml/dom2_traversalimpl.cpp: Completed half-done implementation pulled from KDE tree.
225         * khtml/xml/dom2_traversalimpl.h: Ditto.
226         * khtml/xml/dom_docimpl.cpp:
227         (DocumentImpl::createNodeIterator): Ditto.
228         (DocumentImpl::createTreeWalker): Ditto.
229         * khtml/xml/dom_docimpl.h: Ditto.
230         * khtml/xml/dom_nodeimpl.cpp:
231         (NodeImpl::checkAddChild): Patched due to change in isAncestor function. This was the one pre-existing caller.
232         (NodeImpl::isAncestor): Changed so that it does not return true for itself: node->isAncestor(node) now returns false.
233         * khtml/xml/dom_nodeimpl.h: Made isAncestor const.
234         * kwq/DOM.mm: Implemented obj-c glue for traversal objects.
235         * kwq/DOMInternal.h: Ditto.
236         * kwq/DOMTraversal.h: Ditto.
237
238 2004-05-04  Darin Adler  <darin@apple.com>
239
240         Reviewed by Ken.
241
242         - fixed <rdar://problem/3642252>: "starting to drag a link and then releasing needs to activate the link if you are still over it"
243
244         * khtml/khtmlview.cpp:
245         (KHTMLView::viewportMouseMoveEvent): Put hysteresis check inside !APPLE_CHANGES because
246         the Web Kit does our hysteresis checks.
247         (KHTMLView::viewportMouseReleaseEvent): Ditto.
248
249         * kwq/KWQApplication.h: Removed startDragDistance and globalStrut; unused.
250         * kwq/KWQApplication.mm: Removed the implementations.
251         * kwq/KWQPointArray.h: Removed manhattanLength; unused.
252         * kwq/KWQPoint.mm:  Removed the implementation.
253
254         * WebCore-tests.exp: Removed manhattanLength.
255         * WebCore-combined.exp: Regenerated.
256
257 2004-05-03  Ken Kocienda  <kocienda@apple.com>
258
259         Reviewed by Hyatt
260
261         Nifty hack to work around problem where BR's inserted at the end of a block do not 
262         render. Since only the *last* BR has this quirk, insert two when at the end of a block.
263         Once done, you can't caret past the last one, so you never insert two again.
264
265         * khtml/editing/htmlediting_impl.cpp:
266         (InputNewlineCommandImpl::doApply)
267
268 2004-05-03  Darin Adler  <darin@apple.com>
269
270         Reviewed by Ken
271
272         - fixed <rdar://problem/3091531>: "should format copied tables with tabs between cells, spreadsheet-style, for pasting to Excel"
273         - fixed <rdar://problem/3110002>: "Find doesn't match across formatting boundaries"
274         - fixed <rdar://problem/3640340>: "REGRESSION (136-137): nil-deref in KHTMLPart::setFocusNodeIfNeeded inside triple click code after repeatedly click/drag selecting text"
275         - fixed <rdar://problem/3640422>: "too many blank lines between paragraphs in copied text"
276
277         * khtml/dom/dom2_range.h: Added == and != operators to DOMRange.
278         * khtml/dom/dom2_range.cpp: (DOM::operator==): Added.
279
280         * khtml/khtml_part.cpp:
281         (KHTMLPart::init): Don't call findTextBegin any more; it's now not used at all
282         in WebCore.
283         (KHTMLPart::clear): Don't call findTextBegin any more. Also don't set up the
284         load statistics variables.
285         (KHTMLPart::findTextNext): Roll out APPLE_CHANGES; this function is no longer
286         used in WebCore any more and instead the entire thing is compiled out.
287         (KHTMLPart::text): Reimplement this by calling one of the new text operations. All the interesting
288         parts were moved into the TextIterator class.
289         (KHTMLPart::setFocusNodeIfNeeded): Add a check for nil; this is the fix for 364030.
290
291         * khtml/khtmlpart_p.h: (KHTMLPartPrivate::KHTMLPartPrivate): Put m_findPos,
292         m_findNode, m_overURL, m_overURLTarget, m_scrollTimer, m_loadedObjects,
293         m_totalObjectCount, and m_jobPercent inside !APPLE_CHANGES.
294
295         * khtml/xml/dom_selection.h: Replaced uses of 4-character tabs with spaces.
296         (DOM::Selection::Selection): Added a constructor that takes a DOM range.
297         (DOM::Selection::operator=): Overloaded operator= for DOM range and position.
298         This is slightly more efficient than letting a second Selection object be constructed.
299         * khtml/xml/dom_selection.cpp: Replaced uses of 4-character tabs with spaces.
300         (DOM::Selection::Selection): Added a constructor that takes a DOM range.
301
302         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::findString): Reimplement find so it uses
303         the new text operations function for finding.
304
305         * khtml/misc/khtml_text_operations.h:
306         * khtml/misc/khtml_text_operations.cpp:
307         * WebCore.pbproj/project.pbxproj:
308         Added new text iterator classes that do the heavy lifting.
309
310 2004-05-03  David Hyatt  <hyatt@apple.com>
311
312         Make sure that XML processing instructions set themselves as the parent node of the stylesheets they load,
313         so that they will get stylesheetLoaded() notifications when @imported stylesheets are contained inside the
314         sheet.
315
316         Reviewed by cblu
317
318         * khtml/xml/dom_xmlimpl.cpp:
319         (ProcessingInstructionImpl::setStyleSheet):
320
321 2004-04-30  Chris Blumenberg  <cblu@apple.com>
322
323         Fixed: <rdar://problem/3543662>: HITLIST-137: REGRESSION: reproducible hang copying all text at Dave's blog, and other pages
324
325         Reviewed by dave.
326
327         * khtml/xml/dom2_rangeimpl.cpp:
328         (RangeImpl::toHTMLWithOptions): when looping with containingBlock, check the value to see if it is the same
329
330 2004-04-30  David Hyatt  <hyatt@apple.com>
331
332         Fix for 3639530, regression on generated content pages.  They crash because I forgot to null-check the style
333         object.
334         
335         Reviewed by kocienda
336
337         * khtml/css/cssstyleselector.cpp:
338         (khtml::CSSStyleSelector::checkOneSelector):
339
340 2004-04-30  John Sullivan  <sullivan@apple.com>
341
342         - added bridge method to get the NSFont used to render a node, to
343         help with supporting the font panel
344
345         Reviewed by Ken.
346
347         * kwq/WebCoreBridge.h:
348         * kwq/WebCoreBridge.mm:
349         (-[WebCoreBridge renderedFontForNode:]):
350         return nil if no renderer, otherwise return NSFont
351
352 2004-04-29  David Hyatt  <hyatt@apple.com>
353
354         Expose summary on tables.
355         
356         Reviewed by darin
357
358         * kwq/KWQAccObject.mm:
359         (-[KWQAccObject helpText]):
360
361 2004-04-29  David Hyatt  <hyatt@apple.com>
362
363         Implement image maps for accessibility.
364         
365         Reviewed by darin
366
367         * khtml/html/html_imageimpl.cpp:
368         (HTMLAreaElementImpl::getRect):
369         * khtml/html/html_imageimpl.h:
370         * khtml/rendering/render_image.cpp:
371         (RenderImage::imageMap):
372         (RenderImage::nodeAtPoint):
373         * khtml/rendering/render_image.h:
374         * kwq/KWQAccObject.h:
375         * kwq/KWQAccObject.mm:
376         (-[KWQAccObject initWithRenderer:]):
377         (-[KWQAccObject anchorElement]):
378         (-[KWQAccObject parentObject]):
379         (-[KWQAccObject parentObjectUnignored]):
380         (-[KWQAccObject addChildrenToArray:]):
381         (-[KWQAccObject role]):
382         (-[KWQAccObject helpText]):
383         (-[KWQAccObject value]):
384         (-[KWQAccObject title]):
385         (-[KWQAccObject position]):
386         (-[KWQAccObject size]):
387         (-[KWQAccObject accessibilityIsIgnored]):
388         (-[KWQAccObject accessibilityAttributeNames]):
389         (-[KWQAccObject accessibilityAttributeValue:]):
390         * kwq/KWQRegion.mm:
391         (QRegion::boundingRect):
392
393 2004-04-29  Chris Blumenberg  <cblu@apple.com>
394
395         Fixed:
396         <rdar://problem/3631431>: web archive of .Mac welcome page renders has gaps in layout
397         <rdar://problem/3631470>: news.google.com web archive has a different font than the live site
398
399         Reviewed by kocienda.
400
401         * khtml/html/html_documentimpl.cpp:
402         (HTMLDocumentImpl::determineParseMode): don't set a name on the doc type when there is no doc type in the source
403         * khtml/xml/dom_docimpl.cpp:
404         (DocumentTypeImpl::toString): don't return "<!DOCTYPE>" when there is no doc type in the source
405         * khtml/xml/dom_nodeimpl.cpp:
406         (NodeImpl::recursive_toHTMLWithOptions): don't escape STYLE text, don't include the end tags for document nodes just as we don't for start tags
407
408 2004-04-29  Darin Adler  <darin@apple.com>
409
410         Reviewed by Dave.
411
412         - some tweaks on image
413
414         * khtml/html/html_imageimpl.h: Remove unused noref bit and unneeded override of isURLAttribute.
415         * khtml/html/html_imageimpl.cpp:
416         (HTMLAreaElementImpl::HTMLAreaElementImpl): Remove unused noref bit.
417         (HTMLAreaElementImpl::parseHTMLAttribute): Remove parsing of noref; no need to store the
418         bit since it has no meaning.
419
420 2004-04-29  David Hyatt  <hyatt@apple.com>
421
422         1. Change the role of links from AXButton to AXLink.
423         2. Add support for list markers using a new role, AXListMarker.
424         
425         Reviewed by kocienda
426
427         * khtml/rendering/render_list.h:
428         (khtml::RenderListMarker::text):
429         * kwq/KWQAccObject.mm:
430         (-[KWQAccObject role]):
431         (-[KWQAccObject roleDescription]):
432         (-[KWQAccObject value]):
433         (-[KWQAccObject accessibilityIsIgnored]):
434
435 2004-04-29  Darin Adler  <darin@apple.com>
436
437         Reviewed by Ken.
438
439         - fixed <rdar://problem/3636566>: "space bar on a form button hits default button instead (autorestore.apple.com)"
440
441         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::defaultEventHandler):
442         Remove special handling for space, falling back to default AppKit behavior. Change enter handling to
443         click the form element itself in the case of elements other than text input ones.
444
445 2004-04-29  Darin Adler  <darin@apple.com>
446
447         Reviewed by Ken.
448
449         - fixed <rdar://problem/3636673>: "unrepro nil-deref crash in KHTMLPart::frameDetached() (espn.com)"
450
451         * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Check for nil.
452
453 2004-04-28  Chris Blumenberg  <cblu@apple.com>
454
455         - Implemented DOMHTMLElementExtensions.
456         - Added stubs for the rest of the DOM API.
457
458         Reviewed by dave.
459
460         * WebCore.pbproj/project.pbxproj:
461         * khtml/dom/html_element.cpp:
462         (HTMLElement::setContentEditable): moved implementation from here to HTMLElementImpl
463         * khtml/html/html_elementimpl.cpp:
464         (HTMLElementImpl::setContentEditable): new, moved from HTMLElement
465         * khtml/html/html_elementimpl.h:
466         * kwq/DOM-CSS.mm:
467         (-[DOMObject sheet]):
468         (-[DOMDocument getComputedStyle::]):
469         * kwq/DOM.mm:
470         (-[DOMAbstractView document]):
471         (-[DOMDocumentView defaultView]):
472         (-[DOMDocument createNodeIterator::::]):
473         (-[DOMDocument createTreeWalker::::]):
474         (-[DOMNodeFilter acceptNode:]):
475         (-[DOMNodeIterator root]):
476         (-[DOMNodeIterator whatToShow]):
477         (-[DOMNodeIterator filter]):
478         (-[DOMNodeIterator expandEntityReferences]):
479         (-[DOMNodeIterator nextNode]):
480         (-[DOMNodeIterator previousNode]):
481         (-[DOMNodeIterator detach]):
482         (-[DOMTreeWalker root]):
483         (-[DOMTreeWalker whatToShow]):
484         (-[DOMTreeWalker filter]):
485         (-[DOMTreeWalker expandEntityReferences]):
486         (-[DOMTreeWalker currentNode]):
487         (-[DOMTreeWalker setCurrentNode:]):
488         (-[DOMTreeWalker parentNode]):
489         (-[DOMTreeWalker firstChild]):
490         (-[DOMTreeWalker lastChild]):
491         (-[DOMTreeWalker previousSibling]):
492         (-[DOMTreeWalker nextSibling]):
493         (-[DOMTreeWalker previousNode]):
494         (-[DOMTreeWalker nextNode]):
495         * kwq/DOMEvents.mm: Added.
496         (-[DOMEvent type]):
497         (-[DOMEvent target]):
498         (-[DOMEvent currentTarget]):
499         (-[DOMEvent eventPhase]):
500         (-[DOMEvent bubbles]):
501         (-[DOMEvent cancelable]):
502         (-[DOMEvent timeStamp]):
503         (-[DOMEvent stopPropagation]):
504         (-[DOMEvent preventDefault]):
505         (-[DOMEvent initEvent:::]):
506         (-[DOMEventTarget addEventListener:::]):
507         (-[DOMEventTarget removeEventListener:::]):
508         (-[DOMEventTarget dispatchEvent:]):
509         (-[DOMMouseEvent screenX]):
510         (-[DOMMouseEvent screenY]):
511         (-[DOMMouseEvent clientX]):
512         (-[DOMMouseEvent clientY]):
513         (-[DOMMouseEvent ctrlKey]):
514         (-[DOMMouseEvent shiftKey]):
515         (-[DOMMouseEvent altKey]):
516         (-[DOMMouseEvent metaKey]):
517         (-[DOMMouseEvent button]):
518         (-[DOMMouseEvent relatedTarget]):
519         (-[DOMMouseEvent initMouseEvent:::::::::::::::]):
520         (-[DOMMutationEvent relatedNode]):
521         (-[DOMMutationEvent prevValue]):
522         (-[DOMMutationEvent newValue]):
523         (-[DOMMutationEvent attrName]):
524         (-[DOMMutationEvent attrChange]):
525         (-[DOMMutationEvent initMutationEvent::::::::]):
526         (-[DOMUIEvent view]):
527         (-[DOMUIEvent detail]):
528         (-[DOMUIEvent initUIEvent:::::]):
529         (-[DOMDocument createEvent:]):
530         * kwq/DOMHTML.mm:
531         (-[DOMHTMLElement innerHTML]): implemented
532         (-[DOMHTMLElement setInnerHTML:]): implemented
533         (-[DOMHTMLElement innerText]): implemented
534         (-[DOMHTMLElement setInnerText:]): implemented
535         (-[DOMHTMLElement children]): implemented
536         (-[DOMHTMLElement contentEditable]): implemented
537         (-[DOMHTMLElement setContentEditable:]): implemented
538         (-[DOMHTMLElement isContentEditable]): implemented
539
540 2004-04-27  David Hyatt  <hyatt@apple.com>
541
542         Implement sharing of similar style objects. Cuts the # of style objects allocated on the PLT by more
543         than half.
544         
545         Reviewed by kocienda
546
547         * khtml/css/cssstyleselector.cpp:
548         (khtml::CSSStyleSelector::initElementAndPseudoState):
549         (khtml::CSSStyleSelector::initForStyleResolve):
550         (khtml::cleanpath):
551         (khtml::checkPseudoState):
552         (khtml::CSSStyleSelector::locateSiblingList):
553         (khtml::CSSStyleSelector::canShareStyleWithElement):
554         (khtml::CSSStyleSelector::locateSharedStyle):
555         (khtml::CSSStyleSelector::styleForElement):
556         (khtml::CSSStyleSelector::pseudoStyleForElement):
557         (khtml::CSSStyleSelector::checkOneSelector):
558         * khtml/css/cssstyleselector.h:
559         * khtml/css/html4.css:
560         * khtml/css/parser.cpp:
561         * khtml/css/parser.y:
562         * khtml/html/html_baseimpl.cpp:
563         (HTMLBodyElementImpl::mapToEntry):
564         (HTMLIFrameElementImpl::mapToEntry):
565         * khtml/html/html_baseimpl.h:
566         * khtml/html/html_blockimpl.cpp:
567         (HTMLDivElementImpl::mapToEntry):
568         (HTMLHRElementImpl::mapToEntry):
569         (HTMLParagraphElementImpl::mapToEntry):
570         (HTMLMarqueeElementImpl::mapToEntry):
571         * khtml/html/html_blockimpl.h:
572         * khtml/html/html_elementimpl.cpp:
573         (HTMLNamedAttrMapImpl::declCount):
574         (HTMLNamedAttrMapImpl::mapsEquivalent):
575         (HTMLElementImpl::attributeChanged):
576         (HTMLElementImpl::mapToEntry):
577         * khtml/html/html_elementimpl.h:
578         (DOM::HTMLElementImpl::isMappedAttribute):
579         * khtml/html/html_formimpl.cpp:
580         (HTMLInputElementImpl::mapToEntry):
581         * khtml/html/html_formimpl.h:
582         * khtml/html/html_imageimpl.cpp:
583         (HTMLImageElementImpl::mapToEntry):
584         * khtml/html/html_imageimpl.h:
585         * khtml/html/html_inlineimpl.cpp:
586         (HTMLBRElementImpl::mapToEntry):
587         (HTMLFontElementImpl::mapToEntry):
588         * khtml/html/html_inlineimpl.h:
589         * khtml/html/html_listimpl.cpp:
590         (HTMLUListElementImpl::mapToEntry):
591         (HTMLOListElementImpl::mapToEntry):
592         (HTMLLIElementImpl::mapToEntry):
593         * khtml/html/html_listimpl.h:
594         * khtml/html/html_objectimpl.cpp:
595         (HTMLAppletElementImpl::mapToEntry):
596         (HTMLEmbedElementImpl::mapToEntry):
597         (HTMLObjectElementImpl::mapToEntry):
598         * khtml/html/html_objectimpl.h:
599         * khtml/html/html_tableimpl.cpp:
600         (HTMLTableElementImpl::mapToEntry):
601         (HTMLTablePartElementImpl::mapToEntry):
602         (HTMLTableCellElementImpl::mapToEntry):
603         (HTMLTableColElementImpl::mapToEntry):
604         (HTMLTableCaptionElementImpl::mapToEntry):
605         * khtml/html/html_tableimpl.h:
606         * khtml/rendering/render_object.cpp:
607         (RenderObject::setStyle):
608         * khtml/rendering/render_style.cpp:
609         (m_affectedByAttributeSelectors):
610         (RenderStyle::RenderStyle):
611         * khtml/rendering/render_style.h:
612         (khtml::):
613         (khtml::RenderStyle::pseudoState):
614         (khtml::RenderStyle::setPseudoState):
615         (khtml::RenderStyle::affectedByAttributeSelectors):
616         (khtml::RenderStyle::setAffectedByAttributeSelectors):
617         * khtml/xml/dom_docimpl.cpp:
618         (DocumentImpl::DocumentImpl):
619         * khtml/xml/dom_docimpl.h:
620         (DOM::DocumentImpl::usesSiblingRules):
621         (DOM::DocumentImpl::setUsesSiblingRules):
622
623 2004-04-28  Darin Adler  <darin@apple.com>
624
625         Reviewed by Chris.
626
627         - another step of refinement on the reinterpret_cast stuff; now it's a compile-time
628           error if you do it wrong
629         - fixed a couple of storage leaks
630
631         * kwq/DOMInternal.h: Added new DOM_cast template function. Like reinterpret_cast, but a
632         compile-time error if you use it with the wrong parameters. Also added type-safe versions
633         of the wrapper functions that do the DOM_cast automatically.
634         * kwq/DOMInternal.mm:
635         (getDOMWrapperImpl): Changed name and parameter type as part of above change.
636         (addDOMWrapperImpl): Ditto.
637         (removeDOMWrapper): Ditto.
638
639         * kwq/DOM.mm: Use the new DOM_cast instead of reinterpret_cast, and the new
640         DOM wrapper calls that do the cast automatically.
641         * kwq/DOM-CSS.mm: More of the same.
642         (-[DOMCSSStyleSheet dealloc]): Added override to deref, fixes leak.
643         * kwq/DOMHTML.mm: More of the same.
644         (-[DOMHTMLCollection dealloc]): Added override to deref, fixes leak.
645         (-[DOMHTMLOptionsCollection dealloc]): Added override to deref, fixes theoretical leak.
646
647 2004-04-28  Darin Adler  <darin@apple.com>
648
649         Reviewed by Chris.
650
651         - fixed reinterpret_cast mistakes and some style issues in DOM implementation
652
653         * kwq/DOM-CSS.mm:
654         (-[DOMCSSStyleRule _styleRuleImpl]): Fix broken reinterpret_cast; you must reinterpret_cast back
655         to the class you reinterpret_casted from, not to a derived class.
656         (-[DOMCSSMediaRule _mediaRuleImpl]): Ditto.
657         (-[DOMCSSFontFaceRule _fontFaceRuleImpl]): Ditto.
658         (-[DOMCSSPageRule _pageRuleImpl]): Ditto.
659         (-[DOMCSSImportRule _importRuleImpl]): Ditto.
660         (-[DOMCSSCharsetRule _importRuleImpl]): Ditto.
661         * kwq/DOMHTML.mm:
662         (-[DOMHTMLOptionsCollection length]): Put in an "unimplemented" version instead of leaving out
663         the class implementation altogether.
664         (-[DOMHTMLOptionsCollection setLength:]): Ditto.
665         (-[DOMHTMLOptionsCollection item:]): Ditto.
666         (-[DOMHTMLOptionsCollection namedItem:]): Ditto.
667         (+[DOMHTMLElement _elementWithImpl:]): Corrected this implementation. The wrapper must use a
668         standard node wrapper, since this is a subclass of DOMNode. Also moved into a separate category
669         so it gets checked against the declarations above.
670         (-[DOMHTMLElement _HTMLElementImpl]): Fix broken reinterpret_cast.
671         (-[DOMHTMLHtmlElement _HTMLHtmlElementImpl]): Ditto.
672         (-[DOMHTMLHeadElement _headElementImpl]): Ditto.
673         (-[DOMHTMLLinkElement _linkElementImpl]): Ditto.
674         (-[DOMHTMLTitleElement _titleElementImpl]): Ditto.
675         (-[DOMHTMLMetaElement _metaElementImpl]): Ditto.
676         (-[DOMHTMLBaseElement _baseElementImpl]): Ditto.
677         (-[DOMHTMLStyleElement _styleElementImpl]): Ditto.
678         (-[DOMHTMLBodyElement _bodyElementImpl]): Ditto.
679         (-[DOMHTMLFormElement _formElementImpl]): Ditto.
680         (+[DOMHTMLFormElement _formElementWithImpl:]): Another DOMNode subclass wrapper fix.
681         (-[DOMHTMLIsIndexElement _isIndexElementImpl]): Fix broken reinterpret_cast.
682         (-[DOMHTMLSelectElement _selectElementImpl]): Ditto.
683         (-[DOMHTMLOptGroupElement _optGroupElementImpl]): Ditto.
684         (-[DOMHTMLOptionElement _optionElementImpl]): Ditto.
685         (-[DOMHTMLInputElement _inputElementImpl]): Ditto.
686         (-[DOMHTMLTextAreaElement _textAreaElementImpl]): Ditto.
687         (-[DOMHTMLButtonElement _buttonElementImpl]): Ditto.
688         (-[DOMHTMLLabelElement _labelElementImpl]): Ditto.
689         (-[DOMHTMLFieldSetElement _fieldSetElementImpl]): Ditto.
690         (-[DOMHTMLLegendElement _legendElementImpl]): Ditto.
691         (-[DOMHTMLUListElement _uListElementImpl]): Ditto.
692         (-[DOMHTMLOListElement _oListElementImpl]): Ditto.
693         (-[DOMHTMLDListElement _dListElementImpl]): Ditto.
694         (-[DOMHTMLDirectoryElement _directoryListElementImpl]): Ditto.
695         (-[DOMHTMLMenuElement _menuListElementImpl]): Ditto.
696         (-[DOMHTMLLIElement _liElementImpl]): Ditto.
697         (-[DOMHTMLQuoteElement _quoteElementImpl]): Ditto.
698         (-[DOMHTMLDivElement _divElementImpl]): Ditto.
699         (-[DOMHTMLParagraphElement _paragraphElementImpl]): Ditto.
700         (-[DOMHTMLHeadingElement _headingElementImpl]): Ditto.
701         (-[DOMHTMLPreElement _preElementImpl]): Ditto.
702         (-[DOMHTMLBRElement _BRElementImpl]): Ditto.
703         (-[DOMHTMLBaseFontElement _baseFontElementImpl]): Ditto.
704         (-[DOMHTMLFontElement _fontElementImpl]): Ditto.
705         (-[DOMHTMLHRElement _HRElementImpl]): Ditto.
706         (-[DOMHTMLModElement _modElementImpl]): Ditto.
707         (-[DOMHTMLAnchorElement _anchorElementImpl]): Ditto.
708         (-[DOMHTMLImageElement _imageElementImpl]): Ditto.
709         (-[DOMHTMLObjectElement _objectElementImpl]): Ditto.
710         (-[DOMHTMLParamElement _paramElementImpl]): Ditto.
711         (-[DOMHTMLAppletElement _appletElementImpl]): Ditto.
712         (-[DOMHTMLMapElement _mapElementImpl]): Ditto.
713         (-[DOMHTMLAreaElement _areaElementImpl]): Ditto.
714         (-[DOMHTMLScriptElement _scriptElementImpl]): Ditto.
715         (+[DOMHTMLTableCaptionElement _tableCaptionElementWithImpl:]): Another DOMNode subclass wrapper fix.
716         (-[DOMHTMLTableCaptionElement _tableCaptionElementImpl]): Fix broken reinterpret_cast.
717         (+[DOMHTMLTableSectionElement _tableSectionElementWithImpl:]): Another DOMNode subclass wrapper fix.
718         (-[DOMHTMLTableSectionElement _tableSectionElementImpl]): Fix broken reinterpret_cast.
719         (+[DOMHTMLTableElement _tableElementWithImpl:]): Another DOMNode subclass wrapper fix.
720         (-[DOMHTMLTableElement _tableElementImpl]): Fix broken reinterpret_cast.
721         (-[DOMHTMLTableColElement _tableColElementImpl]): Ditto.
722         (-[DOMHTMLTableRowElement _tableRowElementImpl]): Ditto.
723         (+[DOMHTMLTableCellElement _tableCellElementWithImpl:]): Another DOMNode subclass wrapper fix.
724         (-[DOMHTMLTableCellElement _tableCellElementImpl]): Fix broken reinterpret_cast.
725         (-[DOMHTMLFrameSetElement _frameSetElementImpl]): Ditto.
726         (-[DOMHTMLFrameElement _frameElementImpl]): Ditto.
727         (-[DOMHTMLIFrameElement _IFrameElementImpl]): Ditto.
728         (-[DOMHTMLEmbedElement _embedElementImpl]): Ditto.
729
730         * kwq/HTMLDOM.mm: Removed.
731
732 2004-04-28  Ken Kocienda  <kocienda@apple.com>
733
734         Reviewed by Darin
735
736         * khtml/khtml_part.cpp:
737         (KHTMLPart::notifySelectionChanged): Call new postDidChangeSelectionNotification function
738         to send Cocoa notification when the selection changes.
739         (KHTMLPart::appliedEditing): Call postDidChangeNotification to send Cocoa notification when the document changes
740         due to editing.
741         (KHTMLPart::unappliedEditing): Ditto.
742         (KHTMLPart::reappliedEditing): Ditto.
743         * kwq/DOMHTML.mm:
744         (-[DOMHTMLDocument _HTMLDocumentImpl]): Fix cast to account for multiple inheritance used by the impl class.
745         * kwq/KWQKHTMLPart.h:
746         * kwq/KWQKHTMLPart.mm:
747         (KWQKHTMLPart::postDidChangeSelectionNotification): New function. Call the bridge to post the notification.
748         (KWQKHTMLPart::postDidChangeNotification): Ditto.
749         * kwq/WebCoreBridge.h: Declare new -postDidChangeSelectionNotification and -postDidChangeNotification methods.
750
751 2004-04-28  Darin Adler  <darin@apple.com>
752
753         Reviewed by Ken.
754
755         - fixed <rdar://problem/3636261>: "nil-deref in selectedStylesheetSet iterating through properties in a non-view document"
756
757         * khtml/xml/dom_docimpl.cpp:
758         (DocumentImpl::selectedStylesheetSet): Add nil check.
759         (DocumentImpl::setSelectedStylesheetSet): Ditto.
760
761 2004-04-27  Richard Williamson   <rjw@apple.com>
762
763         <rdar://problem/3564519>: API: please add a way to set the media type for a WebView
764
765         Reviewed by Chris.
766
767         * khtml/khtmlview.cpp:
768         (KHTMLView::mediaType):
769         * kwq/KWQKHTMLPart.h:
770         * kwq/KWQKHTMLPart.mm:
771         (KWQKHTMLPart::overrideMediaType):
772         * kwq/WebCoreBridge.h:
773
774 2004-04-27  Ken Kocienda  <kocienda@apple.com>
775
776         Reviewed by Hyatt
777         
778         Make selections draw in a more Cocoa-like way, where
779         fully-selected lines draw out to the ends of lines, and
780         spaces between lines are drawn with the selection color as well.
781
782         * WebCore-combined.exp: Add _WebCoreInitializeEmptyTextGeometry symbol
783         * WebCore.exp: Ditto.
784         * khtml/khtml_part.cpp:
785         (KHTMLPart::isPointInsideSelection): Marginally-related change. Fix up this function
786         so that it works right, given my recent changes to positionForCoordinates. This fix
787         "really" fixes the problem. Unlike my attempt to fix yesterday.
788         * khtml/rendering/font.cpp:
789         (Font::drawHighlightForText): New drawHighlightForText interface which includes extra
790         information to draw the selection.
791         * khtml/rendering/font.h: Ditto.
792         * khtml/rendering/render_block.cpp:
793         (khtml::RenderBlock::positionForCoordinates): Some minor improvements and cleanups to
794         make this code work correctly in more cases.
795         * khtml/rendering/render_block.h: Remove spurious semi-colon after namespace block.
796         * khtml/rendering/render_container.cpp:
797         (RenderContainer::positionForCoordinates): Fix typo in comment. Also, clean up
798         one unnecessary call to absolutePosition.
799         * khtml/rendering/render_image.cpp:
800         (RenderImage::paint): Many changes to add the new selection drawing behavior.
801         * khtml/rendering/render_inline.cpp:
802         (RenderInline::positionForCoordinates): Added to help make selections work right 
803         with continuations.
804         * khtml/rendering/render_inline.h: Ditto.
805         * khtml/rendering/render_object.h: Give zero default argument to inlineBox() helper.
806         * khtml/rendering/render_text.cpp:
807         (InlineTextBox::paintSelection): Many changes to add the new selection drawing behavior.
808         * kwq/KWQListBox.mm:
809         (-[KWQTableView drawRow:clipRect:]): Use new WebCoreTextGeometry struct.
810         * kwq/KWQPainter.h: New drawHighlightForText interface which includes extra
811         information to draw the selection.
812         * kwq/KWQPainter.mm:
813         (QPainter::drawText): Use new WebCoreInitializeEmptyTextGeometry struct.
814         (QPainter::drawHighlightForText): Use new WebCoreTextGeometry struct.
815         * kwq/WebCoreTextRenderer.h: Declare new WebCoreTextGeometry struct.
816         * kwq/WebCoreTextRendererFactory.m:
817         (WebCoreInitializeEmptyTextGeometry): Initializer for WebCoreTextGeometry struct.
818
819 2004-04-27  Richard Williamson   <rjw@apple.com>
820
821         Don't do unnecessary string comparisons when no composite operator is
822         specified.  
823
824         Reviewed by Hyatt.
825
826         * kwq/KWQPainter.mm:
827         (compositeOperatorFromString):
828
829 2004-04-27  Darin Adler  <darin@apple.com>
830
831         Reviewed by Ken.
832
833         - fixed <rdar://problem/3623694>: "top level <option> and <optgroup> labels look identical in pop-up menus; should not"
834
835         * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
836         Call appendGroupLabel instead of appendItem for group labels.
837
838         * kwq/KWQComboBox.h: Added appendGroupLabel, private setControlSize, labelFont, setTitle, _labelFont,
839         and make _items a QValueList<KWQListBoxItem> instead of QStringList.
840         * kwq/KWQComboBox.mm:
841         (QComboBox::QComboBox): Initializes _labelFont to nil.
842         (QComboBox::~QComboBox): Release _labelFont.
843         (QComboBox::setTitle): Added helper function. Uses an attributed string for group labels, and also sets
844         the action to NULL so they are disabled.
845         (QComboBox::appendItem): Added isLabel boolean parameter, make KWQListBoxItem, call setTitle.
846         (QComboBox::sizeHint): Changed to handle group labels with a separate renderer to measure bolded text.
847         (QComboBox::setCurrentItem): Changed to use setTitle helper.
848         (QComboBox::setFont): Release _labelFont if control size changed.
849         (QComboBox::labelFont): Compute label font lazily.
850         (QComboBox::populateMenu): Changed to use setTitle helper.
851
852         * kwq/KWQListBox.h: Removed excess includes, fixed comment.
853
854 2004-04-26  Darin Adler  <darin@apple.com>
855
856         Reviewed by Maciej.
857
858         - follow-on to fix for <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"
859         This part fixes anchor names with non-ASCII characters in local files.
860
861         * kwq/KWQKURL.mm: (KURL::KURL): For file and help URLs, force UTF-8 only for the path part of the URL.
862         Use the document encoding for the rest of the URL.
863         * kwq/KWQTextCodec.h: (operator!=): Added.
864
865 2004-04-26  David Hyatt  <hyatt@apple.com>
866
867         Fix for Emerson truncation problem using apple-line-clamp.  Always dirty positioned objects so that they
868         will move when the height changes.
869         
870         Reviewed by darin
871
872         * khtml/rendering/render_block.cpp:
873         (khtml::RenderBlock::markPositionedObjectsForLayout):
874         * khtml/rendering/render_block.h:
875         * khtml/rendering/render_flexbox.cpp:
876         (khtml::RenderFlexibleBox::layoutVerticalBox):
877
878 2004-04-26  Richard Williamson   <rjw@apple.com>
879
880         Added support for specifying composite operation on an
881         image element.  Attribute name is "composite", possible values
882         are:
883
884         clear,
885         copy
886         source-over
887         source-in
888         source-out
889         source-atop
890         destination-over
891         destination-in
892         destination-out
893         destination-atop
894         xor
895         darker
896         highlight
897         lighter
898
899         <img composite="source-over" src="triangle.png">
900         <img style="position:relative; left:-200px;" composite="destination-in" src="circle.png">
901
902         Reviewed by Ken.
903
904         * khtml/html/html_imageimpl.cpp:
905         (HTMLImageElementImpl::parseHTMLAttribute):
906         * khtml/html/html_imageimpl.h:
907         (DOM::HTMLImageElementImpl::compositeOperator):
908         * khtml/misc/htmlattrs.c:
909         (findAttr):
910         * khtml/misc/htmlattrs.h:
911         * khtml/misc/htmlattrs.in:
912         * khtml/rendering/render_image.cpp:
913         (RenderImage::paint):
914         * kwq/KWQPainter.h:
915         * kwq/KWQPainter.mm:
916         (compositeOperatorFromString):
917         (QPainter::drawPixmap):
918         * kwq/WebCoreImageRenderer.h:
919
920 2004-04-26  Darin Adler  <darin@apple.com>
921
922         - fixed <rdar://problem/3634145>: "REGRESSION: nil-deref in QTextCodec::toUnicode every time loading page at wiki.wordpress.org"
923
924         * kwq/KWQKURL.mm:
925         (KURL::KURL): Simplify check for nil that defaults to UTF-8.
926         (KURL::decode_string): Add a similar test here.
927
928 2004-04-26  David Hyatt  <hyatt@apple.com>
929
930         Implement the quirk that makes the <body> and <html> size to fill the viewport in quirks mode.  This
931         matches WinIE.
932         
933         Reviewed by john
934
935         * khtml/rendering/render_box.cpp:
936         (RenderBox::calcHeight):
937
938 2004-04-26  Ken Kocienda  <kocienda@apple.com>
939
940         Reviewed by John
941         
942         Fix for this bug:
943         
944         <rdar://problem/3633458>: "REGRESSION (125-137): Can't drag a selection unless it starts at beginning of line"
945
946         * khtml/khtml_part.cpp:
947         (KHTMLPart::isPointInsideSelection): I flubbed when I converted this
948         code to use my new positionForCoordinates helper. I failed to add in
949         the passed in values for x and y to the absolute coordinates for the
950         clicked node. So, the "unless it starts at beginning of line" behavior 
951         is exactly as one would expect.
952
953 2004-04-25  David Hyatt  <hyatt@apple.com>
954
955         Eliminate overhangingContents.  This concept was redundant with the overflowHeight mechanism that I
956         implemented some time ago, and in fact, it causes us to grovel through much more of the render tree
957         than we should when painting.  It turns out that none of the places that used this boolean needed
958         to any longer, and so the entire implementation can now be removed from the tree.
959         
960         Reviewed by mjs, darin
961
962         * khtml/rendering/render_block.cpp:
963         (khtml::RenderBlock::addChildToFlow):
964         (khtml::RenderBlock::layoutBlock):
965         (khtml::RenderBlock::paint):
966         (khtml::RenderBlock::insertPositionedObject):
967         * khtml/rendering/render_box.cpp:
968         (RenderBox::calcHeight):
969         * khtml/rendering/render_image.cpp:
970         (RenderImage::setStyle):
971         * khtml/rendering/render_inline.cpp:
972         (RenderInline::addChildToFlow):
973         * khtml/rendering/render_object.cpp:
974         (RenderObject::RenderObject):
975         (RenderObject::containingBlock):
976         (RenderObject::information):
977         (RenderObject::dump):
978         (RenderObject::nodeAtPoint):
979         * khtml/rendering/render_object.h:
980         (khtml::RenderObject::minMaxKnown):
981         * khtml/rendering/render_table.cpp:
982         (RenderTable::layout):
983         (RenderTable::paint):
984         (RenderTableCell::paint):
985
986 2004-04-23  David Hyatt  <hyatt@apple.com>
987
988         Fix for 3258403, implement support for min-height and max-height on normal flow elements.  With this patch the
989         only min-height/max-height work that remains to be done is for table cells and positioned elements.
990         
991         Reviewed by darin
992
993         * khtml/rendering/render_box.cpp:
994         (RenderBox::calcHeight):
995         (RenderBox::calcHeightUsing):
996         (RenderBox::calcPercentageHeight):
997         * khtml/rendering/render_box.h:
998         * layout-tests/fast/block/basic/minheight-expected.txt: Added.
999         * layout-tests/fast/block/basic/minheight.html: Added.
1000
1001 2004-04-25  Darin Adler  <darin@apple.com>
1002
1003         Reviewed by Dave.
1004
1005         - fixed <rdar://problem/3633091>: "add overrideMimeType function to XMLHttpRequest"
1006
1007         * khtml/ecma/xmlhttprequest.cpp:
1008         (KJS::XMLHttpRequest::getValueProperty): Add logic to override MIME type if
1009         OverrideMIMEType was called.
1010         (KJS::XMLHttpRequestProtoFunc::tryCall): Store the MIME type when overrideMimeType is called.
1011         * khtml/ecma/xmlhttprequest.h: Add OverrideMIMEType to the XMLHttpRequest property enum,
1012         and also add a MIMETypeOverride data member to the class.
1013         * khtml/ecma/xmlhttprequest.lut.h: Regenerated.
1014
1015 2004-04-25  Maciej Stachowiak  <mjs@apple.com>
1016
1017         Reviewed by Darin.
1018
1019         <rdar://problem/3628309>: Fedex tracking page so slow it seems like a hang (site change?)
1020         <rdar://problem/3608061>: "ATI Developer site so slow it seems like a hang"
1021         <rdar://problem/3612130>: "Reproducible hang in JavaScript at www.tfl.gov.uk"
1022         <rdar://problem/3626022>: "Safari was consuming > 100% CPU on dual-G5 Mac, sample shows JavaScript"
1023         <rdar://problem/3632348>: "www.whatis.com search for "pivot table" leads to JavaScript hang"
1024         
1025         * khtml/ecma/kjs_html.cpp:
1026         (KJS::HTMLElement::getValueProperty): The "text" property for anchors should be
1027         innerText, not innerHTML.
1028         * khtml/html/html_elementimpl.cpp:
1029         (HTMLElementImpl::innerText): Make sure not to include all the text after an
1030         element if it has no children.
1031         * layout-tests/fast/dom/anchor-text-expected.txt: Added.
1032         * layout-tests/fast/dom/anchor-text.html: Added.
1033         * layout-tests/fast/dom/inner-text-expected.txt: Added.
1034         * layout-tests/fast/dom/inner-text.html: Added.
1035
1036 2004-04-24  Darin Adler  <darin@apple.com>
1037
1038         Reviewed by Dave.
1039
1040         - fixed <rdar://problem/3488892>: "anchor names with non-ASCII characters in them do not work"
1041
1042         * khtml/khtml_part.h: Add new gotoAnchor helper function, private.
1043         * khtml/khtml_part.cpp:
1044         (KHTMLPart::openURL): Call new gotoAnchor helper, since the code is now complex enough
1045         that I don't want to copy and paste.
1046         (KHTMLPart::gotoAnchor): Use the pages own encoding when decoding the string for an
1047         anchor reference when going to an anchor. This matches the behavior of other browsers.
1048         (KHTMLPart::slotFinishedParsing): Call new gotoAnchor helper.
1049         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scrollToAnchor): Call new gotoAnchor helper.
1050
1051         * kwq/KWQKURL.h: Removed htmlRef function, and made encodedHtmlRef an inline.
1052         Removed unused encoding hint parameter from setQuery (it's not a "hint" at all, but we
1053         don't use it). Added a codec parameter to decode_string.
1054         * kwq/KWQKURL.mm:
1055         (hexDigitValue): Added. Helper function.
1056         (KURL::setQuery): Removed unused parameter.
1057         (KURL::decode_string): Implemented this function. It needs to use an encoding specified
1058         by the web page. Also, we wanted to make a version that did not use the
1059         CFURLCreateStringByReplacingPercentEscapes function anyway.
1060
1061         * kwq/KWQString.h: Added parameters to copyLatin1. Now you can copy an arbitrary substring.
1062         * kwq/KWQString.mm: (QString::copyLatin1): Updated implementation to handle the two
1063         new parameters.
1064
1065         * WebCore-tests.exp: Updated for change in signature of setQuery and decode_string.
1066         * WebCore-combined.exp: Regenerated.
1067
1068 2004-04-24  Darin Adler  <darin@apple.com>
1069
1070         - fixed <rdar://problem/3570953>: "Update "Acknowledgements" to remove expat and possibly include libxml"
1071
1072         * WebCore.pbproj/project.pbxproj: Removed the part of the copyright notice that was for expat contributors.
1073
1074 2004-04-23  David Hyatt  <hyatt@apple.com>
1075
1076         Fix the apple-line-clamp values to more closely match what is needed, an even split of the max lines between the possible
1077         values.
1078
1079         * khtml/rendering/render_flexbox.cpp:
1080         (khtml::RenderFlexibleBox::layoutVerticalBox):
1081
1082 2004-04-23  David Hyatt  <hyatt@apple.com>
1083
1084         Fix to make the containing block percentage height calculation actually work according to the CSS2 spec.
1085         Percentages other than 100% are now supported, and flexing percentage height blocks inside table cells
1086         are now supported.
1087
1088         Reviewed by kocienda
1089
1090         * khtml/rendering/render_box.cpp:
1091         (RenderBox::calcHeight):
1092         (RenderBox::calcPercentageHeight):
1093         * khtml/rendering/render_box.h:
1094
1095 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1096
1097         Reviewed by John
1098
1099         Fix for this bug:
1100         <rdar://problem/3632163>: "REGRESSSION: crash on css home page"
1101
1102         * khtml/rendering/render_block.cpp:
1103         (khtml::RenderBlock::positionForRenderer): Add null check.
1104
1105 2004-04-20  David Hyatt  <hyatt@apple.com>
1106
1107         Fix hiermenu opacity bug.  Make sure to save/restore the graphics state before pushing and popping
1108         transparency layers, so that alterations to alpha don't accidentally persist.
1109         
1110         Reviewed by kocienda
1111
1112         * kwq/KWQPainter.mm:
1113         (QPainter::beginTransparencyLayer):
1114         (QPainter::endTransparencyLayer):
1115
1116 2004-04-20  David Hyatt  <hyatt@apple.com>
1117
1118         Fix for 3622818, bad rendering on sabernomics.com.  Just eliminate the priority difference between
1119         4 and 5, and make all of the priority 4 tags the same.  This seems to match other browsers.
1120         
1121         Reviewed by kocienda
1122
1123         * khtml/html/dtd.cpp:
1124
1125 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1126
1127         Reviewed by Darin
1128
1129         Changed inlineBoxForRenderer(RenderObject *, int) helper that was static 
1130         in dom_position.cpp into a virtual method on RenderObjects. Function is
1131         now called inlineBox(int). Functionality unchanged.
1132
1133         * khtml/rendering/render_br.cpp:
1134         (RenderBR::inlineBox)
1135         * khtml/rendering/render_br.h:
1136         * khtml/rendering/render_object.cpp:
1137         (RenderObject::caretMaxRenderedOffset)
1138         (RenderObject::inlineBox)
1139         * khtml/rendering/render_object.h:
1140         * khtml/rendering/render_text.cpp:
1141         (RenderText::inlineBox)
1142         * khtml/rendering/render_text.h:
1143         * khtml/xml/dom_position.cpp:
1144         (DOM::renderersOnDifferentLine):
1145         (DOM::nextRenderedEditable)
1146         (DOM::previousRenderedEditable)
1147         (DOM::Position::previousLinePosition)
1148         (DOM::Position::nextLinePosition)
1149         (DOM::Position::rendersInDifferentPosition)
1150
1151 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1152
1153         Reviewed by Darin
1154
1155         * khtml/editing/htmlediting_impl.cpp:
1156         (DeleteSelectionCommandImpl::doApply): Fix editing test
1157         regression with deleting whitespace at the end of the line.
1158         I just made this "improvement" yesterday, and the concept
1159         of the change is a good one, but instead of short-circuiting
1160         if the selection after deleting collapsible whitespace is a
1161         range (which can be confused by "significant" collapsed 
1162         whitespace at the end of a line), short-circuit if the 
1163         upstream start position equals the downstream end position.
1164
1165 === Safari-138 ===
1166
1167 2004-04-23  Ken Kocienda  <kocienda@apple.com>
1168
1169         Reviewed by John
1170
1171         Added some plumbing for applying styles.
1172
1173         * khtml/xml/dom_docimpl.cpp:
1174         (DocumentImpl::createCSSStyleDeclaration): New factory method.
1175         * khtml/xml/dom_docimpl.h: Declare the above.
1176         * kwq/DOM-CSS.mm:
1177         (-[DOMCSSStyleDeclaration _styleDeclarationImpl]): Expose this in the
1178         WebCoreInternal category, "promoting" it from being private to the 
1179         DOM-CSS.mm file.
1180         * kwq/DOM.mm: Add -(DOMCSSStyleDeclaration *)createCSSStyleDeclaration extension.
1181         * kwq/DOMExtensions.h: Delcare the above.
1182         * kwq/DOMInternal.h: Add _styleDeclarationImpl to WebCoreInternal category.
1183
1184 2004-04-23  John Sullivan  <sullivan@apple.com>
1185
1186         - fixed <rdar://problem/3631541>: "repro crash in KHTMLPart::setFocusNodeIfNeeded"
1187
1188         Reviewed by Maciej.
1189
1190         * khtml/khtml_part.cpp:
1191         (KHTMLPart::setFocusNodeIfNeeded):
1192         added nil check
1193
1194 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
1195
1196         Back out one of the previous changes, it causes a crash. Whoops!
1197         
1198         * kwq/KWQScrollView.mm:
1199         (QScrollView::addChild):
1200
1201 2004-04-23  Maciej Stachowiak  <mjs@apple.com>
1202
1203         Reviewed by Dave.
1204
1205         These two tiny changes (made w/ Dave's help) should get us about
1206         1% or so combined on the HTML iBench.
1207
1208         * khtml/rendering/render_br.cpp:
1209         (RenderBR::setStyle): Don't call superclass setStyle, since
1210         according to Dave we don't need any of the work done in there.
1211         * kwq/KWQScrollView.mm:
1212         (QScrollView::addChild): Don't actually move the widget if the x
1213         coordinate is -500000, since we don't need the initial offscreen
1214         positioning that KHTML does and it is costly to do.
1215
1216 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1217
1218         Reviewed by Hyatt
1219
1220         * khtml/editing/htmlediting_impl.cpp:
1221         (DeleteSelectionCommandImpl::doApply): Short-circuit return if the selection
1222         is not a range after collapsing whitespace.
1223
1224 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1225
1226         Reviewed by Hyatt
1227
1228         More work to bring code up to date with the latest API proposal.
1229
1230         * khtml/xml/dom_selection.h: Fix typo in comment.
1231         * kwq/WebCoreBridge.h: -applyStyle:toElementsInDOMRange: is now applyStyle:
1232         * kwq/WebCoreBridge.mm:
1233         (-[WebCoreBridge applyStyle:]): Ditto.
1234
1235 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1236
1237         Reviewed by John
1238
1239         Adds the notion of selection affinity to the editing API, bringing it up to
1240         date with the latest proposal.
1241
1242         * khtml/xml/dom_selection.cpp:
1243         (DOM::Selection::Selection): Adds support for selection affinity member variable.
1244         (DOM::Selection::init): Ditto.
1245         (DOM::Selection::operator=): Ditto.
1246         (DOM::Selection::setAffinity): New function.
1247         (DOM::Selection::layoutCaret): Added comment to indicate that we need to enhance this
1248         function to handle selection affinity.
1249         * khtml/xml/dom_selection.h: Added EAffinity enum and m_affinity member variable.
1250         (DOM::Selection::): Moved the enums above the constructors. No code change.
1251         (DOM::Selection::affinity): New accessor.
1252         * kwq/WebCoreBridge.h:
1253         * kwq/WebCoreBridge.mm: Add selection affinity to API declarations as needed.
1254         (-[WebCoreBridge setSelectedDOMRange:affinity:]): Ditto.
1255         (-[WebCoreBridge selectedDOMRange]): Ditto.
1256         (-[WebCoreBridge selectionAffinity]): Ditto.
1257
1258 2004-04-21  Maciej Stachowiak  <mjs@apple.com>
1259
1260         Reviewed by Darin.
1261
1262         Preliminary change for conservative GC. Use new "protected"
1263         subclasses to GC-protect objects when on heap, since we will soon
1264         remove the built-in refcounting of the normal wrapper classes.
1265         
1266         * ForwardingHeaders/kjs/protect.h: Added.
1267         * khtml/ecma/kjs_binding.h:
1268         * khtml/ecma/kjs_events.h:
1269         * khtml/ecma/kjs_traversal.h:
1270         * khtml/ecma/kjs_window.h:
1271
1272 2004-04-22  Darin Adler  <darin@apple.com>
1273
1274         * khtml/ecma/kjs_window.cpp: (Window::get): Removed code that gets properties from the parent.
1275         This was a mistake we inherited from KHTML, and they have long since fixed it.
1276
1277 2004-04-22  Ken Kocienda  <kocienda@apple.com>
1278
1279         Reviewed by Hyatt
1280
1281         Ensures caret visibility after making an editing action.
1282
1283         * khtml/xml/dom_selection.cpp:
1284         (DOM::Selection::getRepaintRect): Expose this as public.
1285         * khtml/xml/dom_selection.h: Ditto.
1286         * kwq/WebCoreBridge.h: Add ensureCaretVisible method.
1287         * kwq/WebCoreBridge.mm:
1288         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:]):
1289         Unrelated crash fix. Null-check baseURLString.
1290         (-[WebCoreBridge ensureCaretVisible]): Added.
1291
1292 2004-04-21  David Hyatt  <hyatt@apple.com>
1293
1294         Fix for 3245627, nested tables don't expand vertically.  I actually fixed the basic problem in the
1295         previous checkin, but this exposed another basic math error where |numVariable| was not being
1296         decremented properly.  This meant space was mis-allocated when multiple variable height rows both needed
1297         to expand.
1298
1299         * khtml/rendering/render_table.cpp:
1300         (RenderTableSection::layoutRows):
1301
1302 2004-04-21  David Hyatt  <hyatt@apple.com>
1303
1304         Fix for 3020449, ensure that the paint order of cells with rowspans matches other browsers.
1305         
1306         Reviewed by darin
1307
1308         * khtml/rendering/render_table.cpp:
1309         (RenderTableSection::paint):
1310
1311 2004-04-21  David Hyatt  <hyatt@apple.com>
1312
1313         Remove the (incorrect) restriction on table flexing that required the cell to have a fixed width.  In
1314         reality, the style on the cell is completely irrelevant.
1315         
1316         Reviewed by kocienda
1317
1318         * khtml/rendering/render_table.cpp:
1319         (RenderTable::layout):
1320
1321 2004-04-21  David Hyatt  <hyatt@apple.com>
1322
1323         Make sure cells that get flexed vertically in tables don't check text children when looking for 
1324         percentage height children.
1325         
1326         Reviewed by kocienda
1327
1328         * khtml/rendering/render_table.cpp:
1329         (RenderTableSection::layoutRows):
1330
1331 2004-04-21  David Hyatt  <hyatt@apple.com>
1332
1333         Fix for hiermenus bug.  Absolutely positioned images should not contribute to their containing block's
1334         max width.  Make sure to disregard positioned elements when computing min/max width.
1335         
1336         Reviewed by kocienda
1337
1338         * khtml/rendering/render_block.cpp:
1339         (khtml::InlineMinMaxIterator::next):
1340
1341 2004-04-21  Ken Kocienda  <kocienda@apple.com>
1342
1343         Reviewed by Hyatt
1344
1345         * khtml/editing/htmlediting_impl.cpp:
1346         (DeleteSelectionCommandImpl::doApply): Do not shift ending selection downstream
1347         when at position zero of a BR. That's just wrong. Simplify code that does
1348         "onlyWhitespace" delete. No need to handle multiple characters here; we can
1349         only ever have one thanks to the delete-collapsible-whitespace code.
1350         (TypingCommandImpl::issueCommandForDeleteKey): Don't do anything if at the
1351         start of a root editable block. This is a no-op....not an opportunity to crash.
1352         * khtml/rendering/render_block.cpp:
1353         (khtml::RenderBlock::positionForRenderer): Return this renderer's element position
1354         if the passed-in renderer is nil. This helps to make clicking in empty blocks work.
1355         * khtml/rendering/render_container.cpp:
1356         (RenderContainer::positionForCoordinates): Fixed typo in comment.
1357         * khtml/xml/dom_position.cpp:
1358         (DOM::Position::equivalentLeafPosition): Do not attempt to find a leaf if the
1359         position's node does not have a renderer, if the renderer has no kids.
1360         * layout-tests/editing/deleting/delete-br-001-expected.txt: Update expected results for BR fix.
1361         * layout-tests/editing/deleting/delete-br-003-expected.txt: Ditto.
1362         * layout-tests/editing/deleting/delete-br-006-expected.txt: Ditto.
1363         * layout-tests/editing/deleting/delete-br-007.html: Added. New BR test.
1364         * layout-tests/editing/deleting/delete-br-007-expected.txt: Added.
1365
1366 2004-04-21  Ken Kocienda  <kocienda@apple.com>
1367
1368         Reviewed by Hyatt
1369
1370         * khtml/css/css_computedstyle.cpp:
1371         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Added implementations for
1372         these properties: CSS_PROP_TEXT_DECORATION, CSS_PROP_VERTICAL_ALIGN, CSS_PROP_TEXT_INDENT,
1373         CSS_PROP_LETTER_SPACING, CSS_PROP_WORD_SPACING, CSS_PROP_LINE_HEIGHT
1374
1375 2004-04-21  Ken Kocienda  <kocienda@apple.com>
1376
1377         Reviewed by John
1378
1379         The Selection class now uses the Position class throughout its public and
1380         private interface. This replaces the inconsistent use of the Position
1381         class here and node/offset pairs there. There are no functional changes, only
1382         updates to the new Selection class API.
1383
1384         * khtml/ecma/kjs_window.cpp:
1385         (Selection::get):
1386         (SelectionFunc::tryCall):
1387         * khtml/editing/htmlediting_impl.cpp:
1388         (DeleteCollapsibleWhitespaceCommandImpl::doApply):
1389         (DeleteSelectionCommandImpl::joinTextNodesWithSameStyle):
1390         (DeleteSelectionCommandImpl::doApply):
1391         (InputNewlineCommandImpl::doApply):
1392         (InputTextCommandImpl::deleteCharacter):
1393         (InputTextCommandImpl::prepareForTextInsertion):
1394         (InputTextCommandImpl::execute):
1395         (PasteMarkupCommandImpl::doApply):
1396         (TypingCommandImpl::issueCommandForDeleteKey):
1397         * khtml/khtml_part.cpp:
1398         (KHTMLPart::findTextNext):
1399         (KHTMLPart::setFocusNodeIfNeeded):
1400         (KHTMLPart::notifySelectionChanged):
1401         (KHTMLPart::isPointInsideSelection):
1402         (KHTMLPart::handleMouseMoveEventSelection):
1403         (KHTMLPart::khtmlMouseReleaseEvent):
1404         (KHTMLPart::selectAll):
1405         * khtml/rendering/render_block.cpp:
1406         (khtml::RenderBlock::paintObject):
1407         * khtml/xml/dom_docimpl.cpp:
1408         (DocumentImpl::updateSelection):
1409         * khtml/xml/dom_nodeimpl.cpp:
1410         * khtml/xml/dom_selection.cpp:
1411         (DOM::emptyPosition):
1412         (DOM::Selection::Selection):
1413         (DOM::Selection::init):
1414         (DOM::Selection::operator=):
1415         (DOM::Selection::moveTo):
1416         (DOM::Selection::modify):
1417         (DOM::Selection::xPosForVerticalArrowNavigation):
1418         (DOM::Selection::clear):
1419         (DOM::Selection::setBase):
1420         (DOM::Selection::setExtent):
1421         (DOM::Selection::setBaseAndExtent):
1422         (DOM::Selection::setStart):
1423         (DOM::Selection::setEnd):
1424         (DOM::Selection::setStartAndEnd):
1425         (DOM::Selection::toRange):
1426         (DOM::Selection::layoutCaret):
1427         (DOM::Selection::needsCaretRepaint):
1428         (DOM::Selection::paintCaret):
1429         (DOM::Selection::validate):
1430         (DOM::Selection::moveToRenderedContent):
1431         (DOM::Selection::nodeIsBeforeNode):
1432         (DOM::startAndEndLineNodesIncludingNode):
1433         (DOM::Selection::debugRenderer):
1434         (DOM::Selection::debugPosition):
1435         * khtml/xml/dom_selection.h:
1436         (DOM::Selection::~Selection):
1437         (DOM::Selection::base):
1438         (DOM::Selection::extent):
1439         (DOM::Selection::start):
1440         (DOM::Selection::end):
1441         (DOM::Selection::assignBase):
1442         (DOM::Selection::assignExtent):
1443         (DOM::Selection::assignBaseAndExtent):
1444         (DOM::Selection::assignStart):
1445         (DOM::Selection::assignEnd):
1446         (DOM::Selection::assignStartAndEnd):
1447         (DOM::operator==):
1448         * kwq/KWQKHTMLPart.mm:
1449         (KWQKHTMLPart::jumpToSelection):
1450         (KWQKHTMLPart::selectionStartOffset):
1451         (KWQKHTMLPart::selectionEndOffset):
1452         (KWQKHTMLPart::selectionStart):
1453         (KWQKHTMLPart::selectionEnd):
1454         * kwq/KWQRenderTreeDebug.cpp:
1455         (writeSelection):
1456         * kwq/WebCoreBridge.mm:
1457         (-[WebCoreBridge isSelectionEditable]):
1458         (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]):
1459         (-[WebCoreBridge setSelectedDOMRange:]):
1460
1461 2004-04-20  Ken Kocienda  <kocienda@apple.com>
1462
1463         Reviewed by Hyatt
1464         
1465         Renamed DOMPosition class to Position.
1466         Renamed KHTMLSelection to Selection and moved to DOM namespace.
1467
1468         * ForwardingHeaders/xml/dom_selection.h: Added.
1469         * WebCore.pbproj/project.pbxproj: Go Xcode!
1470         * khtml/khtml_selection.cpp: Removed.
1471         * khtml/khtml_selection.h: Removed.
1472         * khtml/xml/dom_position.cpp: Renamed DOMPosition to Position
1473         * khtml/xml/dom_position.h: Ditto.
1474         * khtml/xml/dom_selection.cpp: New home for renamed Selection object.
1475         * khtml/xml/dom_selection.h: Ditto.
1476
1477 2004-04-20  Ken Kocienda  <kocienda@apple.com>
1478
1479         Reviewed by Hyatt
1480
1481         * WebCore.pbproj/project.pbxproj:
1482         * khtml/khtml_part.cpp:
1483         (KHTMLPart::handleMousePressEventDoubleClick): Improved name of expandToElement. Now is expandUsingGranularity.
1484         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1485         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
1486         * khtml/khtml_selection.cpp:
1487         (KHTMLSelection::modify): Added support for modifying and extending selection right and left by word.
1488         Also added support for extending selection up and down.
1489         (KHTMLSelection::expandUsingGranularity): New name for expandToElement.
1490         (KHTMLSelection::xPosForVerticalArrowNavigation): Made this function handle cases where we know we
1491         want to use a particular position for calculating the right x position. We need this to handle
1492         extending selection up and down, and for setting the caret to the right place when moving up
1493         and down when a range is already selected.
1494         (KHTMLSelection::validate): Name tweak. expandTo variable now granularity.
1495         * khtml/khtml_selection.h: Make declaration changes for changes to cpp file.
1496         * khtml/misc/helper.cpp:
1497         (khtml::findWordBoundary): Added this hook for KDE to do their version of KWQFindWordBoundary
1498         * khtml/misc/helper.h:
1499         * khtml/rendering/render_block.cpp:
1500         (khtml::RenderBlock::positionForCoordinates): Factor out closest box finder code to its own function
1501         * khtml/rendering/render_line.cpp:
1502         (InlineFlowBox::closestChildForXPos): New function. This is the factored code that was taken out of 
1503         render_block.cpp.
1504         (InlineBox::closestLeafChildForXPos): Ditto.
1505         * khtml/rendering/render_line.h: Ditto.
1506         * khtml/rendering/render_replaced.cpp:
1507         (RenderReplaced::positionForCoordinates): I think I am starting to get how the coordinate transforms work.
1508         Made some fixups based on this greater sense of enlightenment.
1509         * khtml/rendering/render_text.cpp:
1510         (RenderText::positionForCoordinates): Ditto. Fix lastTextBox/firstTextBox code mistake.
1511         * khtml/xml/dom_position.cpp:
1512         (DOMPosition::previousWordPosition): Added.
1513         (DOMPosition::nextWordPosition): Added.
1514         (DOMPosition::previousLinePosition): No longer use nodeAtPoint. Use new closestLeafChildForXPos instead.
1515         (DOMPosition::nextLinePosition): Ditto.
1516         (DOMPosition::inLastEditableInContainingEditableBlock):
1517         * khtml/xml/dom_position.h:
1518         * kwq/KWQTextUtilities.cpp: Added.
1519         (KWQFindWordBoundary): Factored out code that was in a static function in khtml_selection.cpp so 
1520         that DOMPosition can use it too.
1521         * kwq/KWQTextUtilities.h: Added.
1522
1523 2004-04-19  Ken Kocienda  <kocienda@apple.com>
1524
1525         Reviewed by Hyatt
1526
1527         * khtml/khtml_part.cpp:
1528         (KHTMLPart::notifySelectionChanged): Clear the value
1529         used for maintaining x position when doing vertical arrow
1530         navigation. WebCoreBridge restores this value when needed. 
1531         (KHTMLPart::setXPosForVerticalArrowNavigation): New accessor.
1532         (KHTMLPart::xPosForVerticalArrowNavigation): New accessor.
1533         * khtml/khtml_part.h:
1534         (KHTMLPart::): Add NoXPosForVerticalArrowNavigation constant.
1535         * khtml/khtml_selection.cpp:
1536         (KHTMLSelection::modify): Add cases for UP and DOWN navigation
1537         (KHTMLSelection::xPosForVerticalArrowNavigation): New helper.
1538         * khtml/khtml_selection.h: Add UP and DOWN constants to EDirection enum.
1539         (KHTMLSelection::):
1540         * khtml/khtmlpart_p.h: Declare storage for m_xPosForVerticalArrowNavigation, 
1541         the value used for maintaining x position when doing vertical arrow
1542         navigation. 
1543         * khtml/rendering/render_block.cpp:
1544         (khtml::RenderBlock::positionForCoordinates): Improved this function to
1545         handle deficiencies exposed when trying to implement new behavior.
1546         * khtml/rendering/render_br.cpp:
1547         (RenderBR::positionForCoordinates): Added implementation of this virtual function.
1548         * khtml/rendering/render_br.h: Declare implementation for positionForCoordinates virtual function.
1549         * khtml/rendering/render_replaced.cpp:
1550         (RenderReplaced::positionForCoordinates): Improved this function to
1551         handle deficiencies exposed when trying to implement new behavior.
1552         * khtml/rendering/render_text.cpp:
1553         (InlineTextBox::offsetForPosition): Remove left/right "bounds" check here.
1554         (RenderText::positionForCoordinates): Improved this function to
1555         handle deficiencies exposed when trying to implement new behavior.
1556         * khtml/xml/dom_position.cpp:
1557         (inlineBoxForRenderer): Moved to top of file so all code in the file can see this static function.
1558         (renderersOnDifferentLine): Ditto.
1559         (nextRenderedEditable): Ditto.
1560         (previousRenderedEditable): Ditto.
1561         (DOMPosition::previousLinePosition): New function. Implements the guts of up/down navigation.
1562         (DOMPosition::nextLinePosition): Ditto.
1563         * khtml/xml/dom_position.h: Added declarations for nextLinePosition and previousLinePosition.
1564         * kwq/WebCoreBridge.h: Add WebSelectUp and WebSelectDown constants.
1565         * kwq/WebCoreBridge.mm:
1566         (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Handles saving and restoring the 
1567         x position used for doing vertical arrow navigation.
1568
1569 2004-04-16  Ken Kocienda  <kocienda@apple.com>
1570
1571         Reviewed by Hyatt
1572
1573         * khtml/css/css_computedstyle.cpp:
1574         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue): Added implementations for
1575         these four properties: CSS_PROP_WHITE_SPACE, CSS_PROP_DISPLAY, CSS_PROP_FLOAT, and CSS_PROP_COLOR.
1576
1577 2004-04-16  Chris Blumenberg  <cblu@apple.com>
1578
1579         Subresources weren't being archived for LINK tags.
1580
1581         Reviewed by kocienda.
1582
1583         * khtml/xml/dom_nodeimpl.cpp:
1584         (NodeImpl::recursive_toHTMLWithOptions): indent tweak
1585         * kwq/DOMHTML.mm:
1586         (-[DOMHTMLLinkElement _linkElementImpl]): C+casting voodoo to make methods like rel and href work correctly
1587
1588 2004-04-16  Ken Kocienda  <kocienda@apple.com>
1589
1590         Reviewed by Hyatt
1591
1592         * khtml/html/html_elementimpl.cpp:
1593         (HTMLElementImpl::isContentEditable): Call getDocument()->updateRendering() to make sure 
1594         outstanding changes for this attribute are applied.
1595         (HTMLElementImpl::contentEditable): Call getDocument()->updateRendering() to make sure 
1596         outstanding changes for this attribute are applied.
1597         (HTMLElementImpl::setContentEditable): Call enabled.isEmpty() before strcasecmp(enabled, "true").
1598         It's cheaper.
1599
1600 2004-04-16  Ken Kocienda  <kocienda@apple.com>
1601
1602         Reviewed by Hyatt
1603
1604         * khtml/editing/htmlediting_impl.cpp: New helper.
1605         (DeleteSelectionCommandImpl::containsOnlyWhitespace): Fix deleting collapsed whitespace 
1606         at the end of a line where text has flowed to the next line and the caret is at the 
1607         beginning of the next line. 
1608         (DeleteSelectionCommandImpl::doApply): Updated for new helper.
1609         * khtml/editing/htmlediting_impl.h:
1610         * layout-tests/editing/deleting/delete-line-end-ws-001-expected.txt: Added.
1611         * layout-tests/editing/deleting/delete-line-end-ws-001.html: Added.
1612         * layout-tests/editing/deleting/delete-line-end-ws-002-expected.txt: Added.
1613         * layout-tests/editing/deleting/delete-line-end-ws-002.html: Added.
1614
1615 === Safari-137 ===
1616
1617 2004-04-16  Richard Williamson   <rjw@apple.com>
1618
1619         Added an SPI to allow ObjC instances to be easily bound to 
1620         JS.  This is needed by the dashboard guys for their prototyping.
1621         Eventually they will use new API.
1622
1623         Reviewed by Chris.
1624
1625         * kwq/KWQKHTMLPart.h:
1626         * kwq/KWQKHTMLPart.mm:
1627         (KWQKHTMLPart::bindObject):
1628         * kwq/WebCoreBridge.h:
1629         * kwq/WebCoreBridge.mm:
1630         (-[WebCoreBridge bindObject:withName:]):
1631
1632 2004-04-16  Chris Blumenberg  <cblu@apple.com>
1633
1634         Added DOMHTMLEmbedElement as a DOM extension since EMBED is represented in our DOM even though its not part of the spec.
1635         Added all DOMCore and DOMHTML symbols to WebCore's symbols file.
1636         Removed isSubresourceURLAttribute from dom node. This was only used for the WebArchive feature and all that work is now done in WebKit.
1637
1638         Reviewed by kocienda.
1639
1640         * WebCore-combined.exp:
1641         * WebCore.exp:
1642         * khtml/html/html_baseimpl.cpp:
1643         (HTMLBodyElementImpl::isURLAttribute): renamed from isSubresourceURLAttribute. As a convenience to subclasses, dom_elementimpl would call isSubresourceURLAttribute in isURLAttribute, but this is no longer done
1644         (HTMLFrameElementImpl::isURLAttribute): ditto
1645         (HTMLIFrameElementImpl::isURLAttribute): ditto
1646         * khtml/html/html_baseimpl.h:
1647         * khtml/html/html_formimpl.cpp:
1648         (HTMLInputElementImpl::isURLAttribute): ditto
1649         * khtml/html/html_formimpl.h:
1650         * khtml/html/html_headimpl.cpp:
1651         (HTMLScriptElementImpl::isURLAttribute): ditto
1652         * khtml/html/html_headimpl.h:
1653         * khtml/html/html_imageimpl.cpp: 
1654         (HTMLImageElementImpl::isURLAttribute): ditto
1655         * khtml/html/html_imageimpl.h:
1656         * khtml/html/html_objectimpl.cpp:
1657         (HTMLEmbedElementImpl::isURLAttribute): ditto
1658         (HTMLObjectElementImpl::isURLAttribute): ditto
1659         (HTMLParamElementImpl::isURLAttribute): ditto
1660         * khtml/html/html_objectimpl.h:
1661         * khtml/html/html_tableimpl.cpp:
1662         (HTMLTableElementImpl::isURLAttribute): ditto
1663         (HTMLTableCellElementImpl::isURLAttribute): ditto
1664         * khtml/html/html_tableimpl.h:
1665         * khtml/xml/dom2_rangeimpl.cpp:
1666         (RangeImpl::toHTMLWithOptions): take a node list (see below)
1667         * khtml/xml/dom2_rangeimpl.h:
1668         * khtml/xml/dom_elementimpl.cpp:
1669         (ElementImpl::isURLAttribute):
1670         * khtml/xml/dom_elementimpl.h:
1671         * khtml/xml/dom_nodeimpl.cpp:
1672         (NodeImpl::recursive_toHTMLWithOptions): append copied nodes to a list of nodes so that WebKit can operate on them
1673         * khtml/xml/dom_nodeimpl.h:
1674         * kwq/DOM.mm:
1675         (+[DOMNode _nodeWithImpl:]): added support for HTML types
1676         * kwq/DOMExtensions.h:
1677         * kwq/DOMHTML.mm:
1678         (-[DOMHTMLPreElement setWidth:]):
1679         (-[DOMHTMLEmbedElement _embedElementImpl]):
1680         (-[DOMHTMLEmbedElement align]):
1681         (-[DOMHTMLEmbedElement setAlign:]):
1682         (-[DOMHTMLEmbedElement height]):
1683         (-[DOMHTMLEmbedElement setHeight:]):
1684         (-[DOMHTMLEmbedElement name]):
1685         (-[DOMHTMLEmbedElement setName:]):
1686         (-[DOMHTMLEmbedElement src]):
1687         (-[DOMHTMLEmbedElement setSrc:]):
1688         (-[DOMHTMLEmbedElement type]):
1689         (-[DOMHTMLEmbedElement setType:]):
1690         (-[DOMHTMLEmbedElement width]):
1691         (-[DOMHTMLEmbedElement setWidth:]):
1692         (-[DOMHTMLTableElement background]):
1693         (-[DOMHTMLTableElement setBackground:]):
1694         (-[DOMHTMLTableCellElement background]): new extension 
1695         (-[DOMHTMLTableCellElement setBackground:]): ditto
1696         * kwq/WebCoreBridge.h:
1697         * kwq/WebCoreBridge.mm:
1698         (-[WebCoreBridge nodesFromList:]): new
1699         (-[WebCoreBridge markupStringFromNode:nodes:]): return a list of nodes instead of subresource URLs so WebKit can operate on the nodes
1700         (-[WebCoreBridge markupStringFromRange:nodes:]): ditto
1701
1702 2004-04-15  David Hyatt  <hyatt@apple.com>
1703
1704         Fix for 3624335, bugs with overflow and positioned objects.  The scrollbar didn't properly update
1705         as you changed the sizes of positioned objects inside an overflow block.
1706         
1707         Reviewed by rjw
1708
1709         * khtml/rendering/render_block.cpp:
1710         (khtml::RenderBlock::layoutBlock):
1711         * khtml/rendering/render_flexbox.cpp:
1712         (khtml::RenderFlexibleBox::layoutBlock):
1713         * khtml/rendering/render_layer.cpp:
1714         (RenderLayer::updateScrollInfoAfterLayout):
1715
1716 2004-04-15  Ken Kocienda  <kocienda@apple.com>
1717
1718         Reviewed by Dave
1719         
1720         Improved selection behavior. As part of this work, I removed
1721         almost all of the checkSelectionPoint() functions, leaving
1722         only those associated with fonts, and all of the 
1723         checkSelectionPointIgnoringContinuations() functions. Each
1724         of these has been replaced by a new function called
1725         positionForCoordinates(), which returns a DOMPosition.
1726         
1727         * WebCore.pbproj/project.pbxproj:
1728         * khtml/khtml_events.cpp:
1729         (khtml::MouseEvent::offset): Converted to use positionForCoordinates.
1730         * khtml/khtml_part.cpp: Ditto.
1731         (KHTMLPart::isPointInsideSelection):
1732         (KHTMLPart::handleMousePressEventDoubleClick): Ditto.
1733         (KHTMLPart::handleMousePressEventTripleClick): Ditto.
1734         (KHTMLPart::handleMousePressEventSingleClick): Ditto.
1735         (KHTMLPart::handleMouseMoveEventSelection): Ditto.
1736         (KHTMLPart::khtmlMouseReleaseEvent): Ditto.
1737         * khtml/khtml_part.h:
1738         * khtml/rendering/render_block.cpp:
1739         (khtml::RenderBlock::positionForBox): New helper.
1740         (khtml::RenderBlock::positionForRenderer): New helper.
1741         (khtml::RenderBlock::positionForCoordinates): New selection-node-offset-finder method.
1742         * khtml/rendering/render_block.h:
1743         * khtml/rendering/render_br.cpp: Removed checkSelectionPointIgnoringContinuations.
1744         No special behavior is needed for this class anymore.
1745         * khtml/rendering/render_br.h: Ditoo.
1746         * khtml/rendering/render_container.cpp:
1747         (RenderContainer::positionForCoordinates): New selection-node-offset-finder method.
1748         * khtml/rendering/render_container.h:
1749         * khtml/rendering/render_line.cpp:
1750         (InlineBox::firstLeafChild): New helper.
1751         (InlineBox::lastLeafChild): New helper.
1752         (InlineFlowBox::firstLeafChild): New helper.
1753         (InlineFlowBox::lastLeafChild): New helper.
1754         * khtml/rendering/render_line.h:
1755         * khtml/rendering/render_object.cpp:
1756         (RenderObject::firstLeafChild): New helper.
1757         (RenderObject::lastLeafChild): New helper.
1758         (RenderObject::positionForCoordinates):
1759         * khtml/rendering/render_object.h:
1760         * khtml/rendering/render_replaced.cpp:
1761         (RenderReplaced::positionForCoordinates): New selection-node-offset-finder method.
1762         * khtml/rendering/render_replaced.h:
1763         * khtml/rendering/render_text.cpp:
1764         (InlineTextBox::offsetForPosition): New helper, replaces checkSelectionPoint()
1765         (RenderText::positionForCoordinates): New selection-node-offset-finder method.
1766         * khtml/rendering/render_text.h:
1767         * khtml/xml/dom_nodeimpl.cpp: Added positionForCoordinates() convenience here. This
1768         checks to see if the node has a renderer before doing the position check.
1769         * khtml/xml/dom_nodeimpl.h: Ditto.
1770         * kwq/DOM.mm:
1771         (-[DOMNode isContentEditable]): Added this unrelated method, since without it, I crash when dragging an image.
1772         * kwq/WebCoreBridge.mm:
1773         (-[WebCoreBridge moveCaretToPoint:]): Converted to use positionForCoordinates.
1774
1775 2004-04-15  David Hyatt  <hyatt@apple.com>
1776
1777         Fix for 3603455, block truncation support.
1778         
1779         Reviewed by kocienda
1780
1781         * khtml/css/cssparser.cpp:
1782         (CSSParser::parseValue):
1783         * khtml/css/cssproperties.c:
1784         (hash_prop):
1785         (findProp):
1786         * khtml/css/cssproperties.h:
1787         * khtml/css/cssproperties.in:
1788         * khtml/css/cssstyleselector.cpp:
1789         (khtml::CSSStyleSelector::applyProperty):
1790         * khtml/ecma/kjs_css.cpp:
1791         (cssPropertyName):
1792         * khtml/rendering/render_block.cpp:
1793         (khtml::RenderBlock::lineCount):
1794         (khtml::RenderBlock::heightForLineCount):
1795         * khtml/rendering/render_block.h:
1796         * khtml/rendering/render_flexbox.cpp:
1797         (khtml::RenderFlexibleBox::layoutHorizontalBox):
1798         (khtml::RenderFlexibleBox::layoutVerticalBox):
1799         * khtml/rendering/render_style.cpp:
1800         (marquee):
1801         (StyleCSS3NonInheritedData::operator==):
1802         (RenderStyle::diff):
1803         * khtml/rendering/render_style.h:
1804         (khtml::RenderStyle::lineClamp):
1805         (khtml::RenderStyle::setLineClamp):
1806         (khtml::RenderStyle::initialLineClamp):
1807
1808 2004-04-13  Chris Blumenberg  <cblu@apple.com>
1809
1810         - Removed WebCoreElementIsEditableKey. This functionality is available via [DOMNode isContentEditable].
1811
1812         Reviewed by rjw.
1813
1814         * WebCore-combined.exp:
1815         * WebCore.exp:
1816         * kwq/WebCoreBridge.h:
1817         * kwq/WebCoreBridge.mm:
1818         (-[WebCoreBridge elementAtPoint:]): removed use of WebCoreElementIsEditableKey
1819         (-[WebCoreBridge URLWithRelativeString:]): new method for WebKit API
1820
1821 2004-04-13  David Hyatt  <hyatt@apple.com>
1822
1823         Fix for 3559764, make sure overflow is applied consistently using a separate bit on render objects, so that
1824         the body scroll quirk can easily disable overflow even when it is present on the style.
1825         
1826         Reviewed by kocienda
1827
1828         * khtml/ecma/kjs_dom.cpp:
1829         (DOMNode::putValue):
1830         * khtml/rendering/bidi.cpp:
1831         (khtml::RenderBlock::layoutInlineChildren):
1832         * khtml/rendering/render_block.cpp:
1833         (khtml::RenderBlock::setStyle):
1834         (khtml::RenderBlock::layoutBlock):
1835         (khtml::RenderBlock::layoutBlockChildren):
1836         (khtml::RenderBlock::paintObject):
1837         (khtml::RenderBlock::rightOffset):
1838         (khtml::RenderBlock::lowestPosition):
1839         (khtml::RenderBlock::rightmostPosition):
1840         (khtml::RenderBlock::leftmostPosition):
1841         (khtml::RenderBlock::isPointInScrollbar):
1842         (khtml::RenderBlock::nodeAtPoint):
1843         (khtml::RenderBlock::inRootBlockContext):
1844         * khtml/rendering/render_block.h:
1845         (khtml::RenderBlock::overflowHeight):
1846         (khtml::RenderBlock::overflowWidth):
1847         * khtml/rendering/render_box.cpp:
1848         (RenderBox::setStyle):
1849         (RenderBox::contentWidth):
1850         (RenderBox::contentHeight):
1851         (RenderBox::absolutePosition):
1852         (RenderBox::computeAbsoluteRepaintRect):
1853         (RenderBox::calcAbsoluteVertical):
1854         * khtml/rendering/render_flexbox.cpp:
1855         (khtml::RenderFlexibleBox::layoutBlock):
1856         * khtml/rendering/render_flow.cpp:
1857         (RenderFlow::lowestPosition):
1858         (RenderFlow::rightmostPosition):
1859         (RenderFlow::leftmostPosition):
1860         * khtml/rendering/render_layer.cpp:
1861         (RenderLayer::updateLayerPosition):
1862         (RenderLayer::updateScrollInfoAfterLayout):
1863         (RenderLayer::intersectsDamageRect):
1864         (RenderLayer::containsPoint):
1865         * khtml/rendering/render_object.cpp:
1866         (RenderObject::RenderObject):
1867         (RenderObject::requiresLayer):
1868         (RenderObject::clientWidth):
1869         (RenderObject::clientHeight):
1870         (RenderObject::scrollWidth):
1871         (RenderObject::scrollHeight):
1872         (RenderObject::setStyle):
1873         (RenderObject::absolutePosition):
1874         (RenderObject::nodeAtPoint):
1875         (RenderObject::avoidsFloats):
1876         * khtml/rendering/render_object.h:
1877         (khtml::RenderObject::hasOverflowClip):
1878         (khtml::RenderObject::hasAutoScrollbars):
1879         (khtml::RenderObject::scrollsOverflow):
1880         (khtml::RenderObject::includeScrollbarSize):
1881         (khtml::RenderObject::setHasOverflowClip):
1882         * khtml/rendering/render_style.h:
1883         (khtml::RenderStyle::overflow):
1884         (khtml::RenderStyle::isDisplayReplacedType):
1885         (khtml::RenderStyle::isDisplayInlineType):
1886         * khtml/rendering/render_table.cpp:
1887         (RenderTable::setStyle):
1888         (RenderTableCell::setStyle):
1889         (RenderTableCell::requiresLayer):
1890         * khtml/rendering/render_table.h:
1891
1892 2004-04-12  David Hyatt  <hyatt@apple.com>
1893
1894         Fix for 3556036, make sure that when the position changes via style that all render layer
1895         descendants simply immediately repaint.
1896         
1897         Reviewed by kocienda
1898         
1899         * khtml/rendering/render_layer.cpp:
1900         (RenderLayer::repaintIncludingDescendants):
1901         * khtml/rendering/render_layer.h:
1902         * khtml/rendering/render_object.cpp:
1903         (RenderObject::setStyle):
1904
1905 2004-04-12  Chris Blumenberg  <cblu@apple.com>
1906
1907         - Fixed build failure by removing references to WebArchive in WebCore.
1908         - For HTML copy/paste, relative URLs are now made absolute at paste time instead of at copy time. This allows relative URLs to be kept relative if the destination page has the same base URL as the source page.
1909
1910         Reviewed by kocienda.
1911
1912         * khtml/editing/htmlediting.cpp:
1913         (PasteMarkupCommand::PasteMarkupCommand): take the base URL of the clipping
1914         * khtml/editing/htmlediting.h:
1915         * khtml/editing/htmlediting_impl.cpp:
1916         (PasteMarkupCommandImpl::PasteMarkupCommandImpl): take the base URL of the clipping
1917         (PasteMarkupCommandImpl::doApply): if we have a base URL and it is different than the base URL of the document, fix the URLs in the new DOM tree
1918         * khtml/editing/htmlediting_impl.h:
1919         * khtml/xml/dom2_rangeimpl.cpp:
1920         (RangeImpl::toHTMLWithOptions): removed completeURLs param
1921         * khtml/xml/dom2_rangeimpl.h:
1922         * khtml/xml/dom_nodeimpl.cpp:
1923         (NodeImpl::recursive_toHTMLWithOptions): removed completeURLs param
1924         (NodeImpl::recursive_toHTML): ditto
1925         (NodeImpl::recursive_completeURLs): new
1926         * khtml/xml/dom_nodeimpl.h:
1927         * kwq/WebCoreBridge.h:
1928         * kwq/WebCoreBridge.mm:
1929         (-[WebCoreBridge markupStringFromNode:subresourceURLStrings:]): call recursive_toHTML with less params
1930         (-[WebCoreBridge markupStringFromRange:subresourceURLStrings:]): ditto
1931         (-[WebCoreBridge replaceSelectionWithMarkupString:baseURLString:]): take a base URL
1932
1933 2004-04-12  Ken Kocienda  <kocienda@apple.com>
1934
1935         Reviewed by Dave
1936
1937         Added execCommand support for cut/copy/paste.
1938         
1939         * khtml/xml/dom_docimpl.cpp:
1940         (DocumentImpl::execCommand): Added cut/copy/paste atoms and added else if cases
1941         for the commands.
1942         * kwq/KWQKHTMLPart.h:
1943         * kwq/KWQKHTMLPart.mm:
1944         (KWQKHTMLPart::issueCutCommand): Glue for calling from WebCore to do a cut in Cocoa.
1945         (KWQKHTMLPart::issueCopyCommand): Same as above, but for copy.
1946         (KWQKHTMLPart::issuePasteCommand): Same as above, but for paste.
1947         * kwq/WebCoreBridge.h: Declared issueCutCommand, issueCopyCommand, and issuePasteCommand
1948         to be implemented on the WebKit side of the bridge.
1949         * layout-tests/editing/editing.js: Added cut/copy/paste support to js library to support
1950         making layout tests.
1951         * layout-tests/editing/pasteboard/copy-paste-text-001-expected.txt: Added.
1952         * layout-tests/editing/pasteboard/copy-paste-text-001.html: Added.
1953         * layout-tests/editing/pasteboard/cut-paste-text-002-expected.txt: Added.
1954         * layout-tests/editing/pasteboard/cut-paste-text-002.html: Added.
1955         * layout-tests/editing/pasteboard/cut-text-001-expected.txt: Added.
1956         * layout-tests/editing/pasteboard/cut-text-001.html: Added.
1957
1958 2004-04-12  Ken Kocienda  <kocienda@apple.com>
1959
1960         Reviewed by John
1961         
1962         Some delete and insert cleanups.
1963
1964         * khtml/editing/htmlediting_impl.cpp:
1965         (DeleteSelectionCommandImpl::doApply): For ending position case 1,
1966         the caret should be placed before the first child of the containing block, 
1967         not before the containing block itself. Also, add some code to handle
1968         converting nbsp's back to regular spaces. This will need to be improved
1969         some day to convert only nbsp's added by the editor to make rendering come out right.
1970         (InputTextCommandImpl::execute): 
1971         (TypingCommandImpl::issueCommandForDeleteKey): Make deleting collapsible whitespace part 
1972         of the work of deleting a selection, rather than something that needs to be done by a 
1973         user of DeleteSelectionCommandImpl. This makes it impossible to leave out
1974         this essential step.
1975         (TypingCommandImpl::deleteKeyPressed): We can't use a possible optimization here until 
1976         the code to do deletions properly has been factored better. Big FIXME added.
1977         * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Updated for
1978         ending position case 1 behavior change.
1979         * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Ditto. 
1980         * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Ditto.
1981
1982 2004-04-09  Ken Kocienda  <kocienda@apple.com>
1983
1984         Reviewed by Darin
1985
1986         Added support for methods added to flesh out the WebKit 
1987         editing API.
1988
1989         * khtml/khtml_part.h: Removed pasteMarkupString and deleteSelection functions.
1990         All this work is now done in WebCoreBridge.
1991         * kwq/WebCoreBridge.h:
1992         * kwq/WebCoreBridge.mm:
1993         (-[WebCoreBridge isSelectionEditable]): Added a FIXME.
1994         (-[WebCoreBridge setDrawsBackground:]): Moved this since CVS merged this in the
1995         middle of editing code.
1996         (-[WebCoreBridge replaceSelectionWithNode:]): New method.
1997         (-[WebCoreBridge replaceSelectionWithText:]): Replaces insertText:
1998         (-[WebCoreBridge replaceSelectionWithMarkupString:]): New method.
1999         (-[WebCoreBridge replaceSelectionWithWebArchive:]): New method.
2000         (-[WebCoreBridge replaceSelectionWithNewline]): Replaces insertNewline:
2001         (-[WebCoreBridge deleteSelection]): New method.
2002         (-[WebCoreBridge applyStyle:toElementsInDOMRange:]): New method.
2003
2004 2004-04-09  Darin Adler  <darin@apple.com>
2005
2006         Reviewed by Ken.
2007
2008         - added "transparent mode"
2009
2010         * khtml/khtmlview.h: Added isTransparent and setTransparent functions.
2011         * khtml/khtmlview.cpp:
2012         (KHTMLViewPrivate::KHTMLViewPrivate): Initialize isTransparent to false.
2013         (KHTMLView::isTransparent): Return isTransparent.
2014         (KHTMLView::setTransparent): Set isTransparent.
2015
2016         * khtml/rendering/render_box.cpp:
2017         (RenderBox::paintRootBoxDecorations): Use slow repaints for the top frame when the view
2018         is transparent; also don't draw a background. This is the same thing we do for subframes.
2019         (RenderBox::paintBackgroundExtended): Don't do the extra draw so we can blend with the
2020         background color for the top frame when the view is transparent.
2021         * khtml/rendering/render_canvas.cpp: (RenderCanvas::paintBoxDecorations): More of the same.
2022
2023         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::paint): Make "fill with red" debug mode work only
2024         when the view is not transparent.
2025
2026         * kwq/WebCoreBridge.h: Added setDrawsBackground: method.
2027         * kwq/WebCoreBridge.mm: (-[WebCoreBridge setDrawsBackground:]): If told NO
2028         (don't draw background), then set isTransparent to true on the KHTMLView.
2029
2030 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2031
2032         Reviewed by me
2033         
2034         Added one more layout test for editing.
2035
2036         * layout-tests/editing/deleting/delete-3608445-fix-expected.txt: Added.
2037         * layout-tests/editing/deleting/delete-3608445-fix.html: Added.
2038
2039 2004-04-08  Maciej Stachowiak  <mjs@apple.com>
2040
2041         Reviewed by John.
2042
2043         Changed things so that newly created objects get a prototype based
2044         on the scope chain of the current function, rather than the
2045         interpreter that started execution. This fixes the following bugs:
2046         
2047         <rdar://problem/3368523>: ARCH: wrong prototype used to create new objects (hang on lookup.atomica.com)
2048         <rdar://problem/3559173>: ARCH: Cannot scan using a HP Jetdirect product (JS object prototypes bind incorrectly)
2049
2050         * khtml/ecma/kjs_binding.h:
2051         (KJS::cacheDOMObject):
2052         (KJS::cacheGlobalObject):
2053         * khtml/ecma/kjs_css.cpp:
2054         (KJS::getDOMStyleSheet):
2055         (KJS::getDOMStyleSheetList):
2056         (KJS::getDOMCSSValue):
2057         * khtml/ecma/kjs_dom.cpp:
2058         (KJS::getDOMDocumentNode):
2059         (KJS::getDOMNode):
2060         * khtml/ecma/kjs_events.cpp:
2061         (KJS::getDOMEvent):
2062         * khtml/ecma/kjs_html.cpp:
2063         (KJS::HTMLDocument::tryGet):
2064         (KJS::HTMLDocument::putValue):
2065         (KJS::getSelectHTMLCollection):
2066         * khtml/ecma/kjs_navigator.cpp:
2067         (Navigator::Navigator):
2068         (PluginBase::PluginBase):
2069         * khtml/ecma/kjs_window.cpp:
2070         (KJS::History::History):
2071         (KJS::FrameArray::FrameArray):
2072         (Screen::Screen):
2073         (Window::retrieveActive):
2074         (Window::put):
2075         (Window::isSafeScript):
2076         (WindowFunc::tryCall):
2077         (Location::put):
2078         (LocationFunc::tryCall):
2079
2080 2004-04-09  David Hyatt  <hyatt@apple.com>
2081
2082         Fix for 3613081, repaint glitches when using overflow:auto/overlay.
2083         
2084         Reviewed by john
2085
2086         * khtml/rendering/render_layer.cpp:
2087         (RenderLayer::updateScrollInfoAfterLayout):
2088
2089 2004-04-09  David Hyatt  <hyatt@apple.com>
2090
2091         Fix for 3608445, garbage characters rendered after doing delete.  Delta was unsigned when it was supposed to
2092         be signed, since deletion involves a negative delta.  Also had an off-by-one error in the line break end check.
2093         
2094         Reviewed by john
2095
2096         * khtml/rendering/render_text.cpp:
2097         (RenderText::setTextWithOffset):
2098
2099 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2100
2101         Reviewed by me
2102         
2103         Added two more layout tests for editing.
2104
2105         * layout-tests/editing/selection/move-between-blocks-no-001-expected.txt: Added.
2106         * layout-tests/editing/selection/move-between-blocks-no-001.html: Added.
2107         * layout-tests/editing/selection/move-between-blocks-yes-001-expected.txt: Added.
2108         * layout-tests/editing/selection/move-between-blocks-yes-001.html: Added.
2109
2110 2004-04-09  Ken Kocienda  <kocienda@apple.com>
2111
2112         Reviewed by Dave
2113         
2114         Small collection of editing improvements.
2115
2116         * ChangeLog:
2117         * khtml/editing/htmlediting_impl.cpp:
2118         (shouldDeleteUpstreamPosition): This was deleting significant spaces on preceding
2119         lines when the caret was at the start of a line. Fixed. 
2120         (DeleteSelectionCommandImpl::doApply): Fixed a case where caret jumped to previous
2121         line when deleting a character at the start of a line after a BR.
2122         (InputNewlineCommandImpl::doApply): Handle more cases correctly. Previously, this
2123         only handled inserting a newline when the caret was already in a text node.
2124         (InputTextCommandImpl::prepareForTextInsertion): Ditto.
2125         (InputTextCommandImpl::execute): Ditto.
2126         * khtml/editing/htmlediting_impl.h:
2127         * khtml/rendering/render_block.cpp:
2128         (khtml::RenderBlock::checkSelectionPointIgnoringContinuations): Now can place caret
2129         with a click in an empty block.
2130         * khtml/rendering/render_block.h: Added checkSelectionPointIgnoringContinuations declaration.
2131         * khtml/rendering/render_replaced.cpp: 
2132         (RenderReplaced::checkSelectionPointIgnoringContinuations): Now can place caret with a click 
2133         on a replaced element.
2134         * khtml/rendering/render_replaced.h: Added checkSelectionPointIgnoringContinuations declaration.
2135         * khtml/rendering/render_text.cpp:
2136         (InlineTextBox::checkSelectionPoint): Now can place caret with a click in text on a line made "tall"
2137         by an image on the same line.
2138         * khtml/xml/dom_docimpl.cpp:
2139         (DocumentImpl::createEditingTextNode): This creates a text node subclass that whill always create
2140         a renderer for itself.
2141         * khtml/xml/dom_docimpl.h:
2142         * khtml/xml/dom_position.cpp:
2143         (DOMPosition::isLastRenderedPositionInEditableBlock): Improved code to handle more cases.
2144         * khtml/xml/dom_textimpl.cpp:
2145         (TextImpl::TextImpl): Rolled out m_rendererIsNeeded flag.
2146         (TextImpl::rendererIsNeeded): Ditto.
2147         (EditingTextImpl::EditingTextImpl): New class.
2148         (EditingTextImpl::~EditingTextImpl): New.
2149         (EditingTextImpl::rendererIsNeeded): New. Always returns true.
2150         * khtml/xml/dom_textimpl.h: New EditingTextImpl class.
2151         * layout-tests/editing/deleting/delete-3608430-fix-expected.txt: Added.
2152         * layout-tests/editing/deleting/delete-3608430-fix.html: Added.
2153         * layout-tests/editing/deleting/delete-3608462-fix-expected.txt: Added.
2154         * layout-tests/editing/deleting/delete-3608462-fix.html: Added.
2155         * layout-tests/editing/deleting/delete-trailing-ws-002-expected.txt: Added.
2156         * layout-tests/editing/deleting/delete-trailing-ws-002.html: Added.
2157
2158 2004-04-08  Chris Blumenberg  <cblu@apple.com>
2159
2160         Renamed the PasteHTMLCommand to PasteMarkupCommand. Removed PasteImageCommand because we will use PasteMarkupCommand for pasting images.
2161
2162         Reviewed by kocienda.
2163
2164         * ChangeLog:
2165         * khtml/editing/htmlediting.cpp:
2166         (PasteMarkupCommand::PasteMarkupCommand):
2167         (PasteMarkupCommand::~PasteMarkupCommand):
2168         (PasteMarkupCommand::impl):
2169         (PasteMarkupCommand::markupString):
2170         * khtml/editing/htmlediting.h:
2171         (khtml::):
2172         * khtml/editing/htmlediting_impl.cpp:
2173         (PasteMarkupCommandImpl::PasteMarkupCommandImpl):
2174         (PasteMarkupCommandImpl::~PasteMarkupCommandImpl):
2175         (PasteMarkupCommandImpl::commandID):
2176         (PasteMarkupCommandImpl::doApply):
2177         * khtml/editing/htmlediting_impl.h:
2178         (khtml::PasteMarkupCommandImpl::markupString):
2179         * khtml/khtml_part.cpp:
2180         (KHTMLPart::pasteMarkupString):
2181         * khtml/khtml_part.h:
2182         * kwq/WebCoreBridge.h:
2183         * kwq/WebCoreBridge.mm:
2184         (-[WebCoreBridge pasteMarkupString:]):
2185
2186
2187 2004-04-08  David Hyatt  <hyatt@apple.com>
2188
2189         Fix for 3608430 and 3608462, crashes in findNextLineBreak when deleting.  Make sure that the removal of line boxes
2190         always checks the previous root line box's line break information and dirties the line if it is pointing
2191         to the deleted object.
2192         
2193         Reviewed by kocienda
2194
2195         * khtml/rendering/render_line.cpp:
2196         (InlineFlowBox::removeChild):
2197
2198 2004-04-08  Chris Blumenberg  <cblu@apple.com>
2199
2200         Removed DOMExtensions.h from DOM.h until it is public.
2201
2202         Reviewed by koicienda.
2203
2204         * kwq/DOM.h:
2205
2206 2004-04-07  Chris Blumenberg  <cblu@apple.com>
2207
2208         WebCore side for supporting WebDOMOperations.   
2209
2210         Reviewed by rjw.
2211
2212         * WebCore-combined.exp:
2213         * WebCore.exp:
2214         * kwq/DOM.mm:
2215         * kwq/DOMExtensions.h:
2216         * kwq/WebCoreBridge.h:
2217         * kwq/WebCoreBridge.mm:
2218         (+[WebCoreBridge bridgeForDOMDocument:]): new
2219         (-[WebCoreBridge imageForImageElement:]): new
2220
2221 2004-04-07  Darin Adler  <darin@apple.com>
2222
2223         Reviewed by Chris.
2224
2225         * kwq/DOMCSS.h: Changed DOMCSS2Properties to be a category on DOMCSSStyleDeclaration
2226         (after API review, oops!, but I doubt anyone will even notice).
2227         * kwq/DOM-CSS.mm: Implemented the entire DOMCSS2Properties category.
2228
2229 2004-04-07  Ken Kocienda  <kocienda@apple.com>
2230
2231         Reviewed by Chris
2232
2233         * kwq/WebCoreBridge.mm:
2234         (-[WebCoreBridge _stringWithDocumentTypeStringAndMarkupString:]): Do not add a newline in between
2235         the doctype and the content. The newline was showing up when the content was pasted.
2236
2237 2004-04-07  Ken Kocienda  <kocienda@apple.com>
2238
2239         Reviewed by John
2240
2241         Removed concept of currentSelection from EditCommands and refined concept of
2242         startingSelection and endingSelection, making them work more sensibly in the 
2243         system of composed editing commands.
2244
2245         * khtml/editing/htmlediting.cpp: Removed currentSelection().
2246         * khtml/editing/htmlediting.h: Ditto.
2247         * khtml/editing/htmlediting_impl.cpp: currentSelection().
2248         (CompositeEditCommandImpl::applyCommandToComposite): Set the startingSelection 
2249         and endingSelection for the command being applied to the endingSelection of
2250         its new parent. This is the proper starting and ending point.
2251         (CompositeEditCommandImpl::deleteSelection): Changed call to currentSelection
2252         to endingSelection.
2253         (DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl): Ditto.
2254         (DeleteSelectionCommandImpl::DeleteSelectionCommandImpl): Changed call from startingSelection
2255         to endingSelection.
2256         (DeleteSelectionCommandImpl::joinTextNodesWithSameStyle): Changed call to currentSelection
2257         to endingSelection.
2258         (InputNewlineCommandImpl::doApply): Ditto.
2259         (InputTextCommandImpl::deleteCharacter): Ditto.
2260         (InputTextCommandImpl::prepareForTextInsertion): Ditto.
2261         (InputTextCommandImpl::execute): Ditto.
2262         (PasteHTMLCommandImpl::doApply): Ditto.
2263         (TypingCommandImpl::insertText): Remove extraneous call to reset endingSelection. This has
2264         already been done by the helpers this command uses to do its work.
2265         (TypingCommandImpl::issueCommandForDeleteKey): Changed call to currentSelection
2266         to endingSelection.
2267         (TypingCommandImpl::deleteKeyPressed): Remove extraneous call to reset endingSelection. This has
2268         already been done by the helpers this command uses to do its work.
2269         * khtml/editing/htmlediting_impl.h:
2270         (khtml::EditCommandImpl::endingSelection): Remove extraneous call to reset endingSelection. This has
2271         already been done by the helpers this command uses to do its work.
2272
2273 2004-04-07  Ken Kocienda  <kocienda@apple.com>
2274
2275         Reviewed by John
2276         
2277         Make paste work again. It has been broken for some undetermined
2278         period of time.
2279
2280         * khtml/editing/htmlediting_impl.cpp:
2281         (CompositeEditCommandImpl::insertNodeAt): Handle inserting a node when
2282         the reference node has children, or is an empty block.
2283         (CompositeEditCommandImpl::inputText): New convenience to create and
2284         apply an InputTextCommand.
2285         (InputTextCommandImpl::execute): Collapse whitespace when selection is
2286         not a range. Deleting the selection when it is a range already does that, 
2287         so no need to make special accommodation for it.
2288         (PasteHTMLCommandImpl::PasteHTMLCommandImpl): Initialize m_HTMLString using 
2289         an initialization list.
2290         (PasteHTMLCommandImpl::doApply): Collapse whitespace.... as above for 
2291         InputTextCommandImpl::execute. Don't need to qualify NodeImpl's with DOM 
2292         namespace. Clean up selection access; no need to grep around for it, the
2293         desired selection is returned by calling currentSelection(). Treat "simple
2294         text paste" like typing. Tighten up and simplify HTML fragment paste; no
2295         real change in algorithm. 
2296         (SplitTextNodeCommandImpl::SplitTextNodeCommandImpl): m_text1 member variable
2297         not initialized. This bug was introduced by a recent change by me. Fixing now.
2298         * khtml/editing/htmlediting_impl.h: Add inputText() declaration.
2299
2300 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2301
2302         Reviewed by Richard
2303
2304         * khtml/khtml_part.cpp:
2305         (KHTMLPart::setSelection): Now calls setFocusNodeIfNeeded.
2306         (KHTMLPart::takeSelectionFrom): Now calls setFocusNodeIfNeeded.
2307         (KHTMLPart::clearSelection): Now calls setFocusNodeIfNeeded.
2308         (KHTMLPart::invalidateSelection): Now calls setFocusNodeIfNeeded.
2309         (KHTMLPart::setSelectionVisible): Now calls setFocusNodeIfNeeded.
2310         (KHTMLPart::setFocusNodeIfNeeded): New function focuses first element 
2311         of a selection that is contenteditable, if any of the nodes are. The "first"
2312         determination is made by doing a document-order search.
2313         * khtml/khtml_part.h:
2314         * khtml/xml/dom_nodeimpl.cpp: Remove debug spam.
2315         * kwq/WebCoreBridge.mm:
2316         (-[WebCoreBridge setSelectedDOMRange:]): Now updates document layout before
2317         setting the selection. This was needed for Blot, so that setting the 
2318         contenteditable attribute on the body is "seen" when the attempt is made
2319         to set the selection right immediately after.
2320
2321 2004-04-06  David Hyatt  <hyatt@apple.com>
2322
2323         After columns have been expanded to their preferred sizes, if space is left over in the table, then
2324         fixed columns should expand to fill space before percentage width columns do.  The old code had it
2325         backwards.
2326         
2327         Reviewed by john
2328
2329         * khtml/rendering/table_layout.cpp:
2330         (AutoTableLayout::layout):
2331
2332 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2333
2334         Reviewed by Dave
2335
2336         * khtml/dom/dom_node.cpp:
2337         (Node::isContentEditable): Added. Calls through to impl function of same name.
2338         * khtml/dom/dom_node.h: Added isContentEditable declaration.
2339         * khtml/khtmlview.cpp:
2340         (KHTMLView::viewportMouseMoveEvent): Now, the cursor will change
2341         to an i-beam whenever it is over a node that is contenteditable, and nothing, 
2342         like a link, takes precedence.
2343
2344 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2345
2346         Reviewed by Dave
2347
2348         * khtml/css/html4.css: Refine focus rules so that HTML and BODY
2349         elements do not draw a focus ring around themselves when focused.
2350         This prevents a silly-looking focus ring from drawing around a 
2351         document's entire contents when a body element is contenteditable.
2352
2353 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2354
2355         Reviewed by Dave
2356
2357         Caret height is now the height of the tallest element on the line,
2358         mimicking NSText behavior.
2359
2360         * khtml/rendering/render_box.cpp:
2361         (RenderBox::caretPos): Use root line box topOverflow and bottomOverflow 
2362         for the calculation of caret height.
2363         * khtml/rendering/render_text.cpp:
2364         (RenderText::caretPos): Ditto.
2365
2366 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2367
2368         Reviewed by me
2369
2370         Added a new suite of layout tests for editing, all added
2371         in the new layout-tests/editing subtree.
2372
2373         * layout-tests/editing/abe.jpg: Added.
2374         * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Added.
2375         * layout-tests/editing/deleting/delete-block-contents-001.html: Added.
2376         * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Added.
2377         * layout-tests/editing/deleting/delete-block-contents-002.html: Added.
2378         * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Added.
2379         * layout-tests/editing/deleting/delete-block-contents-003.html: Added.
2380         * layout-tests/editing/deleting/delete-br-001-expected.txt: Added.
2381         * layout-tests/editing/deleting/delete-br-001.html: Added.
2382         * layout-tests/editing/deleting/delete-br-002-expected.txt: Added.
2383         * layout-tests/editing/deleting/delete-br-002.html: Added.
2384         * layout-tests/editing/deleting/delete-br-003-expected.txt: Added.
2385         * layout-tests/editing/deleting/delete-br-003.html: Added.
2386         * layout-tests/editing/deleting/delete-br-004-expected.txt: Added.
2387         * layout-tests/editing/deleting/delete-br-004.html: Added.
2388         * layout-tests/editing/deleting/delete-br-005-expected.txt: Added.
2389         * layout-tests/editing/deleting/delete-br-005.html: Added.
2390         * layout-tests/editing/deleting/delete-br-006-expected.txt: Added.
2391         * layout-tests/editing/deleting/delete-br-006.html: Added.
2392         * layout-tests/editing/deleting/delete-character-001-expected.txt: Added.
2393         * layout-tests/editing/deleting/delete-character-001.html: Added.
2394         * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Added.
2395         * layout-tests/editing/deleting/delete-contiguous-ws-001.html: Added.
2396         * layout-tests/editing/deleting/delete-image-001-expected.txt: Added.
2397         * layout-tests/editing/deleting/delete-image-001.html: Added.
2398         * layout-tests/editing/deleting/delete-image-002-expected.txt: Added.
2399         * layout-tests/editing/deleting/delete-image-002.html: Added.
2400         * layout-tests/editing/deleting/delete-image-003-expected.txt: Added.
2401         * layout-tests/editing/deleting/delete-image-003.html: Added.
2402         * layout-tests/editing/deleting/delete-leading-ws-001-expected.txt: Added.
2403         * layout-tests/editing/deleting/delete-leading-ws-001.html: Added.
2404         * layout-tests/editing/deleting/delete-selection-001-expected.txt: Added.
2405         * layout-tests/editing/deleting/delete-selection-001.html: Added.
2406         * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Added.
2407         * layout-tests/editing/deleting/delete-trailing-ws-001.html: Added.
2408         * layout-tests/editing/editing.js: Added.
2409         * layout-tests/editing/inserting/typing-001-expected.txt: Added.
2410         * layout-tests/editing/inserting/typing-001.html: Added.
2411         * layout-tests/editing/inserting/typing-002-expected.txt: Added.
2412         * layout-tests/editing/inserting/typing-002.html: Added.
2413         * layout-tests/editing/inserting/typing-around-br-001-expected.txt: Added.
2414         * layout-tests/editing/inserting/typing-around-br-001.html: Added.
2415         * layout-tests/editing/inserting/typing-around-image-001-expected.txt: Added.
2416         * layout-tests/editing/inserting/typing-around-image-001.html: Added.
2417         * layout-tests/editing/selection/extend-by-character-001-expected.txt: Added.
2418         * layout-tests/editing/selection/extend-by-character-001.html: Added.
2419         * layout-tests/editing/selection/extend-by-character-002-expected.txt: Added.
2420         * layout-tests/editing/selection/extend-by-character-002.html: Added.
2421         * layout-tests/editing/selection/extend-by-character-003-expected.txt: Added.
2422         * layout-tests/editing/selection/extend-by-character-003.html: Added.
2423         * layout-tests/editing/selection/extend-by-character-004-expected.txt: Added.
2424         * layout-tests/editing/selection/extend-by-character-004.html: Added.
2425         * layout-tests/editing/selection/extend-by-character-005-expected.txt: Added.
2426         * layout-tests/editing/selection/extend-by-character-005.html: Added.
2427         * layout-tests/editing/selection/move-by-character-001-expected.txt: Added.
2428         * layout-tests/editing/selection/move-by-character-001.html: Added.
2429         * layout-tests/editing/selection/move-by-character-002-expected.txt: Added.
2430         * layout-tests/editing/selection/move-by-character-002.html: Added.
2431         * layout-tests/editing/selection/move-by-character-003-expected.txt: Added.
2432         * layout-tests/editing/selection/move-by-character-003.html: Added.
2433         * layout-tests/editing/selection/move-by-character-004-expected.txt: Added.
2434         * layout-tests/editing/selection/move-by-character-004.html: Added.
2435         * layout-tests/editing/selection/move-by-character-005-expected.txt: Added.
2436         * layout-tests/editing/selection/move-by-character-005.html: Added.
2437         * layout-tests/editing/undo/redo-typing-001-expected.txt: Added.
2438         * layout-tests/editing/undo/redo-typing-001.html: Added.
2439         * layout-tests/editing/undo/undo-typing-001-expected.txt: Added.
2440         * layout-tests/editing/undo/undo-typing-001.html: Added.
2441
2442 2004-04-06  Ken Kocienda  <kocienda@apple.com>
2443
2444         Reviewed by Dave
2445
2446         Added execCommand feature. 
2447         Added Javascript selection object.
2448         This lays the groundwork for layout tests for editing.
2449
2450         * khtml/dom/dom_doc.cpp:
2451         (DOM::Document::execCommand): Added. Calls through to impl's execCommand.
2452         * khtml/dom/dom_doc.h: Added execCommand declaration.
2453         * khtml/ecma/kjs_dom.cpp:
2454         (DOMDocumentProtoFunc::tryCall): Switch on new ExecCommand constant and call through to the document.
2455         * khtml/ecma/kjs_dom.h: Added ExecCommand constant.
2456         (KJS::DOMDocument::):
2457         * khtml/ecma/kjs_dom.lut.h: Generated file.
2458         * khtml/ecma/kjs_window.cpp:
2459         (Window::Window): Initialize selection object.
2460         (Window::selection): Return window's selection object.
2461         (Window::mark): Mark selection object.
2462         (WindowFunc::tryCall): Return selection object on GetSelection.
2463         (LocationFunc::tryCall): Added.
2464         (Selection::Selection): Added.
2465         (Selection::~Selection): Added.
2466         (Selection::get): Added.
2467         (Selection::put): Added.
2468         (Selection::toPrimitive): Added.
2469         (Selection::toString): Added.
2470         (SelectionFunc::tryCall): Added.
2471         * khtml/ecma/kjs_window.h:
2472         (KJS::Selection::): Added.
2473         (KJS::Selection::part): Added.
2474         (KJS::Selection::classInfo): Added.
2475         * khtml/ecma/kjs_window.lut.h: Generated file.
2476         * khtml/editing/htmlediting_impl.cpp:
2477         (debugPosition): Debugging aid.
2478         (DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Move the ending position
2479         if you are about to delete it. Fixes a crasher I discovered while writing tests.
2480         (DeleteSelectionCommandImpl::doApply): Move to containing editable block position 0
2481         instead of 1 in a block in delete case 1.
2482         (InputTextCommandImpl::prepareForTextInsertion):
2483         (TypingCommandImpl::issueCommandForDeleteKey):
2484         * khtml/khtml_part.h:
2485         * khtml/khtml_selection.cpp:
2486         (KHTMLSelection::validate): Now adjusts the selection down to leaf nodes if needed.
2487         (KHTMLSelection::debugPosition): Debugging aid.
2488         * khtml/xml/dom_docimpl.cpp:
2489         (DocumentImpl::execCommand): Added. Supports five different commands.
2490         * khtml/xml/dom_docimpl.h:
2491         * khtml/xml/dom_nodeimpl.cpp:
2492         (NodeImpl::previousEditable): Use false instead of 0 for equality check.
2493         (NodeImpl::nextEditable): Ditto.
2494         * khtml/xml/dom_position.cpp:
2495         (DOMPosition::equivalentLeafPosition): New function
2496         (DOMPosition::previousRenderedEditablePosition): New function
2497         (DOMPosition::nextRenderedEditablePosition): New function
2498         (DOMPosition::equivalentUpstreamPosition): Refined behavior to handle more cases correctly.
2499         (DOMPosition::equivalentDownstreamPosition): Ditto.
2500         (DOMPosition::atStartOfContainingEditableBlock):New function
2501         (DOMPosition::atStartOfRootEditableBlock):New function
2502         * khtml/xml/dom_position.h:
2503         * kwq/KWQKHTMLPart.h:
2504         * kwq/KWQKHTMLPart.mm:
2505         (KWQKHTMLPart::issueUndoCommand): New function for calling undo programatically.
2506         (KWQKHTMLPart::issueRedoCommand): Ditto, but for redo.
2507         * kwq/KWQRenderTreeDebug.cpp:
2508         (nodePositionRelativeToRoot): New function to generate log information for the selection.
2509         (writeSelection): Writes the selection if there is one.
2510         (externalRepresentation): Calls writeSelection
2511         * kwq/WebCoreBridge.h: New declarations for issueUndoCommand and issueRedoCommand.
2512
2513 2004-04-05  Darin Adler  <darin@apple.com>
2514
2515         * khtml/html/kentities.gperf: Added &COPY; and &REG;, both supported by Gecko
2516         (and presumably by WinIE). Also re-sorted the list.
2517         * khtml/html/kentities.c: Regenerated.
2518
2519 2004-04-05  Darin Adler  <darin@apple.com>
2520
2521         Reviewed by Dave.
2522
2523         - rolled over fix from KHTML tree; anchor inside another anchor
2524
2525         * khtml/rendering/render_layer.cpp: (RenderLayer::nodeAtPoint):
2526         Make sure the URL element is the innermost one, by not setting it once
2527         it's already set.
2528
2529 2004-04-05  David Hyatt  <hyatt@apple.com>
2530
2531         Implement overflow: overlay so that a scrollbar can show/hide without causing a layout.
2532         
2533         Reviewed by darin
2534
2535         * ChangeLog:
2536         * khtml/css/css_computedstyle.cpp:
2537         (DOM::CSSComputedStyleDeclarationImpl::getPropertyCSSValue):
2538         * khtml/css/cssparser.cpp:
2539         (CSSParser::parseValue):
2540         * khtml/css/cssstyleselector.cpp:
2541         (khtml::CSSStyleSelector::applyProperty):
2542         * khtml/css/cssvalues.c:
2543         (hash_val):
2544         (findValue):
2545         * khtml/css/cssvalues.h:
2546         * khtml/css/cssvalues.in:
2547         * khtml/rendering/render_block.cpp:
2548         (khtml::RenderBlock::layoutBlock):
2549         (khtml::RenderBlock::layoutBlockChildren):
2550         (khtml::RenderBlock::rightOffset):
2551         * khtml/rendering/render_box.cpp:
2552         (RenderBox::contentWidth):
2553         (RenderBox::contentHeight):
2554         * khtml/rendering/render_layer.cpp:
2555         (RenderLayer::updateScrollInfoAfterLayout):
2556         * khtml/rendering/render_object.cpp:
2557         (RenderObject::clientWidth):
2558         (RenderObject::clientHeight):
2559         * khtml/rendering/render_style.h:
2560         (khtml::):
2561         (khtml::RenderStyle::hasAutoScrollbars):
2562         (khtml::RenderStyle::scrollsOverflow):
2563         (khtml::RenderStyle::includeScrollbarSize):
2564
2565 2004-04-03  David Hyatt  <hyatt@apple.com>
2566
2567         Implementation of <input type=range>, which makes sliders available in Web pages.
2568         
2569         Reviewed by john
2570
2571         * WebCore.pbproj/project.pbxproj:
2572         * khtml/ecma/kjs_dom.cpp:
2573         (DOMNode::getValueProperty):
2574         (DOMNode::putValue):
2575         * khtml/ecma/kjs_dom.h:
2576         (KJS::DOMNode::):
2577         * khtml/ecma/kjs_dom.lut.h:
2578         (KJS::):
2579         * khtml/html/html_formimpl.cpp:
2580         (HTMLInputElementImpl::setType):
2581         (HTMLInputElementImpl::type):
2582         (HTMLInputElementImpl::click):
2583         (HTMLInputElementImpl::accessKeyAction):
2584         (HTMLInputElementImpl::parseHTMLAttribute):
2585         (HTMLInputElementImpl::rendererIsNeeded):
2586         (HTMLInputElementImpl::createRenderer):
2587         (HTMLInputElementImpl::encoding):
2588         * khtml/html/html_formimpl.h:
2589         (DOM::HTMLInputElementImpl::):
2590         * khtml/misc/htmlattrs.c:
2591         (hash_attr):
2592         (findAttr):
2593         * khtml/misc/htmlattrs.h:
2594         * khtml/misc/htmlattrs.in:
2595         * khtml/rendering/render_form.cpp:
2596         (RenderLineEdit::slotTextChanged):
2597         (:RenderFormElement):
2598         (RenderSlider::calcMinMaxWidth):
2599         (RenderSlider::updateFromElement):
2600         (RenderSlider::slotSliderValueChanged):
2601         * khtml/rendering/render_form.h:
2602         (khtml::RenderSlider::element):
2603         (khtml::RenderSlider::renderName):
2604         (khtml::RenderSlider::canHaveIntrinsicMargins):
2605         * khtml/xml/dom2_eventsimpl.cpp:
2606         (EventImpl::typeToId):
2607         (EventImpl::idToType):
2608         * khtml/xml/dom2_eventsimpl.h:
2609         (DOM::EventImpl::):
2610         * kwq/KWQSlider.h: Added.
2611         * kwq/KWQSlider.mm: Added.
2612         (-[KWQSlider initWithQSlider:]):
2613         (-[KWQSlider slide:]):
2614         (m_val):
2615         (QSlider::setFont):
2616         (QSlider::sizeHint):
2617         (QSlider::setValue):
2618         (QSlider::setMinValue):
2619         (QSlider::setMaxValue):
2620         (QSlider::value):
2621         (QSlider::minValue):
2622         (QSlider::maxValue):
2623         (QSlider::sliderValueChanged):
2624         (QSlider::dimensions):
2625         * kwq/KWQSlot.mm:
2626         (KWQSlot::KWQSlot):
2627         (KWQSlot::call):
2628
2629 2004-04-05  Chris Blumenberg  <cblu@apple.com>
2630
2631         Fixed: <rdar://problem/3612580>: SPI: WebPlugin selection
2632
2633         Reviewed by kocienda.
2634
2635         * WebCore.pbproj/project.pbxproj:
2636         * khtml/rendering/render_replaced.cpp:
2637         (RenderWidget::setSelectionState): new override, calls QWidget::setIsSelected
2638         * khtml/rendering/render_replaced.h:
2639         (khtml::RenderWidget::selectionState): new override
2640         * kwq/KWQWidget.h:
2641         * kwq/KWQWidget.mm:
2642         (QWidget::setIsSelected): new, calls [WebCoreBridge setIsSelected:forView:]
2643         (QWidget::isSelected): new, calls [WebCoreBridge isViewSelected:]
2644         * kwq/WebCoreBridge.h:
2645         * kwq/WebCoreBridge.mm:
2646         (-[WebCoreBridge selectionColor]): new
2647
2648 2004-04-03  David Hyatt  <hyatt@apple.com>
2649
2650         Fix for 3601728, text overlaps borders at ejai.org.  Remove all the code in addForbidden for
2651         dir, menu, nobr, and pre that made them too restrictive regarding what child tags they could
2652         contain.
2653         
2654         Reviewed by kocienda
2655
2656         * khtml/html/dtd.cpp:
2657         (DOM::addForbidden):
2658         (DOM::removeForbidden):
2659
2660 2004-04-02  Chris Blumenberg  <cblu@apple.com>
2661
2662         Moved the DOM extensions to their own headers
2663
2664         Reviewed by kocienda.
2665
2666         * WebCore.pbproj/project.pbxproj:
2667         * kwq/DOM.h: include DOMExtensions.h
2668         * kwq/DOMExtensions.h: Added.
2669         * kwq/DOMHTML.h: moved extensions to DOMExtensions.h
2670         * kwq/DOMHTML.mm: Renamed to match header
2671
2672 2004-04-02  David Hyatt  <hyatt@apple.com>
2673
2674         Fix for 3610662, rendering sometimes doesn't update in response to mouse events that change style.
2675         The document changed list was getting messed up.
2676         
2677         Reviewed by darin
2678
2679         * khtml/xml/dom_docimpl.cpp:
2680         (DocumentImpl::updateDocumentsRendering):
2681         * khtml/xml/dom_docimpl.h:
2682
2683 === Safari-135 ===
2684
2685 2004-04-01  Darin Adler  <darin@apple.com>
2686
2687         Based on a fix by Eric Albert.
2688
2689         - fixed <rdar://problem/3594247>: Safari crashes when a background image has a height or width of 0
2690
2691         * khtml/rendering/render_box.cpp: (RenderBox::paintBackgroundExtended):
2692         Change code path so we don't mod with 0.
2693
2694 2004-04-01  Darin Adler  <darin@apple.com>
2695
2696         Reviewed by Dave.
2697
2698         - fixed <rdar://problem/3608305>: DEMO: menu in search field has one disabled item: localized string not found
2699
2700         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::HTMLInputElementImpl):
2701         Initialize m_maxResults to 0.
2702
2703 2004-04-01  Darin Adler  <darin@apple.com>
2704
2705         Reviewed by John.
2706
2707         - cleaned up image map code and made it work with XML documents
2708
2709         * khtml/html/html_documentimpl.h: Removed getMap and mapMap.
2710         * khtml/html/html_documentimpl.cpp: Removed getMap; moved to base class.
2711
2712         * khtml/html/html_imageimpl.cpp:
2713         (HTMLMapElementImpl::~HTMLMapElementImpl): Call new removeImageMap function instead
2714         of manipulating the mapMap field directly.
2715         (HTMLMapElementImpl::parseHTMLAttribute): Rewrite name changing code for simplicity
2716         and to avoid running off the end of the bufffer.
2717         Also remove image map before changing name so it doesn't end up in the map twice
2718         under both the old and new names.
2719         * khtml/html/html_imageimpl.h: Use a DOMString instead of QString for the name, since
2720         the public API already uses a DOMString.
2721
2722         * khtml/rendering/render_image.cpp: (RenderImage::nodeAtPoint): Call the new
2723         getImageMap instead of the old getMap.
2724
2725         * khtml/xml/dom_docimpl.h: Added addImageMap, removeImageMap, getImageMap, and m_imageMapsByName.
2726         * khtml/xml/dom_docimpl.cpp:
2727         (DocumentImpl::addImageMap): Added. Stores the image map under its name, unless there's
2728         already another map of the same.
2729         (DocumentImpl::removeImageMap): Added. Removes the image map if it's already filed by
2730         name. Avoid pitfall of removing another image map that has the same name.
2731         (DocumentImpl::getImageMap): Added. Simplified version of logic from getMap in HTMLDocumentImpl.
2732
2733 2004-04-01  Darin Adler  <darin@apple.com>
2734
2735         Reviewed by Ken.
2736
2737         - fixed <rdar://problem/3608978>: dual <map> means you can't select the enter site button at jurassicpark.com (same problem in MacIE, works in Netscape)
2738
2739         * khtml/html/html_imageimpl.cpp: (HTMLMapElementImpl::parseHTMLAttribute):
2740         Make the first <map> seen win, as in other browsers. The old code made the last <map> seen win.
2741
2742 2004-04-01  Ken Kocienda  <kocienda@apple.com>
2743
2744         Reviewed by me
2745         
2746         Missing file broke build after my last checkin
2747
2748         * ForwardingHeaders/rendering/render_line.h: Added.
2749
2750 2004-03-31  Ken Kocienda  <kocienda@apple.com>
2751
2752         Reviewed by Dave.
2753         
2754         Many, many editing improvements, with a concentration on getting
2755         caret navigation and deleting selections working correctly.
2756
2757         * WebCore.pbproj/project.pbxproj:
2758         * khtml/dom/dom_position.cpp: Removed.
2759         * khtml/dom/dom_position.h: Removed.
2760         * khtml/editing/htmlediting.cpp:
2761         (EditCommand::isNull): Inlined.
2762         (EditCommand::notNull): New function.
2763         (EditCommand::parent): Commands now have parents. Allows for walking the tree of composite commands.
2764         (EditCommand::setParent): Ditto.
2765         (EditCommand::emptyCommand): Returns a static empty command.
2766         (AppendNodeCommand::AppendNodeCommand): 
2767         (AppendNodeCommand::parentNode): Member variable name change only. parent -> parentNode.
2768         (DeleteCollapsibleWhitespaceCommand::DeleteCollapsibleWhitespaceCommand): New command.
2769         (InputTextCommand::InputTextCommand):
2770         (InputTextCommand::input):
2771         (InputTextCommand::charactersAdded):
2772         (JoinTextNodesCommand::JoinTextNodesCommand): Now derives directly from EditCommand.
2773         (RemoveNodeAndPruneCommand::RemoveNodeAndPruneCommand): New command.
2774         (SplitTextNodeCommand::SplitTextNodeCommand): Now derives directly from EditCommand.
2775         * khtml/editing/htmlediting.h:
2776         * khtml/editing/htmlediting_impl.cpp:
2777         (isNBSP): New helper.
2778         (isWS): New helper.
2779         (shouldPruneNode): New helper.
2780         (leadingWhitespacePosition): New helper.
2781         (trailingWhitespacePosition): New helper.
2782         (textNodesAreJoinable): New helper.
2783         (nonBreakingSpaceString): Returns a static DOMString containing a non-breaking space.
2784         (EditCommandImpl::EditCommandImpl):
2785         (EditCommandImpl::setStartingSelection): Now recursively sets starting selection on parents.
2786         (EditCommandImpl::setEndingSelection): As above, for ending selection.
2787         (EditCommandImpl::parent): New accessor.
2788         (EditCommandImpl::setParent): New accessor.
2789         (CompositeEditCommandImpl::doUnapply): Removed some logging.
2790         (CompositeEditCommandImpl::doReapply): Removed some logging.
2791         (CompositeEditCommandImpl::applyCommandToComposite): Sets parent.
2792         (CompositeEditCommandImpl::removeNodeAndPrune): New comvenience.
2793         (CompositeEditCommandImpl::replaceText): New comvenience.
2794         (CompositeEditCommandImpl::deleteSelection): New comvenience.
2795         (CompositeEditCommandImpl::deleteCollapsibleWhitespace): New comvenience.
2796         (AppendNodeCommandImpl::AppendNodeCommandImpl): Member variable name change only. parent -> parentNode.
2797         (AppendNodeCommandImpl::~AppendNodeCommandImpl): Ditto.
2798         (AppendNodeCommandImpl::doApply): Ditto.
2799         (AppendNodeCommandImpl::doUnapply): Ditto.
2800         (DeleteCollapsibleWhitespaceCommandImpl::DeleteCollapsibleWhitespaceCommandImpl): New command
2801         (debugPosition): New debugging aid.
2802         (DeleteSelectionCommandImpl::doApply): Major reworking to handle more cases correctly.
2803         (InputNewlineCommandImpl::doApply): Position and selection tweaks.
2804         (InputTextCommandImpl::InputTextCommandImpl): Handles more cases now, like typing after an image.
2805         (JoinTextNodesCommandImpl::JoinTextNodesCommandImpl): Now derives directly from EditCommand.
2806         Implements the guts of the command itself now, rather than replying on its former base class.
2807         (RemoveNodeAndPruneCommandImpl::RemoveNodeAndPruneCommandImpl): New command.
2808         (SplitTextNodeCommandImpl::SplitTextNodeCommandImpl): Now derives directly from EditCommand.
2809         Implements the guts of the command itself now, rather than replying on its former base class.
2810         (TypingCommandImpl::TypingCommandImpl): Major rework to handle more cases correctly.
2811         * khtml/editing/htmlediting_impl.h:
2812         * khtml/html/html_elementimpl.cpp:
2813         (HTMLElementImpl::isContentEditable): More efficient use of the style system to answer the question.
2814         * khtml/khtml_part.cpp:
2815         (KHTMLPart::setSelection): Fixes an issue where the caret would not repaint after being moved when undoing.
2816         (KHTMLPart::takeSelectionFrom): Ditto.
2817         (KHTMLPart::clearSelection): Ditto.
2818         (KHTMLPart::invalidateSelection): Ditto.
2819         (KHTMLPart::setSelectionVisible): Ditto.
2820         (KHTMLPart::slotClearSelection): Ditto.
2821         (KHTMLPart::clearCaretRectIfNeeded):  Ditto.
2822         (KHTMLPart::notifySelectionChanged): Ditto.
2823         (KHTMLPart::unappliedEditing): Now uses EditCommand::emptyCommand().
2824         (KHTMLPart::reappliedEditing): Ditto.
2825         * khtml/khtml_part.h:
2826         * khtml/khtml_selection.cpp:
2827         (KHTMLSelection::KHTMLSelection):
2828         (KHTMLSelection::modify): Updated to work with new DOMPosition API.
2829         (KHTMLSelection::paintCaret): Ditto.
2830         (KHTMLSelection::moveToRenderedContent): Ditto.
2831         (KHTMLSelection::basePosition): New convenience.
2832         (KHTMLSelection::extentPosition): New convenience.
2833         (KHTMLSelection::startPosition): New convenience.
2834         (KHTMLSelection::endPosition): New convenience.
2835         (KHTMLSelection::debugPosition): Modified debug output.
2836         * khtml/khtml_selection.h:
2837         (KHTMLSelection::isEmpty):
2838         (KHTMLSelection::notEmpty):
2839         * khtml/rendering/bidi.cpp:
2840         (khtml::RenderBlock::layoutInlineChildren): Fixed a crasher that happened when deleting content at the start of a line.
2841         * khtml/rendering/render_br.cpp:
2842         (RenderBR::caretMaxRenderedOffset): New function.
2843         (RenderBR::caretPos): Now draws the caret in the right place when a block is empty.
2844         * khtml/rendering/render_br.h:
2845         * khtml/rendering/render_flow.cpp:
2846         (RenderFlow::caretPos): Now draws the caret in the right place when a flow is empty.
2847         * khtml/rendering/render_line.cpp:
2848         (InlineBox::caretMaxRenderedOffset): New function.
2849         * khtml/rendering/render_line.h:
2850         * khtml/rendering/render_object.cpp:
2851         (RenderObject::isEditable):
2852         (RenderObject::caretMaxRenderedOffset): New function.
2853         * khtml/rendering/render_object.h:
2854         * khtml/rendering/render_replaced.cpp:
2855         (RenderReplaced::caretMaxRenderedOffset): New function.
2856         * khtml/rendering/render_replaced.h:
2857         * khtml/rendering/render_text.cpp:
2858         (InlineTextBox::caretMaxRenderedOffset): New function.
2859         (RenderText::detach):
2860         (RenderText::caretMaxOffset):
2861         (RenderText::caretMaxRenderedOffset): New function.
2862         * khtml/rendering/render_text.h:
2863         (khtml::InlineTextBox::len):
2864         * khtml/xml/dom_edititerator.cpp: Added.
2865         * khtml/xml/dom_edititerator.h: Added.
2866         * khtml/xml/dom_nodeimpl.cpp:
2867         (NodeImpl::previousEditable): Improved the correctness of this function.
2868         (NodeImpl::nextEditable): Ditto.
2869         * khtml/xml/dom_nodeimpl.h:
2870         * khtml/xml/dom_position.cpp: Added.
2871         (DOMPosition::renderedOffset): New function.
2872         (DOMPosition::previousCharacterPosition): New function.
2873         (DOMPosition::nextCharacterPosition): New function.
2874         (DOMPosition::equivalentUpstreamPosition): New function.
2875         (DOMPosition::equivalentDownstreamPosition): New function.
2876         (DOMPosition::validUpstreamDownstreamPosition): New function.
2877         (DOMPosition::inRenderedContent): New function.
2878         (inlineBoxForRenderer): New function.
2879         (renderersOnDifferentLine): New function.
2880         (nextRenderedEditable): New function.
2881         (previousRenderedEditable): New function.
2882         (DOMPosition::inRenderedText): New function.
2883         (DOMPosition::rendersOnSameLine): New function.
2884         (DOMPosition::rendersInDifferentPosition): New function.
2885         (DOMPosition::isFirstRenderedPositionOnLine): New function.
2886         (DOMPosition::isLastRenderedPositionOnLine): New function.
2887         (DOMPosition::isLastRenderedPositionInEditableBlock): New function.
2888         (DOMPosition::inFirstEditableInRootEditableBlock): New function.
2889         (DOMPosition::inLastEditableInRootEditableBlock): New function.
2890         (DOMPosition::inFirstEditableInContainingEditableBlock): New function.
2891         (DOMPosition::inLastEditableInContainingEditableBlock): New function.
2892         * khtml/xml/dom_position.h: Added.
2893         (DOM::DOMPosition::notEmpty): New function.
2894         * khtml/xml/dom_stringimpl.cpp:
2895         (DOM::DOMStringImpl::containsOnlyWhitespace): Added a version which takes an offset and length.
2896         * khtml/xml/dom_stringimpl.h:
2897         * khtml/xml/dom_textimpl.cpp:
2898         (CharacterDataImpl::containsOnlyWhitespace): As above
2899         (CharacterDataImpl::maxOffset): New function.
2900         (CharacterDataImpl::caretMaxRenderedOffset): New function.
2901         (TextImpl::TextImpl):
2902         (TextImpl::rendererIsNeeded): A new bit. When set, makes a text renderer unconditionally.
2903         * khtml/xml/dom_textimpl.h:
2904         (DOM::TextImpl::setRendererIsNeeded): Sets the bit.
2905         * kwq/KWQAssertions.m:
2906         (KWQLog): Change to decrease the amount of output for the Editing log level. (my preference)
2907
2908 2004-03-31  David Hyatt  <hyatt@apple.com>
2909
2910         Fix for 3601834, make sure that textareas do a layout when their rows/cols/wrap attributes are dynamically
2911         changed.
2912         
2913         Reviewed by darin.
2914
2915         * khtml/html/html_formimpl.cpp:
2916         (HTMLTextAreaElementImpl::parseHTMLAttribute):
2917
2918 2004-03-30  David Hyatt  <hyatt@apple.com>
2919
2920         Fix for 3604241, simple space collapsing results in a doubled character.  Simplify the ignoring of
2921         whitespace and make sure it works across absolutely positioned spans.
2922         
2923         Reviewed by darin
2924
2925         * khtml/rendering/bidi.cpp:
2926         (khtml::RenderBlock::findNextLineBreak):
2927
2928 2004-03-30  Darin Adler  <darin@apple.com>
2929
2930         Reviewed by Dave.
2931
2932         - fixed <rdar://problem/3570877>: REGRESSION: onfocus handler not working at weather.com
2933
2934         * khtml/ecma/kjs_binding.cpp:
2935         (UString::string): Turn a null UString into a null DOMString, but a non-null empty UString into a
2936         non-null empty DOMString.
2937         (UString::qstring): Ditto, for QString.
2938         (Identifier::string): Ditto, for Identifier.
2939         (Identifier::qstring): Ditto.
2940
2941         * kwq/KWQLineEdit.h: Override focusPolicy.
2942         * kwq/KWQLineEdit.mm: (QLineEdit::focusPolicy): Return StrongFocus instead of TabFocus, since
2943         we allow clicking to focus on these widgets.
2944         * kwq/KWQTextEdit.h: More of the same.
2945         * kwq/KWQTextEdit.mm: (QTextEdit::focusPolicy): And still more.
2946
2947         - fixed <rdar://problem/3605919>: text fields in web pages are too tall
2948
2949         * kwq/KWQTextField.mm:
2950         (-[KWQTextFieldCell _typesetterBehavior]): Ignore the per-application typesetter setting and
2951         instead always use the latest behavior for text fields in web pages.
2952         (-[KWQSecureTextFieldCell _typesetterBehavior]): Ditto.
2953         (-[KWQSearchFieldCell _typesetterBehavior]): Ditto.
2954
2955         - additional cleanup
2956
2957         * khtml/html/html_formimpl.cpp:
2958         (HTMLGenericFormElementImpl::isKeyboardFocusable): Check tab focus bit instead of different modes.
2959         (HTMLGenericFormElementImpl::isMouseFocusable): Check click focus bit instead of different modes.
2960
2961 2004-03-30  David Hyatt  <hyatt@apple.com>
2962
2963         Fix for 3603326, spurious line breaks in encyclopedia articles.  Make sure makeChildrenNonInline knows to
2964         skip over floating/positioned elements so that they remain part of contiguous inline runs for static positioning
2965         purposes.
2966         
2967         Reviewed by darin
2968
2969         * khtml/rendering/render_block.cpp:
2970         (khtml::getInlineRun):
2971
2972 2004-03-30  Darin Adler  <darin@apple.com>
2973
2974         Reviewed by Ken.
2975
2976         - fixed garbage characters seen while I was rigging up the Mozilla JavaScript tests
2977
2978         * kwq/KWQString.h: Add a "move constructor" for KWQStringData that extracts the data
2979         from an existing KWQStringData.
2980         * kwq/KWQString.mm:
2981         (KWQStringData::KWQStringData): Implement the move constructor.
2982         (QString::detachInternal): Use the move constructor rather than making a copy of the
2983         data. Should be both more efficient and preserves both the Unicode and the ASCII. The
2984         bug here is that TokenizerSubstring relies on the Unicode staying around. We still
2985         have a problem in the case where the Unicode is inside the KWQStringData. To deal with
2986         that we'll have to add a new QString call that TokenizerSubstring can use. The new call
2987         will force QString to keep the Unicode outside the internal KWQStringData.
2988
2989 2004-03-30  Darin Adler  <darin@apple.com>
2990
2991         Reviewed by Ken.
2992
2993         - fixed <rdar://problem/3606146>: repro nil-deref in QWidget::move (www.stoltoffshore.com)
2994
2995         * khtml/khtml_part.cpp:
2996         (KHTMLPart::requestObject): Add check for NULL widget.
2997         (KHTMLPart::processObjectRequest): Add check for NULL widget.
2998
2999 2004-03-29  David Hyatt  <hyatt@apple.com>
3000
3001         Make sure "auto" is allowed as a valid value when parsing rect shapes (e.g., for the clip property).
3002         
3003         Reviewed by rjw
3004
3005         * khtml/css/cssparser.cpp:
3006         (CSSParser::parseShape):
3007
3008 2004-03-29  David Hyatt  <hyatt@apple.com>
3009
3010         Followup fix.  Handle the case where a hard line break occurs right after a soft hyphen.  In this
3011         case we were losing a letter of the word in addition to not rendering the soft hyphen.
3012         
3013         Reviewed by kocienda
3014
3015         * khtml/rendering/bidi.cpp:
3016         (khtml::checkMidpoints):
3017
3018 2004-03-29  David Hyatt  <hyatt@apple.com>
3019
3020         Fix for 3604154, support soft hyphens when rendering.  This patch implements soft hyphen support that
3021         matches IE6 on Windows and Opera 7.  Soft hyphens that don't break lines end up getting collapsed away.
3022         Only if the hyphen breaks a line does it render.
3023         
3024         Reviewed by kocienda
3025
3026         * khtml/rendering/bidi.cpp:
3027         (khtml::chopMidpointsAt):
3028         (khtml::appendRunsForObject):
3029         (khtml::RenderBlock::findNextLineBreak):
3030         * khtml/rendering/render_text.cpp:
3031         (RenderText::calcMinMaxWidth):
3032
3033 2004-03-29  John Sullivan  <sullivan@apple.com>
3034
3035         Made menu shortcuts work again when editing HTML
3036
3037         Reviewed by Darin.
3038
3039         * khtml/xml/dom_elementimpl.cpp:
3040         (ElementImpl::defaultEventHandler):
3041         Don't treat key events with command key down as
3042         editing events.
3043
3044 2004-03-28  Darin Adler  <darin@apple.com>
3045
3046         Reviewed by John.
3047
3048         - fixed <rdar://problem/3602202>: "feed:uuid:...." links in Emerson content are being changed into "feed:uuuid:...."
3049
3050         * kwq/KWQKURL.mm: (copyPathRemovingDots): Add special case for empty path. The old code had an
3051         assertion that explicitly allowed this case, but it copied a character from the src buffer,
3052         which was incorrect.
3053
3054 2004-03-26  David Hyatt  <hyatt@apple.com>
3055
3056         Fix for 3600642, letter magnet demo doesn't update until mouse move.  This patch also fixes problems
3057         with the animated text Gecko DOM demos on developer.netscape.com.  Make sure that timer callbacks via
3058         setTimeout always updateRendering after executing the JS code.
3059         
3060         Reviewed by darin
3061
3062         * khtml/ecma/kjs_window.cpp:
3063         (ScheduledAction::execute):
3064
3065 === Safari-134 ===
3066
3067 2004-03-25  David Hyatt  <hyatt@apple.com>
3068
3069         Implement the rest of the search field.  Make it work with form submission.  Implement onscroll at
3070         the document level.
3071         
3072         Reviewed by darin
3073
3074         * khtml/html/html_formimpl.cpp:
3075         (HTMLFormElementImpl::submit):
3076         * khtml/rendering/render_form.cpp:
3077         (RenderLineEdit::addSearchResult):
3078         * khtml/rendering/render_form.h:
3079         * kwq/KWQKHTMLPart.h:
3080         * kwq/KWQKHTMLPart.mm:
3081         (KWQKHTMLPart::sendScrollEvent):
3082         * kwq/KWQLineEdit.h:
3083         * kwq/KWQLineEdit.mm:
3084         (QLineEdit::setMaxResults):
3085         (QLineEdit::setPlaceholderString):
3086         (QLineEdit::addSearchResult):
3087         * kwq/WebCoreBridge.h:
3088         * kwq/WebCoreBridge.mm:
3089         (-[WebCoreBridge sendScrollEvent]):
3090         * kwq/WebCoreViewFactory.h:
3091
3092 2004-03-25  David Hyatt  <hyatt@apple.com>
3093
3094         Fix for 3570700, crash in inlineBox::isDirty.  Make sure line boxes null out parent pointers when those
3095         parents get deleted.  r=john
3096
3097         Fix for .value not being settable on selects.  r=darin
3098         
3099         * khtml/html/html_formimpl.cpp:
3100         (HTMLSelectElementImpl::setValue):
3101         * khtml/rendering/render_block.cpp:
3102         (khtml::RenderBlock::removeChildrenFromLineBoxes):
3103         (khtml::RenderBlock::removeChild):
3104         * khtml/rendering/render_block.h:
3105         * khtml/rendering/render_line.cpp:
3106         (InlineFlowBox::removeChild):
3107         
3108 2004-03-25  Darin Adler  <darin@apple.com>
3109
3110         Fix by Kristin Webster, reviewed by me.
3111
3112         - fixed <rdar://problem/3582431>: HiDPI - Form elements not working when scaling factor != 1.0
3113
3114         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Pass nil for fromView
3115         rather than passing the top level view.
3116
3117 2004-03-24  Darin Adler  <darin@apple.com>
3118
3119         Reviewed by John.
3120
3121         - fixed <rdar://problem/3566805>: REGRESSION: When the subject of mailto is 2 byte Safari failed to send mail address and subject to Mail.app
3122
3123         * kwq/KWQKURL.mm: (KURL::findHostnamesInMailToURL): Update to handle hostnames that end just before
3124         a '?' since a '?' ends the entire part of the URL that can contain hostnames. Also change the logic so
3125         that the '?' will successfully end the search.
3126
3127 2004-03-24  Darin Adler  <darin@apple.com>
3128
3129         Reviewed by John.
3130
3131         - fixed <rdar://problem/3599650>: main image missing due to incorrect relative URL resolution at www.brother.com
3132
3133         * kwq/KWQKURL.mm: (KURL::KURL): Implement compatibility rule from the URI RFC.
3134         If a URL has a scheme, but does not start with the "/" character, and the scheme
3135         matches the base URL, then treat it as a relative URL.
3136
3137 2004-03-24  Ken Kocienda  <kocienda@apple.com>
3138
3139         Reviewed by me.
3140
3141         I neglected to check in these required changes when I landed previously.
3142         This is what I get for trying to commit when I had other changes in
3143         my tree.
3144
3145         * khtml/dom/html_form.cpp:
3146         (HTMLSelectElement::add): Uses new-style call.
3147         * khtml/html/html_formimpl.cpp:
3148         (HTMLSelectElementImpl::add): Change the interface for this call to use
3149         impl objects instead of API objects. This works around the fact that the
3150         API object's constructor that takes an impl is protected.
3151         * khtml/html/html_formimpl.h: Uses new-style call.
3152
3153 2004-03-24  Ken Kocienda <kocienda@apple.com>
3154
3155         Implemented the remainder of the HTML DOM API.
3156     
3157         Reviewed by Chris.
3158     
3159         * kwq/DOMHTML.h
3160         * kwq/HTMLDOM.mm
3161
3162 2004-03-23  David Hyatt  <hyatt@apple.com>
3163
3164         Fix for 3487207, implement onscroll DOM event for elements with overflow:auto/scroll/hidden.  This does
3165         not handle firing onscroll on the window when the document scrolls, nor does it handle firing onscroll
3166         on textareas.  These are two separate bugs.
3167
3168         This patch finishes stubbing out the onscroll event and adds support for it to the DOM.  It also supports
3169         the firing of the event when overflow blocks scroll.
3170         
3171         Reviewed by darin
3172
3173         * khtml/ecma/kjs_dom.cpp:
3174         (DOMNode::getValueProperty):
3175         (DOMNode::putValue):
3176         * khtml/ecma/kjs_dom.h:
3177         (KJS::DOMNode::):
3178         * khtml/ecma/kjs_dom.lut.h:
3179         (KJS::):
3180         * khtml/ecma/kjs_window.cpp:
3181         (Window::get):
3182         (Window::put):
3183         * khtml/ecma/kjs_window.h:
3184         (KJS::Window::):
3185         * khtml/ecma/kjs_window.lut.h:
3186         (KJS::):
3187         * khtml/html/html_baseimpl.cpp:
3188         (HTMLBodyElementImpl::parseHTMLAttribute):
3189         * khtml/html/html_elementimpl.cpp:
3190         (HTMLElementImpl::parseHTMLAttribute):
3191         * khtml/misc/htmlattrs.c:
3192         (hash_attr):
3193         (findAttr):
3194         * khtml/misc/htmlattrs.h:
3195         * khtml/misc/htmlattrs.in:
3196         * khtml/rendering/render_layer.cpp:
3197         (RenderLayer::scrollToOffset):
3198
3199 2004-03-23  David Hyatt  <hyatt@apple.com>
3200
3201         Fix for 3513627, HTML mail prints upside down occasionally.  Change printing so that it never resizes the
3202         WebHTMLView when formatting for printing.  When computing page rects, instead of using the view's bounds,
3203         use the root layer's width instead.
3204
3205         Reviewed by darin
3206
3207         * khtml/khtmlview.cpp:
3208         (KHTMLView::layout):
3209         * kwq/WebCoreBridge.h:
3210         * kwq/WebCoreBridge.mm:
3211         (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
3212
3213 2004-03-23  David Hyatt  <hyatt@apple.com>
3214
3215         Fix for crasher 3598204, previousKeyView was calling nextKeyView instead.
3216         
3217         Reviewed by darin
3218
3219         * kwq/KWQTextField.mm:
3220         (-[KWQTextField previousKeyView]):
3221         (-[KWQSecureTextField previousKeyView]):
3222         (-[KWQSearchField previousKeyView]):
3223
3224 2004-03-23  Darin Adler  <darin@apple.com>
3225
3226         Reviewed by Vicki.
3227
3228         - fixed deployment build
3229
3230 2004-03-22  David Hyatt  <hyatt@apple.com>
3231
3232         Wire up NSSearchField to WebCore.  Add support for placeholder strings, autosaving of recent items, the ability to show/hide
3233         the magnifying glass search button, the ability to specify the maximum number of results, the ability to specify an incremental
3234         search or not, etc.  Added a DOM event that fires when the search field indicates that search results should be updated.
3235         
3236         Reviewed by darin
3237
3238         * khtml/ecma/kjs_dom.cpp:
3239         (DOMNode::getValueProperty):
3240         (DOMNode::putValue):
3241         * khtml/ecma/kjs_dom.h:
3242         (KJS::DOMNode::):
3243         * khtml/ecma/kjs_dom.lut.h:
3244         (KJS::):
3245         * khtml/ecma/kjs_window.cpp:
3246         (Window::get):
3247         (Window::put):
3248         * khtml/ecma/kjs_window.h:
3249         (KJS::Window::):
3250         * khtml/ecma/kjs_window.lut.h:
3251         (KJS::):
3252         * khtml/html/html_formimpl.cpp:
3253         (HTMLInputElementImpl::parseHTMLAttribute):
3254         * khtml/html/html_formimpl.h:
3255         (DOM::HTMLInputElementImpl::maxResults):
3256         * khtml/misc/htmlattrs.c:
3257         (hash_attr):
3258         (findAttr):
3259         * khtml/misc/htmlattrs.h:
3260         * khtml/misc/htmlattrs.in:
3261         * khtml/rendering/render_form.cpp:
3262         (RenderLineEdit::RenderLineEdit):
3263         (RenderLineEdit::slotPerformSearch):
3264         (RenderLineEdit::updateFromElement):
3265         * khtml/rendering/render_form.h:
3266         * khtml/xml/dom2_eventsimpl.cpp:
3267         (EventImpl::typeToId):
3268         (EventImpl::idToType):
3269         * khtml/xml/dom2_eventsimpl.h:
3270         (DOM::EventImpl::):
3271         * kwq/KWQLineEdit.h:
3272         (QLineEdit::performSearch):
3273         (QLineEdit::type):
3274         * kwq/KWQLineEdit.mm:
3275         (QLineEdit::QLineEdit):
3276         (QLineEdit::setLiveSearch):
3277         (QLineEdit::setAutoSaveName):
3278         (QLineEdit::setMaxResults):
3279         (QLineEdit::setPlaceholderString):
3280         * kwq/KWQSlot.mm:
3281         (KWQSlot::KWQSlot):
3282         (KWQSlot::call):
3283         * kwq/KWQTextField.mm:
3284         (-[KWQTextFieldController initWithTextField:QLineEdit:]):
3285         (-[KWQTextFieldController invalidate]):
3286         (-[KWQTextFieldController action:]):
3287         (-[KWQTextFieldController controlTextDidBeginEditing:]):
3288         (-[KWQTextFieldController controlTextDidEndEditing:]):
3289         (-[KWQTextFieldController controlTextDidChange:]):
3290         (-[KWQTextFieldController control:textShouldBeginEditing:]):
3291         (-[KWQTextFieldController control:textShouldEndEditing:]):
3292         (-[KWQTextFieldController control:didFailToFormatString:errorDescription:]):
3293         (-[KWQTextFieldController control:didFailToValidatePartialString:errorDescription:]):
3294         (-[KWQTextFieldController control:isValidObject:]):
3295         (-[KWQTextFieldController control:textView:doCommandBySelector:]):
3296         (-[KWQTextFieldController textChanged]):
3297
3298 2004-03-22  David Hyatt  <hyatt@apple.com>
3299
3300         Factoring of form control code to enable sharing between three types of text fields: normal, password, and
3301         the new search field.  Also made search field creatable using <input type="search">.  There are still many
3302         bugs with the field, but you can at least type in it and submit it with a form.
3303         
3304         Reviewed by darin
3305
3306         * khtml/html/html_formimpl.cpp:
3307         (HTMLInputElementImpl::setType):
3308         (HTMLInputElementImpl::type):
3309         (HTMLInputElementImpl::click):
3310         (HTMLInputElementImpl::accessKeyAction):
3311         (HTMLInputElementImpl::rendererIsNeeded):
3312         (HTMLInputElementImpl::createRenderer):
3313         (HTMLInputElementImpl::encoding):
3314         (HTMLInputElementImpl::defaultEventHandler):
3315         (HTMLInputElementImpl::isEditable):
3316         * khtml/html/html_formimpl.h:
3317         (DOM::HTMLInputElementImpl::):
3318         * khtml/rendering/render_form.cpp:
3319         (RenderLineEdit::RenderLineEdit):
3320         * kwq/KWQKLineEdit.h:
3321         (KLineEdit::KLineEdit):
3322         * kwq/KWQLineEdit.h:
3323         (QLineEdit::):
3324         * kwq/KWQLineEdit.mm:
3325         (QLineEdit::QLineEdit):
3326         (QLineEdit::~QLineEdit):
3327         (QLineEdit::setFont):
3328         (QLineEdit::setText):
3329         (QLineEdit::text):
3330         (QLineEdit::setMaxLength):
3331         (QLineEdit::isReadOnly):
3332         (QLineEdit::setReadOnly):
3333         (QLineEdit::maxLength):
3334         (QLineEdit::selectAll):
3335         (QLineEdit::edited):
3336         (QLineEdit::setEdited):
3337         (QLineEdit::sizeForCharacterWidth):
3338         (QLineEdit::baselinePosition):
3339         (QLineEdit::setAlignment):
3340         (QLineEdit::setWritingDirection):
3341         (KWQNSTextAlignmentForAlignmentFlags):
3342         (QLineEdit::setLiveSearch):
3343         * kwq/KWQTextField.h:
3344         * kwq/KWQTextField.mm:
3345         (-[KWQTextFieldController initWithTextField:QLineEdit:]):
3346         (-[KWQTextFieldController action:]):
3347         (-[KWQTextFieldController dealloc]):
3348         (-[KWQTextFieldController widget]):
3349         (-[KWQTextFieldController setMaximumLength:]):
3350         (-[KWQTextFieldController controlTextDidBeginEditing:]):
3351         (-[KWQTextFieldController controlTextDidEndEditing:]):
3352         (-[KWQTextFieldController controlTextDidChange:]):
3353         (-[KWQTextFieldController control:textShouldBeginEditing:]):
3354         (-[KWQTextFieldController control:textShouldEndEditing:]):
3355         (-[KWQTextFieldController control:didFailToFormatString:errorDescription:]):
3356         (-[KWQTextFieldController control:didFailToValidatePartialString:errorDescription:]):
3357         (-[KWQTextFieldController control:isValidObject:]):
3358         (-[KWQTextFieldController control:textView:doCommandBySelector:]):
3359         (-[KWQTextFieldController textChanged]):
3360         (-[KWQTextFieldController setInDrawingMachinery:]):
3361         (-[KWQTextFieldController textView:shouldDrawInsertionPointInRect:color:turnedOn:]):
3362         (-[KWQTextFieldController textView:shouldHandleEvent:]):
3363         (-[KWQTextFieldController textView:didHandleEvent:]):
3364         (-[KWQTextFieldController setBaseWritingDirection:]):
3365         (-[KWQTextFieldController baseWritingDirection]):
3366         (-[KWQTextFieldController selectedRange]):