Bug #: 3824
[WebKit-https.git] / WebCore / ChangeLog-2005-08-23
1 2005-07-03  Eric Seidel  <eseidel@apple.com>
2
3         Reviewed by mjs.
4
5         * ForwardingHeaders/qpair.h: Added.
6         * kwq/KWQPair.h: Added.
7         Qt compatible QPair, built on std::pair
8         http://bugzilla.opendarwin.org/show_bug.cgi?id=3824
9
10 2005-07-01  Beth Dakin  <bdakin@apple.com>
11
12         Adding createCaption test for HTMLTableElement.
13
14         Reviewed by Adele (sort of).
15
16         Test cases added:
17
18         * layout-tests/fast/dom/HTMLTableElement/createCaption-expected.txt: Added.
19         * layout-tests/fast/dom/HTMLTableElement/createCaption.html: Added.
20
21 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
22
23         Moving dom tests around to conform to new directory structure
24         specified in today's meeting.
25
26         Reviewed by justing.
27
28         Test cases added: 
29
30         * layout-tests/fast/dom/HTMLDocument/title-get-expected.txt: Added.
31         * layout-tests/fast/dom/HTMLDocument/title-get.html: Added.
32         * layout-tests/fast/dom/HTMLDocument/title-set-expected.txt: Added.
33         * layout-tests/fast/dom/HTMLDocument/title-set.html: Added.
34         * layout-tests/fast/dom/HTMLDocument/title/get-expected.txt: Removed.
35         * layout-tests/fast/dom/HTMLDocument/title/get.html: Removed.
36         * layout-tests/fast/dom/HTMLDocument/title/set-expected.txt: Removed.
37         * layout-tests/fast/dom/HTMLDocument/title/set.html: Removed.
38         * layout-tests/fast/dom/HTMLDocument/url-getset-expected.txt: Added.
39         * layout-tests/fast/dom/HTMLDocument/url-getset.html: Added.
40         * layout-tests/fast/dom/HTMLDocument/url/getset-expected.txt: Removed.
41         * layout-tests/fast/dom/HTMLDocument/url/getset.html: Removed.
42         * layout-tests/fast/dom/HTMLDocument/write-call-expected.txt: Added.
43         * layout-tests/fast/dom/HTMLDocument/write-call.html: Added.
44         * layout-tests/fast/dom/HTMLDocument/write-multiple-calls-expected.txt: Added.
45         * layout-tests/fast/dom/HTMLDocument/write-multiple-calls.html: Added.
46         * layout-tests/fast/dom/HTMLDocument/write/call-expected.txt: Removed.
47         * layout-tests/fast/dom/HTMLDocument/write/call.html: Removed.
48         * layout-tests/fast/dom/HTMLDocument/write/multiple-calls-expected.txt: Removed.
49         * layout-tests/fast/dom/HTMLDocument/write/multiple-calls.html: Removed.
50         * layout-tests/fast/dom/HTMLDocument/writeln-call-expected.txt: Added.
51         * layout-tests/fast/dom/HTMLDocument/writeln-call.html: Added.
52         * layout-tests/fast/dom/HTMLDocument/writeln-multiple-calls-expected.txt: Added.
53         * layout-tests/fast/dom/HTMLDocument/writeln-multiple-calls.html: Added.
54         * layout-tests/fast/dom/HTMLDocument/writeln/call-expected.txt: Removed.
55         * layout-tests/fast/dom/HTMLDocument/writeln/call.html: Removed.
56         * layout-tests/fast/dom/HTMLDocument/writeln/multiple-calls-expected.txt: Removed.
57         * layout-tests/fast/dom/HTMLDocument/writeln/multiple-calls.html: Removed.
58
59 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
60
61         -landed patch by Eric Seidel <macdome@opendarwin.org>
62         
63         -for http://bugzilla.opendarwin.org/show_bug.cgi?id=3657
64         GroundWork:  Moving some functions from khtml->jsc following kjs TOT
65         
66         - no layout test necessary yet - only groundwork
67
68         Reviewed by darin.
69
70         * ForwardingHeaders/qintdict.h:
71         * khtml/ecma/kjs_binding.h:
72
73 2005-07-01  Geoffrey Garen  <ggaren@apple.com>
74
75         -landed patch by Carsten Guenther <cguenther@gmail.com>
76         http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
77
78         -corrects errors in date layout test
79
80         Reviewed by darin.
81
82         Test cases modified:
83         * layout-tests/fast/js/date-parse-test.html:
84
85 2005-07-01  Eric Seidel  <eseidel@apple.com>
86
87         Reviewed by darin.
88
89         * kwq/KWQSize.h:
90         * kwq/KWQSize.mm:
91         (QSize::operator CGSize): adding CGSize conversion support
92         http://bugzilla.opendarwin.org/show_bug.cgi?id=3669
93
94 2005-06-30  Bruce DiBello  <bdibello@apple.com>
95
96         Reviewed by Geoff Garen.
97
98         Test cases added: getting and setting div.align
99
100         * layout-tests/fast/dom/HTMLDivElement/align/getset-expected.txt: Added.
101         * layout-tests/fast/dom/HTMLDivElement/align/getset.html: Added.
102
103 2005-06-29  Anders Carlsson  <andersca@mac.com>
104
105         Reviewed and landed by Darin Adler.
106
107         - Fix <http://bugzilla.opendarwin.org/show_bug.cgi?id=3274>
108         document() not supported
109
110         Test cases added:
111         * layout-tests/fast/xsl/document-function-expected.txt: Added.
112         * layout-tests/fast/xsl/document-function.xml: Added.
113         * layout-tests/fast/xsl/document-function.xsl: Added.
114         * layout-tests/fast/xsl/resources/document-function-source.xml: Added.
115         
116         * khtml/xsl/xslt_processorimpl.cpp:
117         (DOM::parseErrorFunc):
118         Stub to prevent errors from getting written to the console.
119         
120         (DOM::stylesheetLoadFunc):
121         Fetch and parse documents.
122         
123         (DOM::XSLTProcessorImpl::transformDocument):
124         Use the processor as the global variable instead of the 
125         style sheet.
126         
127         * khtml/xsl/xslt_processorimpl.h:
128         (DOM::XSLTProcessorImpl::stylesheet):
129         (DOM::XSLTProcessorImpl::sourceDocument):
130         Add accessors for source document and stylesheet.
131
132 2005-06-29  Maciej Stachowiak  <mjs@apple.com>
133
134         Unreviewed - fixing build breakage with gcc 4.
135
136         * khtml/misc/hashtable.h: Don't use a typedef when declaring a class friend.
137
138 2005-06-29  David Harrison  <harrison@apple.com>
139
140         Temporarily enable tab coalescing ahead of white-space:pre-wrap
141         change because of problems with keeping the tabs separate.  Will
142         revert when problems are fixed or remove if I do pre-wrap
143         first.
144
145         * khtml/editing/insert_text_command.cpp:
146         (khtml::InsertTextCommand::prepareForTextInsertion):
147         (khtml::InsertTextCommand::insertTab):
148         * khtml/editing/markup.cpp:
149         (khtml::createParagraphContentsFromString):
150
151 2005-06-29  David Harrison  <harrison@apple.com>
152
153         Reviewed by Dave Hyatt (rendering) and Maciej (editing).
154
155         Test cases added:  Coming soon.  Will include with next round of changes for this bug.
156
157         This is the first checkin for...
158         
159         <rdar://problem/3792529> REGRESSION (Mail): Tabs do not work the way they did in Panther (especially useful in plain text mail)
160         
161         Basic strategy is to put tabs into spans with white-space:pre style, and
162         render them with tabs stops every 8th space, where the space width and
163         the left margin are those of the enclosing block.
164         
165         What's left is to switch to implement white-space:pre-wrap so
166         that we can coalesce consecutive tabs while maintaining proper
167         line breaking.  That will keep the markup smaller.
168
169         * khtml/editing/apply_style_command.cpp:
170         (khtml::createStyleSpanElement):
171         (khtml::ApplyStyleCommand::removeCSSStyle):
172         (khtml::ApplyStyleCommand::addInlineStyleIfNeeded):
173         * khtml/editing/delete_selection_command.cpp:
174         (khtml::DeleteSelectionCommand::saveTypingStyleState):
175         * khtml/editing/edit_command.cpp:
176         (khtml::EditCommand::styleAtPosition):
177         * khtml/editing/html_interchange.h:
178         * khtml/editing/htmlediting.cpp:
179         (khtml::isSpecialElement):
180         (khtml::isTabSpanNode):
181         (khtml::isTabSpanTextNode):
182         (khtml::positionBeforeTabSpan):
183         (khtml::createTabSpanElement):
184         * khtml/editing/htmlediting.h:
185         * khtml/editing/insert_text_command.cpp:
186         (khtml::InsertTextCommand::prepareForTextInsertion):
187         (khtml::InsertTextCommand::input):
188         (khtml::InsertTextCommand::insertTab):
189         * khtml/editing/insert_text_command.h:
190         * khtml/editing/markup.cpp:
191         (khtml::createParagraphContentsFromString):
192         (khtml::createFragmentFromText):
193         * khtml/editing/replace_selection_command.cpp:
194         (khtml::ReplacementFragment::removeStyleNodes):
195         * khtml/html/htmltokenizer.cpp:
196         (khtml::HTMLTokenizer::begin):
197         (khtml::HTMLTokenizer::processListing):
198         (khtml::HTMLTokenizer::parseEntity):
199         (khtml::HTMLTokenizer::parseTag):
200         (khtml::HTMLTokenizer::addPending):
201         (khtml::HTMLTokenizer::write):
202         * khtml/html/htmltokenizer.h:
203         (khtml::HTMLTokenizer::):
204         * khtml/rendering/bidi.cpp:
205         (khtml::addRun):
206         (khtml::RenderBlock::tabWidth):
207         (khtml::RenderBlock::computeHorizontalPositionsForLine):
208         (khtml::RenderBlock::skipWhitespace):
209         (khtml::RenderBlock::findNextLineBreak):
210         (khtml::RenderBlock::checkLinesForTextOverflow):
211         * khtml/rendering/break_lines.cpp:
212         (khtml::isBreakable):
213         * khtml/rendering/font.cpp:
214         (Font::drawHighlightForText):
215         (Font::drawText):
216         (Font::floatWidth):
217         (Font::floatCharacterWidths):
218         (Font::checkSelectionPoint):
219         (Font::width):
220         * khtml/rendering/font.h:
221         * khtml/rendering/render_block.cpp:
222         (khtml::stripTrailingSpace):
223         (khtml::RenderBlock::calcInlineMinMaxWidth):
224         * khtml/rendering/render_block.h:
225         * khtml/rendering/render_br.h:
226         (khtml::RenderBR::width):
227         * khtml/rendering/render_flexbox.cpp:
228         (khtml::RenderFlexibleBox::layoutVerticalBox):
229         * khtml/rendering/render_image.cpp:
230         (RenderImage::setPixmap):
231         (RenderImage::paint):
232         * khtml/rendering/render_line.cpp:
233         (khtml::EllipsisBox::paint):
234         * khtml/rendering/render_line.h:
235         (khtml::InlineBox::width):
236         (khtml::InlineBox::xPos):
237         (khtml::InlineBox::yPos):
238         (khtml::InlineBox::height):
239         (khtml::InlineBox::baseline):
240         * khtml/rendering/render_list.cpp:
241         (RenderListMarker::paint):
242         (RenderListMarker::calcMinMaxWidth):
243         * khtml/rendering/render_object.cpp:
244         (RenderObject::tabWidth):
245         (RenderObject::recalcMinMaxWidths):
246         * khtml/rendering/render_object.h:
247         * khtml/rendering/render_replaced.cpp:
248         * khtml/rendering/render_text.cpp:
249         (InlineTextBox::selectionRect):
250         (InlineTextBox::paint):
251         (InlineTextBox::paintSelection):
252         (InlineTextBox::paintMarkedTextBackground):
253         (InlineTextBox::textPos):
254         (InlineTextBox::offsetForPosition):
255         (InlineTextBox::positionForOffset):
256         (RenderText::cacheWidths):
257         (RenderText::widthFromCache):
258         (RenderText::trimmedMinMaxWidth):
259         (RenderText::calcMinMaxWidth):
260         (RenderText::containsOnlyWhitespace):
261         (RenderText::width):
262         * khtml/rendering/render_text.h:
263         * kwq/KWQFontMetrics.h:
264         * kwq/KWQFontMetrics.mm:
265         (QFontMetrics::width):
266         (QFontMetrics::charWidth):
267         (QFontMetrics::floatWidth):
268         (QFontMetrics::floatCharacterWidths):
269         (QFontMetrics::checkSelectionPoint):
270         (QFontMetrics::boundingRect):
271         (QFontMetrics::size):
272         * kwq/KWQPainter.h:
273         * kwq/KWQPainter.mm:
274         (QPainter::drawText):
275         (QPainter::drawHighlightForText):
276         * kwq/WebCoreTextRenderer.h:
277         * kwq/WebCoreTextRendererFactory.mm:
278         (WebCoreInitializeEmptyTextStyle):
279         * layout-tests/editing/deleting/delete-tab-001-expected.txt:
280         * layout-tests/editing/deleting/delete-tab-001.html:
281         * layout-tests/editing/deleting/delete-tab-002-expected.txt:
282         * layout-tests/editing/deleting/delete-tab-002.html:
283         * layout-tests/editing/deleting/delete-tab-003-expected.txt:
284         * layout-tests/editing/deleting/delete-tab-003.html:
285         * layout-tests/editing/deleting/delete-tab-004-expected.txt:
286         * layout-tests/editing/deleting/delete-tab-004.html:
287         * layout-tests/editing/inserting/insert-tab-001-expected.txt:
288         * layout-tests/editing/inserting/insert-tab-002-expected.txt:
289         * layout-tests/editing/inserting/insert-tab-003-expected.txt:
290         * layout-tests/editing/inserting/insert-tab-004-expected.txt:
291         * layout-tests/fast/dom/quadraticCurveTo-expected.txt:
292         * layout-tests/fast/js/string-replace-2-expected.txt:
293         * layout-tests/fast/table/039-expected.txt:
294         * layout-tests/fast/table/border-collapsing/004-expected.txt:
295         * layout-tests/fast/tokenizer/script_extra_close-expected.txt:
296
297 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
298
299         Contributed by Francisco Tolmasky <tolmasky@gmail.com>
300
301         -test cases for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=3667
302         Core JavaScript 1.5 Reference:Objects:Array:forEach
303
304         See JavaScriptCore Changelog for details on the patch.
305
306         Reviewed by darin.
307
308         Test cases added:
309         * layout-tests/fast/js/array-every-expected.txt: Added.
310         * layout-tests/fast/js/array-every.html: Added.
311         * layout-tests/fast/js/array-foreach-expected.txt: Added.
312         * layout-tests/fast/js/array-foreach.html: Added.
313         * layout-tests/fast/js/array-some-expected.txt: Added.
314         * layout-tests/fast/js/array-some.html: Added.
315
316 2005-06-29  Bruce DiBello  <bdibello@apple.com>
317
318         Reviewed by Geoff Garen
319
320         Test cases added: added expected results for previous check in
321
322         * layout-tests/fast/dom/HTMLDocument/url/getset-expected.txt: Added.
323
324 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
325
326         DOM compatibility tests for HTMLDocument::writeln
327
328         Reviewed by justing.
329
330         Test cases added: 
331
332         * layout-tests/fast/dom/HTMLDocument/writeln/call-expected.txt: Added.
333         * layout-tests/fast/dom/HTMLDocument/writeln/call.html: Added.
334         * layout-tests/fast/dom/HTMLDocument/writeln/multiple-calls-expected.txt: Added.
335         * layout-tests/fast/dom/HTMLDocument/writeln/multiple-calls.html: Added.
336
337 2005-06-29  Bruce DiBello  <bdibello@apple.com>
338
339         Reviewed by Geoff Garen.
340
341         Test cases added: added DOM test for document.URL
342
343         * layout-tests/fast/dom/HTMLDocument/url/getset.html: Added.
344
345 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
346
347         DOM compatibility tests for HTMLDocument::write
348
349         Reviewed by justing.
350
351         Test cases added: 
352         * layout-tests/fast/dom/HTMLDocument/write/call-expected.txt: Added.
353         * layout-tests/fast/dom/HTMLDocument/write/call.html: Added.
354         * layout-tests/fast/dom/HTMLDocument/write/multiple-calls-expected.txt: Added.
355         * layout-tests/fast/dom/HTMLDocument/write/multiple-calls.html: Added.
356
357 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
358
359         DOM compatibility tests for HTMLDocument::title
360
361         Reviewed by justing.
362
363         Test cases added: 
364         * layout-tests/fast/dom/HTMLDocument/title/get-expected.txt: Added.
365         * layout-tests/fast/dom/HTMLDocument/title/get.html: Added.
366         * layout-tests/fast/dom/HTMLDocument/title/set-expected.txt: Added.
367         * layout-tests/fast/dom/HTMLDocument/title/set.html: Added.
368
369 2005-06-28  Maciej Stachowiak  <mjs@apple.com>
370
371         Reviewed by Darin.
372
373         Added iterator support to new hashtable class, the HashSet API is
374         now essentially complete.
375
376         Added support for consistency check mode.
377
378         * khtml/misc/hashset.h:
379         (khtml::HashSet::capacity): Added
380         (khtml::HashSet::begin): Added (both const and non-const)
381         (khtml::HashSet::end): Added (both const and non-const)
382         (khtml::HashSet::insert): Made both versions return an iterator
383         (khtml::HashSet::find): Added (both const and on-const, returning appropriate iterator)
384         (khtml::HashSet::contains): Added
385         (khtml::HashSet::remove): Added version that takes an iterator argument
386         (khtml::HashSet::clear): Added
387         * khtml/misc/hashtable.h:
388         (khtml::HashTableIterator): New class with all the obvious iterator stuff.
389         (khtml::HashTableConstIterator::HashTableConstIterator): New class with all the obvious
390         const iterator stuff.
391         (khtml::HashTable::begin): Added (both const and non-consts)
392         (khtml::HashTable::end): Added (both const and non-consts)
393         (khtml::HashTable::capacity): Added
394         (khtml::HashTable::insert): Implement non-template method in terms
395         of template method.
396         (khtml::HashTable::contains): Added (implemented in terms of find)
397         (khtml::HashTable::remove): Implemented key remove in terms of find and 
398         iterator remove.
399         (khtml::HashTable::hash): Made static
400         (khtml::HashTable::equal): Made static
401         (khtml::HashTable::identityConvert): Added - no-op convert method so template insert
402         method can be implemented in terms of non-template
403         (khtml::HashTable::insert): Changed to return iterator
404         (khtml::HashTable::reinsert): Recoded to be more like the other functions
405         (khtml::HashTable::find): Added
406         (khtml::HashTable::remove): Added iterator version
407         (khtml::HashTable::clear): Added
408         * khtml/xml/dom_atomicstring.cpp:
409         (DOM::AtomicString::add): Updated to deal with the fact that insert returns an iterator
410         (khtml::HashTable::shouldExpand): New helper.
411         (khtml::HashTable::shouldShrink): ditto
412         (khtml::HashTable::makeIterator): ditto
413         (khtml::HashTable::makeConstIterator): ditto
414         (khtml::HashTable::checkConsistency): consistency check method
415         (khtml::HashTable::checkConsistencyExceptSize): consistency check method
416
417 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
418
419         -added test case for fix to http://bugzilla.opendarwin.org/show_bug.cgi?id=3743
420         Incorrect error message given for certain calls
421
422         See JavaScriptCore Changelog for details about the patch.
423
424         Reviewed by me.
425
426         Test cases added: 
427         * layout-tests/fast/js/toString-stack-overflow-expected.txt: Added.
428         * layout-tests/fast/js/toString-stack-overflow.html: Added.
429
430 2005-06-29  Justin Garcia  <justin.garcia@apple.com>
431
432         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3714>
433         HTMLLabelElement's form property isn't implemented
434
435         Patch by Anders Carlsson <andersca@mac.com>
436
437         Reviewed by Darin
438
439         Test cases added:
440         * layout-tests/fast/dom/HTMLLabelElement/properties/form-expected.txt: Added.
441         * layout-tests/fast/dom/HTMLLabelElement/properties/form.html: Added.
442         
443         * khtml/html/html_formimpl.cpp:
444         (DOM::HTMLLabelElementImpl::form):
445         Traverse upwards looking for a form element.
446
447 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
448
449         Patch by Joost de Valk <webkit@joostdevalk.nl>
450
451         - http://bugzilla.opendarwin.org/show_bug.cgi?id=3732
452         Testcase for accesskeys that will run with run-webkit-tests.
453
454         Reviewed by Darin.
455
456         Test cases added: 
457         * layout-tests/fast/forms/access-key-expected.txt: Added.
458         * layout-tests/fast/forms/access-key.html: Added.
459
460 2005-06-29  Justin Garcia  <justin.garcia@apple.com>
461
462         Patch by Anders Carlsson  <andersca@mac.com>
463
464         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3715>
465         An HTMLObjectElement's form property was always null.
466
467         Reviewed by Darin
468
469         Test cases added:
470         * layout-tests/fast/dom/htmlobject-form-expected.txt: Added.
471         * layout-tests/fast/dom/htmlobject-form.html: Added.
472
473         * khtml/html/html_objectimpl.cpp:
474         (DOM::HTMLObjectElementImpl::form):
475         Implement this function by traversing the parent nodes looking
476         for a form element.
477
478 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
479
480         Patch by Antoine Quint <ml@graougraou.com>
481
482         -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3648
483         quadraticCurveTo() method in <canvas> APIs JS bindings does not exist
484
485         Reviewed by Darin.
486
487         Test cases added: 
488         * layout-tests/fast/dom/quadraticCurveTo-expected.txt: Added.
489         * layout-tests/fast/dom/quadraticCurveTo.xml: Added.
490
491         * khtml/ecma/kjs_html.cpp:
492
493 2005-06-29  Geoffrey Garen  <ggaren@apple.com>
494
495         Patch by Hanspeter Schaub <Hanspeterschaub@mac.com>
496
497         -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3317
498         REGRESSION: CSS2: outline is applied to both <li> element 
499         and its enclosing text with context dependent selector
500
501         Reviewed by Hyatt.
502
503         Test cases added: 
504         * layout-tests/fast/css/list-outline-expected.txt: Added.
505         * layout-tests/fast/css/list-outline.html: Added.
506
507         * khtml/rendering/render_line.cpp:
508         (khtml::InlineFlowBox::paint):
509
510 2005-06-28  Vicki Murley  <vicki@apple.com>
511
512         Reviewed by Maciej.
513  
514         - fix our part of <rdar://problem/4122332> extra HTTP GET when iframe requests file 
515         already fetched by parent that should have been cached. Setting location via javascript
516         should not signal a full reload of the destination page and all its subresources.
517
518         * khtml/khtml_part.cpp:
519         (KHTMLPart::changeLocation): remove code that sets the reload flag
520
521 2005-06-28  Justin Garcia  <justin.garcia@apple.com>
522
523         Patch by Kevin Ballard <kevin@sb.org>
524
525         Reviewed by Darin
526         
527         - Fixes <http://bugzilla.opendarwin.org/show_bug.cgi?id=3654> 
528         Updating the value of a textarea wasn't saving the cursor position 
529         in a line ending-agnostic fashion.
530
531         Test cases added:
532         * layout-tests/fast/forms/cursor-position-expected.txt: Added.
533         * layout-tests/fast/forms/cursor-position.html: Added.
534
535         * kwq/KWQTextArea.mm:
536         (-[KWQTextArea getCursorPositionAsIndex:inParagraph:]):
537         (RangeOfParagraph):
538         (-[KWQTextArea setCursorPositionToIndex:inParagraph:]):
539
540 2005-06-28  Justin Garcia  <justin.garcia@apple.com>
541
542         Patch by Alexey Proskuryakov <ap@nypop.com>
543         
544         - <http://bugzilla.opendarwin.org/show_bug.cgi?id=3727>
545         When a DECODE_DEBUG preprocessor symbol is defined in khtml/misc/decoder.cpp, 
546         compilation fails because a non-existent variable "force" is used.
547
548         Reviewed by Darin
549
550         Test cases added: None required
551
552         * khtml/misc/decoder.cpp:
553         (Decoder::setEncoding):
554
555 2005-06-28  David Harrison  <harrison@apple.com>
556
557         Reviewed by Chris Blumenberg.
558
559         Test cases added: (NONE)
560         
561         (continued) <rdar://problem/4140688> assertion failure double-clicking text to select
562         Fixed my checkin from yesterday.
563
564         * khtml/rendering/render_text.cpp:
565         (InlineTextBox::paintMarkedTextBackground):
566         (InlineTextBox::positionForOffset):
567         Changed tabs to spaces.
568         
569         (RenderText::positionForCoordinates):
570         Make sure affinity is downstream when in mid-line.
571         Changed tabs to spaces.
572
573         (RenderText::caretRect):
574         (RenderText::cacheWidths):
575         (RenderText::trimmedMinMaxWidth):
576         (RenderText::minXPos):
577         (RenderText::width):
578         (RenderText::caretMaxOffset):
579         Changed tabs to spaces.
580
581         * layout-tests/editing/style/create-block-for-style-004-expected.txt:
582         Expected ending selection affinity is downstream.
583
584 2005-06-27  Maciej Stachowiak  <mjs@apple.com>
585
586         Remove accidentally committed code that breaks the build. Oops!
587
588         * khtml/xml/dom_atomicstring.cpp:
589         (DOM::AtomicString::expand):
590         (DOM::AtomicString::shrink):
591
592 2005-06-26  Maciej Stachowiak  <mjs@apple.com>
593
594         Reviewed by Darin.
595
596         - replaced all our hash functions with the state of the art in hashing
597         - ~1% speedup on cvs-base
598         
599         No test cases added, perf effects only.
600
601         * khtml/xml/dom_atomicstring.cpp:
602         (DOM::AtomicStringStatisticsExitLogger::~AtomicStringStatisticsExitLogger):
603         Improved stats gathering to track collisions in more detail and count reinserts
604         on remove.
605         (DOM::addToCollisionCount): ditto
606         (DOM::AtomicString::add): ditto
607         (DOM::AtomicString::insert): ditto
608         (DOM::AtomicString::remove): ditto
609         * khtml/xml/dom_stringimpl.cpp:
610         (DOM::DOMStringImpl::computeHash): Replace with SuperFastHash algorithm.
611         * kwq/KWQCharsets.mm:
612         (encodingNameHash): Clean up mistaken shift in the wrong direction.
613         * kwq/KWQString.h: Removed unused hashing code.
614         * kwq/KWQString.mm: ditto
615         * kwq/KWQTextCodec.mm:
616         (QTextCodec::hash): Use a variant of the SuperFastHash algorithm.
617
618 2005-06-27  David Harrison  <harrison@apple.com>
619
620         Reviewed by Ken.
621
622         Test cases added: None because this relies on mouse clicking.
623
624         <rdar://problem/4140688> assertion failure double-clicking text to select
625
626         * khtml/rendering/render_text.cpp:
627         (RenderText::positionForCoordinates):
628         Use setAffinityUsingLinePosition.
629
630 2005-06-25  Darin Adler  <darin@apple.com>
631
632         - updated a layout test so that it doesn't depend on a remote resource via http
633
634         * layout-tests/fast/backgrounds/001.html: Change image URL to be relative.
635         * layout-tests/fast/backgrounds/resources/bg_position_larger.gif: Added.
636
637 2005-06-24  Darin Adler  <darin@apple.com>
638
639         Changes by Mitz Pettel.
640         Reviewed by me.
641
642         Test cases added:
643         * layout-tests/fast/text/international/bidi-explicit-embedding-expected.txt: Added.
644         * layout-tests/fast/text/international/bidi-explicit-embedding.html: Added.
645
646         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3599>
647           Incorrect layout of explicit embedding levels
648
649         * khtml/rendering/bidi.cpp:
650         (khtml::embed): Set up the new run correctly following an embed/pop.
651         (khtml::RenderBlock::bidiReorderLine): Close the "dangling" run when we see an explicit
652         embedding character (or PDF).
653
654 2005-06-24  Darin Adler  <darin@apple.com>
655
656         Changes by Mitz Pettel.
657         Reviewed by me.
658
659         Test cases added:
660         * layout-tests/fast/text/international/bidi-CS-after-AN-expected.txt: Added.
661         * layout-tests/fast/text/international/bidi-CS-after-AN.html: Added.
662
663         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3693>
664           Bug_72578 in KHTML: bidi algorithm misbehaves with CS after AN
665
666         * khtml/rendering/bidi.cpp: (khtml::RenderBlock::bidiReorderLine): Rolled in the
667         patch from the KDE tree.
668
669 2005-06-24  Justin Garcia  <justin.garcia@apple.com>
670
671         - <http://bugzilla.opendarwin.org/show_bug.cgi?id=3673> 
672             Adds QBuffer::setBuffer(QByteArray) support to KWQBuffer, and adds a QBuffer(QByteArray) constructor.
673
674         Reviewed by Darin
675
676         Test cases added: Non required
677
678         * kwq/KWQBuffer.h:
679         (QBuffer::QBuffer):
680         * kwq/KWQBuffer.mm:
681         (QBuffer::setBuffer):
682
683 2005-06-24  Justin Garcia  <justin.garcia@apple.com>
684
685         - <http://bugzilla.opendarwin.org/show_bug.cgi?id=3672> KWQRect -- CGRect and other small additions
686         - <http://bugzilla.opendarwin.org/show_bug.cgi?id=3670> Add remove and byteOrderMark support to KWQString for kdom
687
688         Reviewed by Darin
689
690         Test cases added: None required
691
692         * kwq/KWQRect.h:
693         (QRect::contains):
694         * kwq/KWQRect.mm:
695         (QRect::QRect):
696         (QRect::topRight):
697         (QRect::bottomLeft):
698         (QRect::normalize):
699         (QRect::operator CGRect):
700         * kwq/KWQString.h:
701         (QChar::):
702         (QString::remove):
703
704 2005-06-24  Darin Adler  <darin@apple.com>
705
706         Reviewed by Justin Garcia.
707
708         - fixed <rdar://problem/4151619> Safari changes "\" characters to "/" in the query part of links that start with "?"
709
710         Test cases added:
711         * layout-tests/fast/dom/anchor-backslash-expected.txt: Added.
712         * layout-tests/fast/dom/anchor-backslash.html: Added.
713
714         * kwq/KWQKURL.mm: (substituteBackslashes): Fix error where we'd ignore
715         "?" and "#" characters if they were the first character in the string.
716
717 2005-06-23  Darin Adler  <darin@apple.com>
718
719         * khtml/html/html_formimpl.cpp: (DOM::HTMLTextAreaElementImpl::setValue):
720         Took out an unneeded type cast (meant to do that before committing).
721
722 2005-06-23  Kevin Ballard  <kevin@sb.org>
723
724         Reviewed and landed by Darin Adler.
725
726         Test cases added:
727         * layout-tests/fast/forms/selection-functions-expected.txt: Added.
728         * layout-tests/fast/forms/selection-functions.html: Added.
729         * layout-tests/fast/forms/textarea-crlf-expected.txt: Added.
730         * layout-tests/fast/forms/textarea-crlf.html: Added.
731
732         - Fixes bug <http://bugzilla.opendarwin.org/show_bug.cgi?id=3401>.
733           Also fixes issue where setting text of a textarea in code and then
734           retrieving it would leave the \r\n sequences in the text, despite
735           the textarea translating to \n in all other cases.
736
737         * khtml/ecma/kjs_html.h:
738         * khtml/ecma/kjs_html.cpp:
739         (KJS::getInputSelectionStart):
740         (KJS::getInputSelectionEnd):
741         (KJS::KJS::HTMLElement::getValueProperty):
742         (KJS::KJS::HTMLElement::hasProperty):
743         (KJS::KJS::HTMLElementFunction::tryCall):
744         (KJS::HTMLElement::putValue):
745         * khtml/html/html_formimpl.cpp:
746         (DOM::HTMLInputElementImpl::canHaveSelection):
747         (DOM::HTMLInputElementImpl::selectionStart):
748         (DOM::HTMLInputElementImpl::selectionEnd):
749         (DOM::HTMLInputElementImpl::setSelectionStart):
750         (DOM::HTMLInputElementImpl::setSelectionEnd):
751         (DOM::HTMLInputElementImpl::setSelectionRange):
752         (DOM::HTMLInputElementImpl::setValue):
753         (DOM::HTMLTextAreaElementImpl::selectionStart):
754         (DOM::HTMLTextAreaElementImpl::selectionEnd):
755         (DOM::HTMLTextAreaElementImpl::setSelectionStart):
756         (DOM::HTMLTextAreaElementImpl::setSelectionEnd):
757         (DOM::HTMLTextAreaElementImpl::setSelectionRange):
758         (DOM::HTMLTextAreaElementImpl::setValue):
759         * khtml/html/html_formimpl.h:
760         * khtml/rendering/render_form.cpp:
761         (RenderLineEdit::selectionStart):
762         (RenderLineEdit::selectionEnd):
763         (RenderLineEdit::setSelectionStart):
764         (RenderLineEdit::setSelectionEnd):
765         (RenderLineEdit::setSelectionRange):
766         (RenderTextArea::selectionStart):
767         (RenderTextArea::selectionEnd):
768         (RenderTextArea::setSelectionStart):
769         (RenderTextArea::setSelectionEnd):
770         (RenderTextArea::select):
771         (RenderTextArea::setSelectionRange):
772         * khtml/rendering/render_form.h:
773         * kwq/KWQLineEdit.h:
774         * kwq/KWQLineEdit.mm:
775         (QLineEdit::setCursorPosition):
776         (QLineEdit::cursorPosition):
777         (QLineEdit::selectAll):
778         (QLineEdit::selectionStart):
779         (QLineEdit::selectedText):
780         (QLineEdit::setSelection):
781         * kwq/KWQTextArea.h:
782         * kwq/KWQTextArea.mm:
783         (-[KWQTextArea setSelectedRange:]):
784         (-[KWQTextArea selectedRange]):
785         (-[KWQTextArea getCursorPositionAsIndex:inParagraph:]):
786         (RangeOfParagraph):
787         * kwq/KWQTextEdit.h:
788         * kwq/KWQTextEdit.mm:
789         (QTextEdit::getCursorPosition):
790         (QTextEdit::selectionStart):
791         (QTextEdit::selectionEnd):
792         (QTextEdit::setSelectionStart):
793         (QTextEdit::setSelectionEnd):
794         (QTextEdit::selectAll):
795         (QTextEdit::setSelectionRange):
796         * kwq/KWQTextField.h:
797         * kwq/KWQTextField.mm:
798         (-[KWQTextFieldController selectedRange]):
799         (-[KWQTextFieldController setSelectedRange:]):
800
801 2005-06-23  Justin Garcia  <justin.garcia@apple.com>
802
803         Patch by Eric Seidel <macdome@opendarwin.org>
804
805         Adds QTextIStream, QTextOStream to KWQ
806
807         Reviewed by Darin
808
809         Test cases added: None required
810
811         * kwq/KWQTextStream.h:
812         (QTextIStream::QTextIStream):
813         (QTextOStream::QTextOStream):
814
815 2005-06-23  Justin Garcia  <justin.garcia@apple.com>
816
817         Patch by Eric Seidel <macdome@opendarwin.org>
818
819         This patch contains several small additions to KWQ
820
821         Reviewed by Darin
822
823         Test cases added: None required
824
825         * kwq/KWQApplication.h:
826         (QApplication::palette):
827         * kwq/KWQDateTime.h:
828         (QDateTime::time):
829         * kwq/KWQDict.h:
830         (QDict::operator[]):
831         (QDictIterator::operator*):
832         * kwq/KWQKDebug.h:
833         (kdbgstream::operator<<):
834         * kwq/KWQMemArray.h:
835         (QMemArray::duplicate):
836
837 2005-06-23  David Harrison  <harrison@apple.com>
838
839         Test cases added: None needed for this debug-only utility code.
840
841         - Make showTree() const.
842         - Add showTree() for InlineBox.
843         - Add showTree() for RenderObject.
844
845         * khtml/editing/selection.cpp:
846         (khtml::Selection::showTree):
847         * khtml/editing/selection.h:
848         * khtml/editing/visible_position.cpp:
849         (khtml::VisiblePosition::showTree):
850         * khtml/editing/visible_position.h:
851         Make showTree() const.
852         
853         * khtml/rendering/render_line.cpp:
854         (khtml::InlineBox::showTree):
855         * khtml/rendering/render_line.h:
856         Add showTree() for InlineBox.
857         
858         * khtml/rendering/render_object.cpp:
859         (RenderObject::showTree):
860         * khtml/rendering/render_object.h:
861         Add showTree() for RenderObject.
862         
863         * khtml/xml/dom_nodeimpl.cpp:
864         (appendAttributeDesc):
865         (NodeImpl::showNode):
866         (NodeImpl::showTree):
867         (NodeImpl::showTreeAndMark):
868         * khtml/xml/dom_nodeimpl.h:
869         Make showTree() const.
870
871 2005-06-23  Vicki Murley  <vicki@apple.com>
872
873         - added template to be used when writing manual tests
874
875         * manual-tests/template.html: Added.
876
877 2005-06-22  Darin Adler  <darin@apple.com>
878
879         - added forwarding headers as needed for Eric Seidel's KDOM work
880           see <http://bugzilla.opendarwin.org/show_bug.cgi?id=3655>
881
882         * ForwardingHeaders/kjs/value.h: Added.
883         * ForwardingHeaders/qintdict.h: Added an include.
884         * ForwardingHeaders/qptrcollection.h: Added.
885         * ForwardingHeaders/qsize.h: Added.
886         * kwq/KWQIntDict.h: Added. Empty file.
887
888 2005-06-22  Darin Adler  <darin@apple.com>
889
890         Reviewed by Vicki.
891
892         Test cases added:
893         * layout-tests/fast/css/apple-prefix-expected.txt: Added.
894         * layout-tests/fast/css/apple-prefix.html: Added.
895
896         - fixed <rdar://problem/4141650> REGRESSION: Safari RSS slider broken with TOT WebCore
897
898         * khtml/css/parser.y:
899         (getPropertyID): Fix lifetime problem on the QString. Also construct the QString
900         using length, since the passed-in char * is not necessarily null-terminated. Also do
901         the mapping only if it's a "-apple-" prefix -- the old code would do it for, e.g.,
902         "-applex-" too. The old code would not successfully map the "apple" in "appleLineClamp"
903         to "khtml", and Dave changed things so that the internal name of all CSS attributes
904         is "khtml" back in his 2005-05-03 check-in, breaking the use of appleLineClamp in RSS.
905         (getValueID): Ditto.
906
907 2005-06-22  Anders Carlsson  <andersca@mac.com>
908
909         Reviewed and landed by Darin Adler.
910
911         Test cases added: 
912         * layout-tests/fast/dom/title-text-property-expected.txt: Added
913         * layout-tests/fast/dom/title-text-property.html: Added
914         * layout-tests/fast/dom/title-text-property-expected-2.txt: Added
915         * layout-tests/fast/dom/title-text-property-2.html: Added
916
917         - fixed <rdar://problem/3831364> getting or setting text for a <title> element doesn't work
918         - fixed <rdar://problem/4091225> REGRESSION (1.2.4-1.3): many titles with non-ASCII characters do not display properly (XHTML strict only)
919         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3586>
920           Setting and getting title's text attribute does not work
921
922         * khtml/dom/html_head.cpp:
923         (HTMLTitleElement::text):
924         (HTMLTitleElement::setText):
925         Call HTMLTitleElementImpl::text() and ::setText().
926
927         * khtml/html/html_headimpl.cpp:
928         (HTMLTitleElementImpl::HTMLTitleElementImpl):
929         (HTMLTitleElementImpl::insertedIntoDocument):
930         (HTMLTitleElementImpl::removedFromDocument):
931         (HTMLTitleElementImpl::childrenChanged):
932         Pass the current title node to DocumentImpl::setTitle
933         and ::removeTitle.
934
935         (HTMLTitleElementImpl::text):
936         Return the title.
937
938         (HTMLTitleElementImpl::setText):
939         Set the new title.
940
941         * khtml/xml/dom_docimpl.cpp:
942         (DocumentImpl::DocumentImpl):
943         (DocumentImpl::~DocumentImpl):
944         (DocumentImpl::updateTitle):
945         (DocumentImpl::setTitle):
946         (DocumentImpl::removeTitle):
947         * khtml/xml/dom_docimpl.h:
948         Only update the title if it's done by setting document.title
949         or by changing the child nodes of the title element.
950
951 2005-06-22  Darin Adler  <darin@apple.com>
952
953         Changes by Mitz Pettel.
954         Reviewed by me.
955
956         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3633>
957           Layout order of bidi level runs is incorrect
958
959         Test cases added:
960         * layout-tests/fast/text/international/bidi-L2-run-reordering-expected.txt: Added.
961         * layout-tests/fast/text/international/bidi-L2-run-reordering.html: Added.
962
963         * khtml/rendering/bidi.cpp: (khtml::RenderBlock::bidiReorderLine): Fixed mistake
964         where we'd advance too far after reversing a run.
965
966 2005-06-22  Darin Adler  <darin@apple.com>
967
968         - added test case for JavaScriptCore fix
969
970         * layout-tests/fast/js/string-replace-2-expected.txt: Added.
971         * layout-tests/fast/js/string-replace-2.html: Added.
972
973 2005-06-22  Darin Adler  <darin@apple.com>
974
975         Reviewed by John Sullivan.
976
977         Test cases added:
978         * layout-tests/fast/dom/css-set-property-exception-expected.txt: Added.
979         * layout-tests/fast/dom/css-set-property-exception.html: Added.
980
981         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3616>
982           RSS search field, Dashboard widgets failing due to CSS exception
983
984         * khtml/ecma/kjs_css.cpp: (KJS::DOMCSSStyleDeclaration::tryPut):
985         Ignore exceptions when setting properties.
986
987         * layout-tests/fast/js/exception-linenums.html: Changed test case that
988         involved setting style to one that involved setting another property that
989         raises an exception when you try to set it (setting prefix on a text node).
990
991 2005-06-22  Darin Adler  <darin@apple.com>
992
993         Change proposed by Eric Seidel.
994
995         * WebCore.pbproj/project.pbxproj: Fix build rule to match the one in JavaScriptCore.
996         The one here accidentally had hard-coded paths in it and also had the $() vs. ${}
997         issue that broke building on Xcode 2.1 for no good reason (it didn't need $() or ${}).
998
999 2005-06-21  Maciej Stachowiak  <mjs@apple.com>
1000
1001         Patch from KevinBallard <kevin@sb.org>, reviewed by me.
1002
1003         - fix build for Xcode 2.1, use ${} for INPUT_FILE_BASE to fix build with Xcode 2.1
1004
1005         * WebCore.pbproj/project.pbxproj:
1006
1007 2005-06-21  Justin Garcia  <justin.garcia@apple.com>
1008
1009         - Fixes <rdar://problem/4114192>.
1010         - Fixes a crash in TOT Mail/Blot if you Edit -> Add Hyperlink on a Selection 
1011            that ends at the end of the document
1012         - Fixes a problem in TOT Mail/Blot where Edit -> Add Hyperlink creates 
1013            a link one character beyond what is expected.
1014         
1015         In replacement, during insertion, some special case code was being called inappropriately.
1016         
1017         Reviewed by Harrison
1018
1019         Test cases added: None, requires manual interaction
1020
1021         * khtml/editing/replace_selection_command.cpp:
1022         (khtml::ReplaceSelectionCommand::doApply): In "step 2" of a replacement, we should 
1023         only next() the insertion point if the special pre-insertion-merge actually occured.
1024         mergeStart used to be the correct check for the occurence of a pre-insertion-merge, but
1025         a bug fix made this not the case.  A non-null m_lastNodeInserted correctly signals 
1026         that some pre-insertion merging occured.
1027
1028 2005-06-21  Darin Adler  <darin@apple.com>
1029
1030         * WebCore.pbproj/project.pbxproj: Switched to a build rule rather than a build phase for the
1031         .y files -- this gets rid of the problem where modifying the .y file would not cause sufficient
1032         compilation.
1033
1034         * khtml/css/parser_wrapper.cpp: Removed.
1035
1036 2005-06-21  Adele Peterson  <adele@apple.com>
1037
1038         Test cases for:
1039         <http://bugzilla.opendarwin.org/show_bug.cgi?id=3450>
1040         <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
1041
1042         * layout-tests/fast/js/string_replace-expected.txt: Added.
1043         * layout-tests/fast/js/string_replace.html: Added.
1044
1045 2005-06-21  Geoffrey Garen  <ggaren@apple.com>
1046
1047         Patch contributed by Niels Leenheer <niels.leenheer@gmail.com>
1048
1049         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3370
1050         (Safari can't handle strange frame dimensions)
1051
1052         Reviewed by Darin.
1053
1054         * khtml/dom/dom_string.cpp:
1055         (DOM::DOMString::toCoordsArray):
1056         * khtml/dom/dom_string.h:
1057         * khtml/html/html_imageimpl.cpp:
1058         (HTMLAreaElementImpl::parseMappedAttribute):
1059         * khtml/xml/dom_atomicstring.h:
1060         (DOM::AtomicString::toCoordsArray):
1061         * khtml/xml/dom_stringimpl.cpp:
1062         (DOM::parseLength):
1063         (DOM::DOMStringImpl::toCoordsArray):
1064         (DOM::DOMStringImpl::toLengthArray):
1065         * khtml/xml/dom_stringimpl.h:
1066
1067         Test cases added: 
1068         * layout-tests/fast/frames/invalid-expected.txt: Added.
1069         * layout-tests/fast/frames/invalid.html: Added.
1070         * layout-tests/fast/frames/valid-expected.txt: Added.
1071         * layout-tests/fast/frames/valid.html: Added.
1072
1073 2005-06-21  Geoffrey Garen  <ggaren@apple.com>
1074
1075         - fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
1076
1077         Test cases only, fix is in JavaScriptCore
1078
1079         Reviewed by cblu.
1080
1081         Test cases added: 
1082
1083         * layout-tests/fast/js/global-opener-function-expected.txt: Added.
1084         * layout-tests/fast/js/global-opener-function.html: Added.
1085
1086 2005-06-21  David Harrison  <harrison@apple.com>
1087
1088         Reviewed by Justin.
1089         
1090         - show class and style attributes for element nodes
1091         - nil check the node being showTree'd
1092         - add Position::showTree()
1093
1094         Test cases added: None needed for this debug-only utility code.
1095
1096         * khtml/editing/selection.cpp:
1097         (khtml::Selection::showTree):
1098         - nil check the node
1099         * khtml/editing/visible_position.cpp:
1100         (khtml::VisiblePosition::previousVisiblePosition):
1101         - comments
1102         (khtml::VisiblePosition::showTree):
1103         - nil check the node
1104         * khtml/xml/dom_nodeimpl.cpp:
1105         (appendAttributeDesc):
1106         (NodeImpl::showNode):
1107         - show class and style attributes for element nodes
1108         * khtml/xml/dom_position.cpp:
1109         (DOM::Position::showTree):
1110         * khtml/xml/dom_position.h:
1111         - add Position::showTree()
1112
1113 2005-06-20  Maciej Stachowiak  <mjs@apple.com>
1114
1115         Reviewed by Darin(first pass) and Hyatt.
1116
1117         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
1118         (roll in support for "const" keyword from KDE tree)
1119         - make processVarDecls handle deletability of variables declared
1120         in an eval block the same as evaluate would
1121         - make eval() call processVarDecls - needed to match mozilla and
1122         to make the second change testable
1123
1124         Test cases only, fix is in JavaScriptCore
1125         
1126         Test cases added:
1127         * layout-tests/fast/js/const-expected.txt: Added.
1128         * layout-tests/fast/js/const.html: Added.
1129         * layout-tests/fast/js/eval-var-decl-expected.txt: Added.
1130         * layout-tests/fast/js/eval-var-decl.html: Added.
1131
1132 2005-06-20  Maciej Stachowiak  <mjs@apple.com>
1133
1134         Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
1135
1136         - fixed http://bugzilla.opendarwin.org/attachment.cgi?id=2483
1137         
1138         Test cases added: 
1139         * layout-tests/fast/js/hasOwnProperty-expected.txt: Added.
1140         * layout-tests/fast/js/hasOwnProperty.html: Added.
1141         - also fixed two mozilla JS tests
1142         
1143         * khtml/ecma/kjs_binding.h:
1144         * khtml/ecma/kjs_css.cpp:
1145         (KJS::DOMCSSStyleDeclaration::hasOwnProperty):
1146         * khtml/ecma/kjs_css.h:
1147         * khtml/ecma/kjs_dom.cpp:
1148         (KJS::DOMNodeList::hasOwnProperty):
1149         (KJS::DOMNamedNodeMap::hasOwnProperty):
1150         * khtml/ecma/kjs_dom.h:
1151         * khtml/ecma/kjs_html.cpp:
1152         (KJS::HTMLDocument::hasOwnProperty):
1153         (KJS::KJS::HTMLElement::hasOwnProperty):
1154         (KJS::KJS::HTMLCollection::hasOwnProperty):
1155         * khtml/ecma/kjs_html.h:
1156         * khtml/ecma/kjs_window.cpp:
1157         (KJS::Window::hasOwnProperty):
1158         (KJS::Konqueror::hasOwnProperty):
1159         * khtml/ecma/kjs_window.h:
1160
1161 2005-06-20  Geoffrey Garen  <ggaren@apple.com>
1162
1163         Changes by Darin. Layout tests by me. Reviewed by me.
1164
1165         Fixed <rdar://problem/4152454> crash in KJS::ExprStatementNode::execute(KJS::ExecState*) in World Clock widget with TOT.
1166
1167         Test cases added: 
1168         * layout-tests/fast/dom/gc-4-expected.txt: Added.
1169         * layout-tests/fast/dom/gc-4.html: Added.
1170
1171         * khtml/ecma/kjs_html.cpp: 
1172         (KJS::Context2D::mark): mark now (1) checks for NULL pointers and (2) 
1173         calls mark on its parent class (DOMObject::mark).
1174
1175 2005-06-19  Darin Adler  <darin@apple.com>
1176
1177         Changes by both Anders Carlsson and me.
1178         Reviewed by Maciej and me.
1179
1180         Test cases added:
1181         * layout-tests/fast/forms/element-order-expected.txt: Added.
1182         * layout-tests/fast/forms/element-order.html: Added.
1183
1184         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3503>
1185           form.elements[] not order-preserving when elements added via DOM
1186
1187         * khtml/html/html_formimpl.h: Added formElementIndex.
1188         * khtml/html/html_formimpl.cpp:
1189         (DOM::insertIntoVector): Added.
1190         (DOM::HTMLFormElementImpl::formElementIndex): Added. Computes an appropriate
1191         index for a form element, given the document position relative to the other elements.
1192         (DOM::HTMLFormElementImpl::registerFormElement): Use formElementIndex to determine
1193         where to insert the element in the formElements array.
1194
1195 2005-06-19  Darin Adler  <darin@apple.com>
1196
1197         Changes by Anders Carlsson and me.
1198         Reviewed by Maciej and me.
1199
1200         Test cases added: None. Could not figure out how to automate a test without
1201         making enhancements to DumpRenderTree.
1202
1203         - fixed <rdar://problem/4141141> Onselect event is ignored with TEXTAREA and INPUT
1204           also <http://bugzilla.opendarwin.org/show_bug.cgi?id=3256>
1205
1206         * khtml/html/html_formimpl.cpp: (DOM::HTMLTextAreaElementImpl::select):
1207         Remove unneeded explicit call to onSelect() here -- now handled by the renderer.
1208
1209         * khtml/rendering/render_form.h: Added declarations as needed below.
1210         * khtml/rendering/render_form.cpp:
1211         (RenderFormElement::slotSelectionChanged): Add base class implementation that does nothing.
1212         (RenderLineEdit::RenderLineEdit): Connect the selection changed signal to our slot.
1213         (RenderLineEdit::slotSelectionChanged): Call onSelect when selection changes to something
1214         that's a selection (not a caret).
1215         (RenderTextArea::RenderTextArea): Connect as above.
1216         (RenderTextArea::slotSelectionChanged): Call as above.
1217
1218         * kwq/KWQLineEdit.h: Added declarations as needed below.
1219         * kwq/KWQLineEdit.mm:
1220         (QLineEdit::QLineEdit): Added selectionChanged signal.
1221         (QLineEdit::hasSelectedText): Added.
1222
1223         * kwq/KWQSlot.mm:
1224         (KWQSlot::KWQSlot): Make selectionChanged work on any form element.
1225         (KWQSlot::call): ditto.
1226
1227         * kwq/KWQTextArea.h: Added hasSelection method.
1228         * kwq/KWQTextArea.mm:
1229         (-[KWQTextArea textViewDidChangeSelection:]): Added. Sends selectionChanged signal, except if
1230         we're in the middle of gaining or losing first responder.
1231         (-[KWQTextArea hasSelection]): Added.
1232         (-[KWQTextAreaTextView becomeFirstResponder]): Added. Sets flag to tell us we're in a responder
1233         change (using a count to avoid trouble if we reenter).
1234         (-[KWQTextAreaTextView resignFirstResponder]): Ditto.
1235         (-[KWQTextAreaTextView inResponderChange]): Added.
1236
1237         * kwq/KWQTextEdit.h: Added declarations as needed below.
1238         * kwq/KWQTextEdit.mm:
1239         (QTextEdit::QTextEdit): Added selectionChanged signal.
1240         (QTextEdit::hasSelectedText): Added.
1241
1242         * kwq/KWQTextField.h: Added declarations as needed below.
1243         * kwq/KWQTextField.mm:
1244         (-[KWQTextFieldController initWithTextField:QLineEdit:]): Fixed up to do the right
1245         thing with the result of the init function we call.
1246         (-[KWQTextFieldController controlTextDidEndEditing:]): Removed call to setHasFocus:NO
1247         since it's a little too late by the time the control is called; now handled by the
1248         text view delegate methods below.
1249         (-[KWQTextFieldController hasSelection]): Added.
1250         (-[KWQTextFieldController setHasFocus:]): Sets the new hasFocusAndSelectionSet after
1251         new focus and selection are both set up.
1252         (-[KWQTextFieldController textViewDidChangeSelection:]): Added. Sends the selection
1253         changed signal.
1254         (-[KWQTextField initWithQLineEdit:]): Fixed up to do the right thing with the result
1255         of the init function we call.
1256         (-[KWQTextField textViewDidChangeSelection:]): Added. Calls super and then calls the
1257         controller.
1258         (-[KWQTextField textDidEndEditing:]): Added. Calls setHasFocus:NO and then calls super.
1259         (-[KWQSecureTextField initWithQLineEdit:]): Same as above, but for secure text fields.
1260         (-[KWQSecureTextField textViewDidChangeSelection:]): Ditto.
1261         (-[KWQSecureTextField textDidEndEditing:]): Ditto.
1262         (-[KWQSearchField initWithQLineEdit:]): Same as above, but for search fields.
1263         (-[KWQSearchField textViewDidChangeSelection:]): Ditto.
1264         (-[KWQSearchField textDidEndEditing:]): Ditto.
1265         (-[KWQTextFieldFormatter init]): Fixed up to do the right thing with the result of
1266         the init function we call.
1267
1268 2005-06-18  Darin Adler  <darin@apple.com>
1269
1270         Changes by Anders Carlsson.
1271         Reviewed by me.
1272
1273         Test cases added:
1274         * layout-tests/fast/dom/css-dom-read-expected.txt: Added.
1275         * layout-tests/fast/dom/css-dom-read.html: Added.
1276
1277         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3534>
1278           CSSMutableStyleDeclarationImpl::item is unimplemented
1279
1280         * khtml/css/css_valueimpl.cpp: (DOM::CSSMutableStyleDeclarationImpl::item):
1281         Get the style from the m_values list.
1282
1283 2005-06-18  Darin Adler  <darin@apple.com>
1284
1285         - undid a last minute change I made that broke a patch I landed
1286           (layout tests caught the mistake, all should work again now)
1287
1288         * khtml/html/html_formimpl.cpp:
1289         (DOM::HTMLLabelElementImpl::formElement): Don't include this when iterating.
1290         (DOM::HTMLLegendElementImpl::formElement): Ditto.
1291
1292 2005-06-18  Darin Adler  <darin@apple.com>
1293
1294         - removing the applet tests, since they are causing other tests to fail
1295
1296         * layout-tests/fast/replaced/applet-hspace-expected.txt: Removed.
1297         * layout-tests/fast/replaced/applet-hspace.html: Removed.
1298         * layout-tests/fast/replaced/applet-vspace-expected.txt: Removed.
1299         * layout-tests/fast/replaced/applet-vspace.html: Removed.
1300         * layout-tests/fast/replaced/resources/applet.class: Removed.
1301         * layout-tests/fast/replaced/resources/applet.java: Removed.
1302
1303 2005-06-18  Darin Adler  <darin@apple.com>
1304
1305         Changes by Anders Carlsson.
1306         Reviewed by me.
1307
1308         Test cases added:
1309         * layout-tests/fast/dom/resources/script3.js: Added.
1310         * layout-tests/fast/dom/resources/script4.js: Added.
1311         * layout-tests/fast/dom/resources/script5.js: Added.
1312         * layout-tests/fast/dom/script-add-expected.txt: Added.
1313         * layout-tests/fast/dom/script-add.html: Added.
1314
1315         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3526>
1316           improve support for dynamically added <script> elements
1317
1318         * khtml/html/html_headimpl.h: Added override of childrenChanged, new evaluateScript
1319         function, and m_evaluated boolean.
1320         * khtml/html/html_headimpl.cpp:
1321         (HTMLScriptElementImpl::HTMLScriptElementImpl): Init m_evaluated to false.
1322         (HTMLScriptElementImpl::childrenChanged): Added code to evaluate the script the first
1323         time a child is added (except for nodes created by parsing).
1324         (HTMLScriptElementImpl::insertedIntoDocument): Refactored to use the new text and
1325         evaluateScript functions. Also changed to not try to evaluate the script if the element
1326         is entirely empty. This allows you to declare an empty <script> element and fill the
1327         content in later using DHTML.
1328         (HTMLScriptElementImpl::notifyFinished): Refactored to use the new evaluateScript function.
1329         (HTMLScriptElementImpl::evaluateScript): Added. Checks and sets a new m_evaluated boolean
1330         to implement the "evaluate each script only once" rule.
1331         (HTMLScriptElementImpl::text): Replaced bogus implementation with one that works.
1332         (HTMLScriptElementImpl::setText): Ditto.
1333
1334         * khtml/dom/html_head.cpp:
1335         (HTMLScriptElement::text): Replaced bogus implementation with one that calls through to
1336         the implementation class. This change doesn't really matter since we don't compile this file.
1337         (HTMLScriptElement::setText): Ditto.
1338
1339 2005-06-18  Darin Adler  <darin@apple.com>
1340
1341         * khtml/html/html_formimpl.cpp: (DOM::HTMLLabelElementImpl::formElement):
1342         Oops, checked in a version that didn't even compile! Fixed now.
1343
1344 2005-06-18  Darin Adler  <darin@apple.com>
1345
1346         Changes by Anders Carlsson.
1347         Reviewed by me.
1348
1349         Test cases added:
1350         * layout-tests/fast/forms/focus-expected.txt: Added.
1351         * layout-tests/fast/forms/focus.html: Added.
1352         * layout-tests/fast/forms/legend-access-key-expected.txt: Added.
1353         * layout-tests/fast/forms/legend-access-key.html: Added.
1354
1355         - fixed <rdar://problem/3481846> HTML4: accesskey not supported by HTML legend elements
1356           also <http://bugzilla.opendarwin.org/show_bug.cgi?id=3407>
1357         - added focus methods for <label> and <legend> elements
1358         - fixed crash when using JavaScript-created events that prevented tests from running
1359
1360         * khtml/ecma/kjs_html.h: Added focus methods.
1361         * khtml/ecma/kjs_html.cpp: (KJS::KJS::HTMLElementFunction::tryCall): Added bindings for
1362         focus for <label> and <legend>. (Sorry about the merging, Dave.)
1363
1364         * khtml/html/html_formimpl.h: Added new functions.
1365         * khtml/html/html_formimpl.cpp:
1366         (DOM::HTMLLabelElementImpl::focus): Added.
1367         (DOM::HTMLLegendElementImpl::formElement): Added.
1368         (DOM::HTMLLegendElementImpl::focus): Added.
1369         (DOM::HTMLLegendElementImpl::accessKeyAction): Added.
1370
1371         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::defaultEventHandler): If there's no QKeyEvent,
1372         then get the key name from keyIdentifier() instead of the QKeyEvent's unmodifiedText().
1373         The old code would just do a nil-deref.
1374
1375 2005-06-18  Darin Adler  <darin@apple.com>
1376
1377         Change by Niels Leenheer (also done by Dave Hyatt on stage at WWDC).
1378         Reviewed by me.
1379
1380         Test cases added:
1381         * layout-tests/fast/replaced/object-align-hspace-vspace-expected.txt: Added.
1382         * layout-tests/fast/replaced/object-align-hspace-vspace.html: Added.
1383         * layout-tests/fast/replaced/resources/webkit-background.png: Added.
1384
1385         * khtml/html/html_objectimpl.cpp:
1386         (DOM::HTMLObjectElementImpl::mapToEntry): Add cases for ATTR_ALIGN, ATTR_VSPACE and ATTR_HSPACE.
1387         (DOM::HTMLObjectElementImpl::parseMappedAttribute): Ditto.
1388
1389 2005-06-18  Darin Adler  <darin@apple.com>
1390
1391         Change by Niels Leenheer (also done by Dave Hyatt on stage at WWDC).
1392         Reviewed by me.
1393
1394         Test cases added:
1395         * layout-tests/fast/replaced/applet-hspace-expected.txt: Added.
1396         * layout-tests/fast/replaced/applet-hspace.html: Added.
1397         * layout-tests/fast/replaced/applet-vspace-expected.txt: Added.
1398         * layout-tests/fast/replaced/applet-vspace.html: Added.
1399         * layout-tests/fast/replaced/resources/applet.class: Added.
1400         * layout-tests/fast/replaced/resources/applet.java: Added.
1401
1402         - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3246>
1403           HSPACE and VSPACE attributes are ignored in APPLET element
1404
1405         * khtml/html/html_objectimpl.cpp:
1406         (DOM::HTMLAppletElementImpl::mapToEntry): Add cases for ATTR_VSPACE and ATTR_HSPACE.
1407         (DOM::HTMLAppletElementImpl::parseMappedAttribute): Ditto.
1408
1409 2005-06-18  Darin Adler  <darin@apple.com>
1410
1411         - removed some unused code from one of the KWQ headers
1412
1413         * kwq/KWQKHTMLPartBrowserExtension.h:
1414
1415         - added a layout test for a bug that's already fixed
1416
1417         * layout-tests/fast/forms/element-by-name-expected.txt: Added.
1418         * layout-tests/fast/forms/element-by-name.html: Added.
1419
1420 2005-06-17  Vicki Murley  <vicki@apple.com>
1421
1422         Reviewed by Maciej. 
1423
1424         Test cases added: None, since this test requires manual interaction.
1425
1426         - fixed <rdar://problem/4086793> Selects wrapped by Span or Label elements 
1427         do not resize when options are added via javascript
1428         
1429         * khtml/rendering/render_form.cpp:
1430         (RenderSelect::layout): Remove call setting setNeedsLayout to true. setNeedsLayout
1431         is already true at this point, and this additional call has the negative effect of 
1432         marking m_normalChildNeedsLayout on the element's parent, which keeps layout from 
1433         propagating all the way up to the root later on.
1434
1435 2005-06-17  Justin Garcia  <justin.garcia@apple.com>
1436
1437         Fix for rdar://3756860, (also listed as) http://bugzilla.opendarwin.org/show_bug.cgi?id=3295
1438         The cellIndex property for HTMLTableCellElement was always zero because the method to support it was just a stub.
1439         KHTML fix was to simply call nodeIndex(), but this is incorrect because a table row can have as children <script>s
1440         and <form>s (and perhaps others).
1441         
1442         Reviewed by hyatt and john
1443
1444         Test cases added:
1445         * layout-tests/fast/table/cellindex.html: Added.  Illustrates the fix.
1446
1447         * khtml/html/html_tableimpl.cpp:
1448         (DOM::HTMLTableCellElementImpl::cellIndex): Iterate through siblings only counting <th> and <td> elements
1449         * khtml/html/html_tableimpl.h:
1450
1451 2005-06-17  Adele Peterson  <adele@apple.com>
1452
1453         Reviewed by Maciej.
1454
1455         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3419
1456         <rdar://problem/4111752> REGRESSION (125-312/412): Safari doesn't display edmunds.com pages first time through
1457
1458         * khtml/html/htmltokenizer.cpp: (khtml::HTMLTokenizer::parseTag): set 'script' flag when 
1459           parsing <script src="foo" /> case.  In this case, parseTag calls the scriptHandler function which expects 
1460           that flag to be set, and sets it back to false at the appropriate time.
1461
1462         Test cases added: These still don't test the cached script cases, but they're good regression 
1463         tests for the tokenizer.  We'll have to come up with a good way to test the cached cases later.
1464
1465         * layout-tests/fast/tokenizer/external-script-document-write_2-expected.txt: Added.
1466         * layout-tests/fast/tokenizer/external-script-document-write_2.html: Added.
1467         * layout-tests/fast/tokenizer/resources/empty_script.js: Added.
1468         * layout-tests/fast/tokenizer/script_extra_close-expected.txt: Added.
1469         * layout-tests/fast/tokenizer/script_extra_close.html: Added.
1470         * layout-tests/fast/tokenizer/script_quirk-expected.txt: Added.
1471         * layout-tests/fast/tokenizer/script_quirk.html: Added.
1472
1473 2005-06-17  Justin Garcia  <justin.garcia@apple.com>
1474
1475         Fixed fprintf problem in gcc4.0
1476         
1477         Reviewed by Darin
1478
1479         Test cases added: See previous ChangeLog entry
1480
1481         * khtml/xml/dom_nodeimpl.cpp:
1482         (NodeImpl::showTreeAndMark): Fixed fprintf warning in gcc4
1483
1484 2005-06-17  Geoffrey Garen  <ggaren@apple.com>
1485
1486         Patch contributed by Anders Carlsson<andersca@mac.com>.
1487
1488         Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=3408      
1489
1490         Reviewed by Darin.
1491
1492         Test cases added: None. Test requires manual interaction.
1493         Manual test available at: http://bugzilla.opendarwin.org/attachment.cgi?id=2207
1494
1495         * khtml/html/html_formimpl.cpp: Eliminated HTMLButtonElementImpl::click. HTMLButtonElementImpl now inherits HTMLElementImpl::click. 
1496         * khtml/html/html_formimpl.h: Ditto.
1497
1498 2005-06-17  Darin Adler  <darin@apple.com>
1499
1500         Reviewed by John.
1501
1502         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3556
1503           black diamond question mark shown for invalid UTF-8 sequences
1504
1505         Test cases added:
1506         * layout-tests/fast/encoding/invalid-UTF-8-expected.txt: Added.
1507         * layout-tests/fast/encoding/invalid-UTF-8.html: Added.
1508
1509         * kwq/KWQTextCodec.mm:
1510         (unwanted): Added. Returns true for BOM, replacement, and null characters.
1511         (KWQTextDecoder::appendOmittingUnwanted): Renamed from appendOmittingNullsAndBOMs and
1512         changed to use the new "unwanted" function, which causes it to omit replacement characters.
1513         (KWQTextDecoder::convertUsingTEC): Call append function by its new name.
1514
1515 2005-06-16  Justin Garcia  <justin.garcia@apple.com>
1516
1517         Added a few debugging methods to highlight Selections, VisiblePositions and Nodes in the DOM tree.
1518         
1519         Reviewed by Dave Harrison
1520
1521         Test cases added: None, changes are only to aid debugging
1522
1523         * khtml/editing/selection.cpp:
1524         (khtml::Selection::showTree):
1525         * khtml/editing/selection.h:
1526         * khtml/editing/visible_position.cpp:
1527         (khtml::VisiblePosition::showTree):
1528         * khtml/editing/visible_position.h:
1529         * khtml/xml/dom_nodeimpl.cpp:
1530         (NodeImpl::showNode):
1531         (NodeImpl::showTree):
1532         (NodeImpl::showTreeAndMark): 
1533         * khtml/xml/dom_nodeimpl.h:
1534
1535 2005-06-14  David Hyatt  <hyatt@apple.com>
1536
1537         Add an initial implementation of QualifiedName and HTMLNames.  These classes are not used by anyone yet.
1538         Progress being recorded in bugzilla bug 3405.
1539         
1540         Reviewed by mjs
1541
1542         Test cases added: (None, does not affect build yet)
1543
1544         * WebCore.pbproj/project.pbxproj:
1545         * khtml/xml/dom_qname.h,.cpp
1546         * khtml/html/htmlnames.h,.cpp
1547
1548 2005-06-14  David Hyatt  <hyatt@apple.com>
1549
1550         The behavior of <pre> is broken so that the newline
1551         is not always properly being eaten after the open of the tag.  In addition we were eating the first newline
1552         after all other tags.  This patch stops eating newlines after other tags and refines the behavior for pre
1553         to catch all cases.
1554         
1555         Reviewed by sullivan
1556
1557         Test cases added: fast/text/whitespace/030.html
1558
1559         * khtml/html/htmltokenizer.cpp:
1560         (khtml::HTMLTokenizer::parseTag):
1561         (khtml::HTMLTokenizer::write):
1562
1563 2005-06-13  Vicki Murley  <vicki@apple.com>
1564
1565         Reviewed by Darin.
1566
1567         No test cases added since the steps to reproduce require use of showModalDialog.
1568
1569         - fix for <rdar://problem/4145910> parameters not working in showModalDialog 
1570         test page (dialogWidth, dialogHeight, etc.)
1571
1572         * khtml/ecma/kjs_window.cpp:
1573         (KJS::parseFeatures): add a check for colon character in the feature string
1574
1575 2005-06-13  Maciej Stachowiak  <mjs@apple.com>
1576
1577         Reviewed by Chris Blumenberg and Adele.
1578
1579         - better fix for <rdar://problem/4142247> REGRESSION: List to browse widgets at Apple website failed. Closing tab afterwards caused Safari crash
1580         http://bugzilla.opendarwin.org/show_bug.cgi?id=3445
1581
1582         With this change and the matching WebKit change we'll still stop loading the moment you click
1583         a download link, but the unload event and detaching of event handlers will not happen early any more.
1584         
1585         * khtml/khtml_part.cpp:
1586         (KHTMLPart::stopLoading): Factored out from closeURL, make firing of unload
1587         and detaching of event handlers optional.
1588         (KHTMLPart::closeURL): call stopLoading(true)
1589         * khtml/khtml_part.h:
1590         * kwq/WebCoreBridge.h:
1591         * kwq/WebCoreBridge.mm:
1592         (-[WebCoreBridge stopLoading]): Call stopLoading(false).
1593
1594 2005-06-13  Maciej Stachowiak  <mjs@apple.com>
1595
1596         Patch from Andrew Wellington <proton@wiretapped.net>
1597         Reviewed by me.
1598
1599         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3302
1600         (Safari crashes when going to acid2 test page once it's in cache)
1601         
1602         No test cases addded since the repro steps require use of tabbed browsing.
1603
1604         * khtml/khtml_part.cpp:
1605         (KHTMLPart::handleFallbackContent): check for nil
1606
1607 2005-06-12  Darin Adler  <darin@apple.com>
1608
1609         - added expected test results for new tests
1610
1611         * layout-tests/fast/selectors/159-expected.txt: Added.
1612         * layout-tests/fast/selectors/177a-expected.txt: Added.
1613         * layout-tests/fast/selectors/177b-expected.txt: Added.
1614
1615 2005-06-11  Maciej Stachowiak  <mjs@apple.com>
1616
1617         Patch from Nicholas Shanks <contact@nickshanks.com>, reviewed by me.
1618
1619         - Distinguish between pseudo-elements and pseudo-classes in CSS parsing.
1620         http://bugzilla.opendarwin.org/show_bug.cgi?id=3375
1621
1622         Merge of svn log -v -r 399829 svn://anonsvn.kde.org/home/kde
1623         
1624         Test cases added: Added the following from CSS selector test suite,
1625         unfortunately 159 and 117a do not show any difference with and without the
1626         patch since layout tests do not dump selection style (yet).
1627         
1628         * layout-tests/fast/selectors/159.html: Added.
1629         * layout-tests/fast/selectors/177a.html: Added.
1630         * layout-tests/fast/selectors/177b.html: Added.
1631
1632         * khtml/css/css_base.cpp:
1633         (CSSSelector::specificity):
1634         (CSSSelector::extractPseudoType):
1635         (CSSSelector::selectorText):
1636         * khtml/css/css_base.h:
1637         (DOM::CSSSelector::):
1638         (DOM::CSSSelector::pseudoType):
1639         * khtml/css/cssstyleselector.cpp:
1640         (khtml::CSSStyleSelector::checkSelector):
1641         (khtml::CSSStyleSelector::checkOneSelector):
1642         * khtml/css/parser.y:
1643
1644 2005-06-11  Maciej Stachowiak  <mjs@apple.com>
1645
1646         Patch from Timothy Hatcher  <timothy@colloquy.info>, reviewed by me.
1647
1648         Test cases added:
1649         * layout-tests/fast/dom/children-nodes-expected.txt: Added.
1650         * layout-tests/fast/dom/children-nodes.html: Added.
1651
1652         * khtml/html/html_miscimpl.cpp:
1653         (DOM::HTMLCollectionImpl::traverseNextItem): For "children"
1654         collection, use nextSibling() instead of traverseNextNext() to avoid
1655         doing deep traversal.
1656
1657 2005-06-11  Maciej Stachowiak  <mjs@apple.com>
1658
1659         Added missing expected results from the background image patch.
1660
1661         * layout-tests/fast/backgrounds/001-expected.txt: Added.
1662
1663 2005-06-10  David Hyatt  <hyatt@apple.com>
1664
1665         Fix for bugzilla bug 3335, add support for the CSS3 indirect adjacent sibling selector.  Patch merge
1666         from KHTML tree by Nick Shanks.
1667         
1668         Reviewed by hyatt
1669
1670         Test cases added: fast/selectors/046.html
1671
1672         * khtml/css/css_base.cpp:
1673         (CSSSelector::selectorText):
1674         * khtml/css/css_base.h:
1675         (DOM::CSSSelector::):
1676         * khtml/css/cssstyleselector.cpp:
1677         (khtml::CSSStyleSelector::checkSelector):
1678         * khtml/css/parser.y:
1679         * layout-tests/fast/selectors/046-expected.txt: Added.
1680         * layout-tests/fast/selectors/046.html: Added.
1681
1682 2005-06-10  David Hyatt  <hyatt@apple.com>
1683
1684         Fix for 3237, background image repeats when it shouldn't.  The Radar bug is 4005553.  Patch from
1685         Nate Cook.
1686         
1687         Reviewed by darin and hyatt
1688
1689         Test cases added: fast/backgrounds/001.html
1690
1691         * khtml/rendering/render_box.cpp:
1692         (RenderBox::paintBackgroundExtended):
1693         * layout-tests/fast/backgrounds/001.html: Added.
1694
1695 2005-06-10  David Hyatt  <hyatt@apple.com>
1696
1697         Merge Allan Jensen's fix for 3236.
1698         
1699         Reviewed by hyatt
1700
1701         Test cases added: None, test case already added for the bug.
1702
1703         * khtml/css/cssstyleselector.cpp:
1704         (khtml::CSSStyleSelector::applyProperty):
1705         * khtml/rendering/render_style.cpp:
1706         (RenderStyle::setContent):
1707
1708 2005-06-10  Darin Adler  <darin@apple.com>
1709
1710         Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
1711         Refined and reviewed by me.
1712
1713         - test for exception file/line number fix
1714           http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
1715
1716         * layout-tests/fast/js/exception-linenums-expected.txt: Added.
1717         * layout-tests/fast/js/exception-linenums.html: Added.
1718
1719 2005-06-09  David Hyatt  <hyatt@apple.com>
1720
1721         Fix from Carston Guenther for bugzilla bug 3236.
1722
1723         attr(x) should work even if x is not present on the element.
1724
1725         This is Radar bug #3584466
1726         
1727         Reviewed by hyatt
1728
1729         Test cases added: fast/css-generated-content/013.html
1730
1731         * khtml/css/cssstyleselector.cpp:
1732         (khtml::CSSStyleSelector::applyProperty):
1733         * layout-tests/fast/css-generated-content/013-expected.txt: Added.
1734         * layout-tests/fast/css-generated-content/013.html: Added.
1735
1736 2005-06-09  Darin Adler  <darin@apple.com>
1737
1738         Tested by Mark Rowe.
1739
1740         * layout-tests/fast/js/date-parse-test.html: Updated this test to use a time zone offset
1741         for one of the test cases that's time zone dependent; was working in CA, US, failing in NZ.
1742
1743 2005-06-08  Anders Carlsson  <andersca@mac.com>
1744
1745         Reviewed and committed by Maciej.
1746
1747         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3337
1748         (Support the Mozilla DOMParser and XMLSerializer objects)
1749
1750         <rdar://problem/3533735> implement Mozilla "DOMParser" extension for use with XMLHTTPRequest
1751
1752         Test cases added:
1753         * layout-tests/fast/dom/dom-parse-serialize-display-expected.txt: Added.
1754         * layout-tests/fast/dom/dom-parse-serialize-display.html: Added.
1755         * layout-tests/fast/dom/dom-parse-serialize-expected.txt: Added.
1756         * layout-tests/fast/dom/dom-parse-serialize.html: Added.
1757
1758         * khtml/ecma/domparser.h:
1759         * khtml/ecma/domparser.cpp:
1760         Add files implementing the DOMParser object.
1761
1762         * khtml/ecma/kjs_window.h:
1763         * khtml/ecma/kjs_window.cpp:
1764         Expose DOMParser object.
1765         
1766 2005-06-07  David Hyatt  <hyatt@apple.com>
1767
1768         Patch from Brian Campbell.  Make sure the min and max values of slider properly update.
1769         Fixes bugilla bug 3323, internal Radar # is 4098892.
1770         
1771         Reviewed by hyatt
1772
1773         Test cases added: (Not testable with a layout test)
1774
1775         * kwq/KWQSlider.mm:
1776         (QSlider::setMinValue):
1777         (QSlider::setMaxValue):
1778
1779 2005-06-07  Adele Peterson  <adele@apple.com>
1780
1781         Change by Darin, reviewed by Maciej and me.
1782
1783         - fixed <rdar://problem/4139800> REGRESSION: Safari crashes at bebe.com
1784
1785         There were cases where the DOMNode mark function would end up not even
1786         marking the node that it was called on. The old code tried to skip any
1787         subtrees that were already marked, but that code was wrong.
1788
1789         * khtml/ecma/kjs_dom.cpp: (KJS::DOMNode::mark): Changed three things:
1790           1) Instead of a boolean, keep a set of trees that we are marking, that
1791              prevents problems if we mark things that have references between
1792              separate trees of DOM nodes.
1793           2) Don't do the "outermost node with a wrapper" check, just start marking
1794              at the root of the entire tree, because there's no way to have an
1795              unreachable node pointing to a reachable node.
1796           3) Handle the unusual case where the document's wrapper dictionary is
1797              gone by marking just this node explicitly.
1798         This passes the layout tests, still fixes the Dashboard memory leak from
1799         bug 4125222, and makes bebe.com work again.
1800
1801 2005-06-07  Darin Adler  <darin@apple.com>
1802
1803         Change by Toby Peterson <toby@opendarwin.org>.
1804         Reviewed by me.
1805
1806         * WebCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
1807         with a different name.
1808
1809 2005-06-07  Darin Adler  <darin@apple.com>
1810
1811         Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
1812         Reviewed by me.
1813
1814         - fixed the WebCore half of build failure with spaces in the path
1815           http://bugzilla.opendarwin.org/show_bug.cgi?id=3291
1816
1817         * WebCore.pbproj/project.pbxproj: Add quotes to make LIBRARY_SEARCH_PATHS work even when
1818         the path has a space in it.
1819
1820 2005-06-07  David Hyatt  <hyatt@apple.com>
1821
1822         Patch from Mark Rowe to fix a minor memory leak in WebCoreSettings.
1823         
1824         Reviewed by hyatt
1825
1826         * kwq/WebCoreSettings.mm:
1827         (-[WebCoreSettings dealloc]):
1828
1829 2005-06-04  Darin Adler  <darin@apple.com>
1830
1831         Reviewed by Maciej.
1832
1833         - import icu headers into project
1834
1835         * WebCore.pbproj/project.pbxproj: Added icu directory to header search path.
1836
1837         * icu/README: Added.
1838         * icu/unicode/parseerr.h: Added.
1839         * icu/unicode/platform.h: Added.
1840         * icu/unicode/putil.h: Added.
1841         * icu/unicode/ubrk.h: Added.
1842         * icu/unicode/uchar.h: Added.
1843         * icu/unicode/uconfig.h: Added.
1844         * icu/unicode/uenum.h: Added.
1845         * icu/unicode/uidna.h: Added.
1846         * icu/unicode/uiter.h: Added.
1847         * icu/unicode/uloc.h: Added.
1848         * icu/unicode/umachine.h: Added.
1849         * icu/unicode/urename.h: Added.
1850         * icu/unicode/ustring.h: Added.
1851         * icu/unicode/utf.h: Added.
1852         * icu/unicode/utf16.h: Added.
1853         * icu/unicode/utf8.h: Added.
1854         * icu/unicode/utf_old.h: Added.
1855         * icu/unicode/utypes.h: Added.
1856         * icu/unicode/uversion.h: Added.
1857
1858 2005-06-01  Darin Adler  <darin@apple.com>
1859
1860         Reviewed by John Sullivan.
1861         No layout tests added because showModalDialog won't work in DumpRenderTree at the moment.
1862
1863         - WebKit part of fix for <rdar://problem/3166090> add IE JavaScript extension window.showModalDialog
1864
1865         * khtml/ecma/kjs_window.cpp:
1866         (KJS::allowPopUp): Added. Used by showModalDialog now and should be used by window.open later.
1867         (KJS::parseFeatures): Ditto.
1868         (KJS::boolFeature): Ditto.
1869         (KJS::intFeature): Ditto.
1870         (KJS::createNewWindow): Ditto.
1871         (KJS::canShowModalDialog): Added.
1872         (KJS::canShowModalDialogNow): Added.
1873         (KJS::showModalDialog): Added.
1874         (KJS::Window::get): Return the showModalDialog function object if the extension can run modal.
1875         (KJS::Window::clear): Add code to store the return value for the case where the window is a modal dialog.
1876         (KJS::WindowFunc::tryCall): Add the call to the showModalDialog function.
1877
1878         * khtml/ecma/kjs_window.h: Add setReturnValueSlot function so showModalDialog can get the return
1879         value from the dialog it creates. Also add a data member to keep track of the pointer and a constant
1880         for the ShowModalDialog method.
1881
1882         * khtml/khtml_part.h: Added new changeLocation member function. Made setOpener, openedByJS, and
1883         setOpenedByJS public.
1884
1885         * khtml/khtml_part.cpp:
1886         (KHTMLPart::changeLocation): Broke out the part of slotRedirect that actually does the location change
1887         into a separate function so it can be called when needed. The case using it now is to load the content
1888         of a new window in KJS::createNewWindow.
1889         (KHTMLPart::slotRedirect): Call changeLocation to do most of the work.
1890         (KHTMLPart::urlSelected): Fixed a broken case where the "lack of referrer" in a new window would cause
1891         the referrer passed in by JavaScript to be ignored when opening a new window -- match logic elsewhere
1892         that leaves the referrer in the args alone if one is not set in the window.
1893
1894         * khtml/khtmlpart_p.h: Initialize m_bCleared to true to avoid an unnecessary clear before loading the
1895         first URL in a new window. This change is needed to avoid blowing away the "dialogArguments" value in
1896         a modal dialog window, but it also avoid unnecessary work for each new window.
1897
1898         * kwq/KWQApplication.h: Add availableGeometry function for QDesktopWidget. Used by the showModalDialog
1899         function inside kjs_window.cpp (and should be used elsewhere eventually too). Matches a Qt function that
1900         we just didn't have implemented before.
1901         * kwq/KWQApplication.mm: (QDesktopWidget::availableGeometry): Added.
1902
1903         * kwq/KWQKHTMLPartBrowserExtension.h: Added new canRunModal, canRunModalNow, and runModal functions.
1904         * kwq/KWQKHTMLPartBrowserExtension.mm:
1905         (KHTMLPartBrowserExtension::createNewWindow): Call createModalDialogWithURL on the bridge if the
1906         new window is a dialog. Also fixed the early return case for when the bridge returns nil.
1907         (KHTMLPartBrowserExtension::canRunModal): Added. Calls bridge.
1908         (KHTMLPartBrowserExtension::canRunModalNow): Ditto.
1909         (KHTMLPartBrowserExtension::runModal): Ditto.
1910
1911         * kwq/KWQKPartsBrowserExtension.h:
1912         (KParts::URLArgs::URLArgs): Initialize m_lockHistory to false.
1913         (KParts::WindowArgs::WindowArgs): Add a dialog boolean.
1914
1915         * kwq/WebCoreBridge.h: Declared canRunModal, canRunModalNow, createModalDialogWithURL, and runModal methods.
1916
1917 2005-06-01  Adele Peterson  <adele@apple.com>
1918
1919         fix for <rdar://problem/4135705> REGRESSION (412-TOT) crash in TV Tracker widget - KJS::XMLHttpRequest::removeFromRequestsByDocument()
1920
1921         Reviewed by Darin.
1922
1923         Synchronous loads don't get added to our requestsByDocument dictionary, so we should try to remove the request in this case. 
1924
1925         * khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequest::removeFromRequestsByDocument): added checks to make sure request exists before trying to remove it.
1926
1927 2005-05-30  Darin Adler  <darin@apple.com>
1928
1929         Reviewed by John (fix for Radar bug) and Vicki (all the rest).
1930
1931         - fixed <rdar://problem/4105097> REGRESSION (138-139): Hitting Enter on a checkbox toggles check mark instead of submitting form
1932         - fixed other problems discovered while trying to make a layout test to test this work:
1933             - added newer DOM 3 event type constants
1934             - fixed prototype setup bug preventing event initialization functions from being called
1935             - fixed bug where any function taking an event parameter would crash with a nil-deref
1936             - fixed incorrect ref/deref bug in MutationEventImpl that would cause a crash crash
1937
1938         Test cases added:
1939         * layout-tests/fast/forms/check-box-enter-key-expected.txt: Added.
1940         * layout-tests/fast/forms/check-box-enter-key.html: Added.
1941         * layout-tests/fast/events/event-creation-expected.txt: Added.
1942         * layout-tests/fast/events/event-creation.html: Added.
1943
1944         * khtml/html/html_formimpl.cpp: (DOM::HTMLInputElementImpl::defaultEventHandler): Separate the checks for
1945         the space bar and the Enter key and make Enter submit the form on a check box or radio button.
1946
1947         * khtml/ecma/kjs_events.cpp:
1948         (KJS::toEvent): Fixed bug where this was checking for DOMNode rather than DOMEvent, so always returning 0.
1949         Without this, both test cases above will crash.
1950         (KJS::DOMUIEvent::DOMUIEvent): Set prototype; without this, the event-creation test case will fail.
1951         (KJS::DOMMouseEvent::DOMMouseEvent): Set prototype; without this, the event-creation test case will fail.
1952         (KJS::DOMKeyboardEvent::DOMKeyboardEvent): Set prototype; without this, both test cases above will fail.
1953         (KJS::DOMMutationEvent::DOMMutationEvent): Set prototype; without this, both test cases above will fail.
1954
1955         * khtml/xml/dom2_eventsimpl.cpp:
1956         (MutationEventImpl::MutationEventImpl): Fix typo where the wrong object was ref'd.
1957         (MutationEventImpl::initMutationEvent): Ditto. This was causing the layout tests to crash with the new tests above.
1958
1959         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::createEvent): Added new event types to match the current DOM
1960         Level 3 specification. The test above tests both the new event types and the old ones.
1961
1962 2005-05-30  Darin Adler  <darin@apple.com>
1963
1964         Reviewed by John.
1965         No test case added because our layout test system doesn't allow us to do inline input.
1966
1967         - fixed <rdar://problem/4094066> REGRESSION (1.2.5-1.3): unconfirmed inline input is ignored in <textarea>, lost when form is submitted
1968
1969         * kwq/KWQTextArea.mm: (-[KWQTextArea _createTextView]): Call setWantsNotificationForMarkedText:YES.
1970
1971 2005-05-30  Maciej Stachowiak  <mjs@apple.com>
1972
1973         Reviewed by Darin.
1974
1975         - fixed <rdar://problem/4125222> Dashboard heap size grows over time (leak caused by JavaScript DOM node wrappers?)
1976
1977         - changed per-document DOMObject caching to work with DOMNodes, since that is all it was used for anyway.
1978         
1979         Test cases added: (these tests actually ensure that DOM wrappers
1980         are sufficiently protected from GC to match other browsers, they
1981         do not verify that the leak is fixed since there's no way to test
1982         that with layout tests).
1983
1984         * layout-tests/fast/dom/gc-1-expected.txt: Added.
1985         * layout-tests/fast/dom/gc-1.html: Added.
1986         * layout-tests/fast/dom/gc-2-expected.txt: Added.
1987         * layout-tests/fast/dom/gc-2.html: Added.
1988         * layout-tests/fast/dom/gc-3-expected.txt: Added.
1989         * layout-tests/fast/dom/gc-3.html: Added.
1990
1991         * khtml/ecma/kjs_binding.cpp:
1992         (KJS::ScriptInterpreter::forgetDOMObjectForDocument): New function - allows nodes
1993         that get removed from the document to go away from the cache if not referenced.
1994         (KJS::ScriptInterpreter::mark): Don't mark nodes that aren't in the document,
1995         they can stay in the cache but only if they have another source of life.
1996         (KJS::ScriptInterpreter::domNodesPerDocument): Renamed and changed parameter types.
1997         (KJS::ScriptInterpreter::getDOMNodeForDocument): Renamed and changed parameter types.
1998         (KJS::ScriptInterpreter::forgetDOMNodeForDocument): Renamed and changed parameter types.
1999         (KJS::ScriptInterpreter::putDOMNodeForDocument): Renamed and changed parameter types.
2000         (KJS::ScriptInterpreter::forgetAllDOMNodesForDocument): Renamed and changed parameter types.
2001         (KJS::ScriptInterpreter::updateDOMNodeDocument): Renamed and changed parameter types.
2002         * khtml/ecma/kjs_binding.h:
2003         * khtml/ecma/kjs_dom.cpp: 
2004         (KJS::DOMNode::~DOMNode): call forgetDOMObjectForDocument.
2005         (KJS::DOMNode::mark): If the node is not in the document, make sure to mark
2006         all wrappers in its detached piece of the tree.
2007         (KJS::getDOMNode): Updated for renames
2008         * khtml/ecma/kjs_dom.h:
2009         * khtml/xml/dom_docimpl.cpp:
2010         (DocumentImpl::~DocumentImpl): Updated for renames.
2011         * khtml/xml/dom_nodeimpl.cpp:
2012         (NodeImpl::checkAddChild): Updated for renames.
2013
2014 2005-05-30  Darin Adler  <darin@apple.com>
2015
2016         Reviewed by John.
2017         Could not figure out how to make an <object> fallback, so for now, no layout test.
2018
2019         - fixed <rdar://problem/4134124> REGRESSION (tip of tree): crash in QWidget::getView handling onunload event (yahoo.com)
2020
2021         * khtml/html/html_objectimpl.cpp: (DOM::HTMLObjectElementImpl::getObjectInstance):
2022         Check type of RenderObject to be sure it is a RenderWidget before calling widget() on it.
2023
2024 2005-05-27  Adele Peterson  <adele@apple.com>
2025
2026         Change by Darin, reviewed by me.
2027
2028         fix for <rdar://problem/4067761> 8A425: reload stock widget over and over and crash in XMLHttpRequest::changeState
2029
2030         * khtml/khtml_part.cpp: (KHTMLPart::closeURL): now cancels XMLHttpRequests
2031         * khtml/ecma/xmlhttprequest.h: Added cancelRequests, addToRequestsByDocument, and RemoveFromRequestsByDocument methods. Added requestsByDocument dictionary.
2032         * khtml/ecma/xmlhttprequest.cpp:
2033         (KJS::XMLHttpRequest::send): calls addToRequestsByDocument
2034         (KJS::XMLHttpRequest::abort): calls removeFromRequestsByDocument
2035         (KJS::XMLHttpRequest::slotFinished): calls removeFromRequestsByDocument
2036         (KJS::XMLHttpRequest::requestsByDocument):  creates dictionary to manage requests.
2037         (KJS::XMLHttpRequest::addToRequestsByDocument): adds this request to dict.
2038         (KJS::XMLHttpRequest::removeFromRequestsByDocument): removes this request from dict.
2039         (KJS::XMLHttpRequest::cancelRequests): goes and cancels requests in the doc
2040
2041 2005-05-27  Adele Peterson  <adele@apple.com>
2042
2043         Reviewed by me, done by Darin.
2044
2045         - Darin fixed a regression I found from Darin's recent DOM change that broke GMail
2046
2047         * khtml/ecma/kjs_window.cpp:
2048         (KJS::Window::get): Added nil check for document.
2049         (KJS::Window::hasProperty): Ditto.
2050
2051         Test cases added: None (Darin should write one).
2052
2053 2005-05-27  Adele Peterson  <adele@apple.com>
2054
2055         Reviewed by Darin.
2056
2057         fix for <rdar://problem/4121747> Cannot log into Cingular.com account page (load event delivered while still processing incoming data)
2058        
2059         * khtml/misc/loader.cpp:
2060         (DocLoader::DocLoader): Initialized m_loadInProgress to false.
2061         (DocLoader::setLoadInProgress): Added.
2062         (Loader::slotFinished): sets the m_loadInProgress flag to reflect the fact that we're not really done loading this request until we emit the signal with the request status.
2063         (Loader::numRequests): If there's a load in progress, we increment the number of requests so it doesn't seem like the load is done.
2064         * khtml/misc/loader.h: (khtml::DocLoader::loadInProgress): Added.
2065
2066         Test cases added: 
2067         * layout-tests/fast/loader/loadInProgress.html: Added
2068         * layout-tests/fast/loader/loadInProgress-expected.html: Added
2069
2070 2005-05-27  Darin Adler  <darin@apple.com>
2071
2072         Reviewed by Vicki.
2073
2074         - fixed <rdar://problem/4125212> form submission delayed until you are on the next page on XML/XSL page (security hole)
2075
2076         * khtml/xsl/xslt_processorimpl.cpp: (DOM::XSLTProcessorImpl::documentFromXMLDocPtr):
2077         Call setParsing(false) explicitly here. It's really annoying that setParsing(true) is done
2078         inside DOM::DocumentImpl and setParsing(false) is done by KHTMLPart, so that should be fixed
2079         some day, but for now this is the way to do it.
2080
2081         Test cases added:
2082         * layout-tests/fast/events/xsl-onload-expected.txt: Added.
2083         * layout-tests/fast/events/xsl-onload.xhtml: Added.
2084         * layout-tests/fast/events/xsl-onload.xsl: Added.
2085
2086 2005-05-27  John Sullivan  <sullivan@apple.com>
2087
2088         Reviewed by Darin
2089
2090         * WebCore-tests.exp:
2091         took out symbol __ZNK5QChar7isPunctEv; it was obsolete and causing build trouble
2092
2093 2005-05-27  Darin Adler  <darin@apple.com>
2094
2095         Reviewed by Adele.
2096
2097         - remove HAVE_ICU_LIBRARY ifdefs
2098
2099         * khtml/rendering/render_text.cpp: Just use ICU all the time; no ifdef.
2100         * kwq/KWQKURL.mm: Ditto.
2101
2102 2005-05-26  Darin Adler  <darin@apple.com>
2103
2104         Reviewed by me, patch by Mitz Pettel.
2105
2106         - fixed <rdar://problem/4106907> bidi algorithm bug fixed for KHTML should be fixed in WebCore too
2107
2108         * khtml/rendering/bidi.cpp: (khtml::RenderBlock::bidiReorderLine): Integrated the patch that Mitz did
2109         for the KDE bug, details at <http://www.mitzpettel.com/software/WebCorePatch2.html>.
2110
2111         Test cases added:
2112         * layout-tests/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt: Added.
2113         * layout-tests/fast/text/international/bidi-neutral-directionality-paragraph-start.html: Added.
2114
2115 2005-05-26  Darin Adler  <darin@apple.com>
2116
2117         Reviewed by Richard and Dave Harrison.
2118         No new test cases needed for this change.
2119
2120         - eliminate WebCoreUnicode and use ICU directly instead
2121         - fixed compiling with gcc 4.0 (was broken for Development only)
2122
2123         * WebCore.exp: Removed the WebCoreXXXFunction exports.
2124         * WebCore-tests.exp: Removed some QChar functions that are now inlines.
2125         Removed some typeinfo exports that are no longer appropriate since we use -fno-rtti.
2126
2127         * kwq/KWQString.h:
2128         (QChar::isDigit): Changed to call u_isdigit when non-ASCII. We should probably phase
2129         this out since it's only used in places where we don't want to handle non-ASCII decimal digits.
2130         (QChar::isLetter): Changed to call u_isalpha when non-ASCII.
2131         (QChar::isNumber): Changed to call u_isdigit when non-ASCII. This probably should be removed, since
2132         we always want to call isDigit instead.
2133         (QChar::isLetterOrNumber): Changed to call u_isalnum when non-ASCII.
2134         (QChar::isPunct): Changed to call u_ispunct when non-ASCII.
2135         (QChar::digitValue): Changed to call u_charDigitValue when not '0'-'9'. We should probably phase
2136         this out since it's only used in places where we don't want to handle non-ASCII decimal digits.
2137         (QChar::lower): Changed to call u_tolower when non-ASCII.
2138         (QChar::upper): Changed to call u_toupper when non-ASCII.
2139         (QChar::direction): Made inline. Calls u_charDirection.
2140         (QChar::mirrored): Made inline. Calls u_isMirrored.
2141         (QChar::mirroredChar): Made inline. Calls u_charMirror.
2142
2143         * kwq/KWQChar.mm: Removed.
2144         * kwq/WebCoreUnicode.cpp: Removed.
2145         * kwq/WebCoreUnicode.h: Removed.
2146
2147         * WebCore.pbproj/project.pbxproj: Removed files.
2148
2149 2005-05-26  David Harrison  <harrison@apple.com>
2150
2151         Reviewed by John.
2152
2153         <rdar://problem/4120518> Mail: control-T in an empty message crashes mail
2154         
2155         * kwq/WebCoreBridge.mm:
2156         (-[WebCoreBridge rangeOfCharactersAroundCaret]):
2157         Nil-check result of VisiblePosition previous() and next().
2158
2159         * khtml/editing/visible_position.cpp:
2160         (khtml::VisiblePosition::previous):
2161         (khtml::VisiblePosition::previousVisiblePosition):
2162         Make sure previous() does not return the original position.  Also, simplified.
2163         Commented odd, but required, behavior in previousVisiblePosition().
2164
2165         * khtml/editing/visible_units.cpp:
2166         (khtml::startOfEditableContent):
2167         (khtml::endOfEditableContent):
2168         Removed redundant check for isEditableContent().
2169         
2170         * khtml/editing/jsediting.cpp:
2171         * khtml/khtml_part.cpp:
2172         (KHTMLPart::transpose):
2173         * khtml/khtml_part.h:
2174         * kwq/KWQKHTMLPart.h:
2175         * kwq/KWQKHTMLPart.mm:
2176         (KWQKHTMLPart::issueTransposeCommand):
2177         * layout-tests/editing/editing.js:
2178         * kwq/WebCoreBridge.h:
2179         Add support for transpose command in JavaScript and therefore layout tests.
2180         
2181         * layout-tests/editing/deleting/transpose-empty-expected.txt: Added.
2182         * layout-tests/editing/deleting/transpose-empty.html: Added.
2183         New test for this bug.
2184         
2185 2005-05-24  Richard Williamson   <rjw@apple.com>
2186
2187         Fixed <rdar://problem/4127061> <canvas> backing store should be zero filled
2188
2189         Use calloc instead of malloc to ensure zero filled backing store.
2190
2191         Reviewed by Darin.
2192
2193         * khtml/rendering/render_canvasimage.cpp:
2194         (RenderCanvasImage::createDrawingContext):
2195
2196 2005-05-24  John Sullivan  <sullivan@apple.com>
2197
2198         Reviewed by Dave Hyatt.
2199         
2200         - fixed these bugs:
2201         <rdar://problem/4118510> Textareas with a vertical scroll bar should have their resize corner under the scroll bar
2202         <rdar://problem/4118523> Resize image in textareas is drawn repeatedly when scrolling vertically with scrollbar
2203
2204         Test cases added: none; doesn't affect page layout
2205
2206         * kwq/KWQTextArea.h:
2207         added inInitWithFrame ivar
2208         * kwq/KWQTextArea.mm:
2209         (+[KWQTextArea _resizeCornerImage]):
2210         moved here from KWQTextAreaTextView; now it's a class method so we only look up the image once.
2211         (-[KWQTextArea initWithFrame:]):
2212         set and clear inInitWithFrame ivar, used by -tile
2213         (-[KWQTextArea _isResizableByUser]):
2214         renamed with an underscore for consistency
2215         (-[KWQTextArea _textViewShouldHandleResizing]):
2216         new method, returns YES if the textarea is user-resizable and the enclosed textview is responsible for drawing
2217         and tracking the resize corner.
2218         (-[KWQTextArea tile]):
2219         shrink the vertical scroller if appropriate to account for the resize corner
2220         (-[KWQTextArea _resizeCornerRect]):
2221         new method, returns the bottom-right corner rect, where the resize image goes
2222         (-[KWQTextArea _trackResizeFromMouseDown:]):
2223         moved here from KWQTextAreaTextView. The only changes were to move the [NSCursor set] call inside here (was in
2224         the caller), and to use self where it was using [self _enclosingTextArea], and to move a comment in here that
2225         was in the caller
2226         (-[KWQTextArea mouseDown:]):
2227         track resizing if appropriate
2228         (-[KWQTextArea drawRect:]):
2229         draw the resize corner if appropriate
2230         (-[KWQTextAreaTextView _resizeCornerRect]):
2231         get the resize image from KWQTextArea
2232         (-[KWQTextAreaTextView resetCursorRects]):
2233         check _textViewShouldHandleResizing
2234         (-[KWQTextAreaTextView drawRect:]):
2235         ditto
2236         (-[KWQTextAreaTextView mouseDown:]):
2237         ditto; also, make the textarea handle the resize tracking now
2238
2239 2005-05-24  Darin Adler  <darin@apple.com>
2240
2241         - another gcc 4.0 fix
2242
2243         No new test cases needed.
2244
2245         * khtml/dom/dom2_events.cpp: Moved constants out of the KHTML_NO_CPLUSPLUS_DOM #if.
2246
2247 2005-05-24  Darin Adler  <darin@apple.com>
2248
2249         Reviewed by Vicki.
2250
2251         - fixed <rdar://problem/4128727> many DOM classes not exported (can't add categories or do other things that require class name linking)
2252
2253         No new test cases needed.
2254
2255         * WebCore.exp: Added exports for many classes in the public DOM headers that were omitted before.
2256         Also removed one symbol that was listed twice.
2257
2258 2005-05-24  Maciej Stachowiak  <mjs@apple.com>
2259
2260         Reviewed by John.
2261
2262         - fixed <rdar://problem/3598589> onunload handler doesn't fire when a window is closed
2263
2264         Test cases added: 
2265         * layout-tests/fast/events/onunload-expected.txt: Added.
2266         * layout-tests/fast/events/onunload.html: Added.
2267
2268         * khtml/xml/dom_docimpl.cpp:
2269         (DocumentImpl::detach): Don't remove all event handlers from the document here...
2270         * khtml/khtml_part.cpp:
2271         (KHTMLPart::closeURL): ...instead do it here, after firing the unload event, but only
2272         if the document is not in the back/forward cache...
2273         * kwq/KWQPageState.mm:
2274         (-[KWQPageState finalize]): ...and take care of the back/forward cache case here.
2275
2276 2005-05-24  John Sullivan  <sullivan@apple.com>
2277
2278         Reviewed by Kevin.
2279         
2280         - WebCore part of <rdar://problem/4125783> WebKit needs a way to control whether textareas are resizable
2281
2282         * kwq/KWQKHTMLSettings.h:
2283         (KHTMLSettings::textAreasAreResizable):
2284         new getter
2285         (KHTMLSettings::setTextAreasAreResizable):
2286         new setter
2287         
2288         * kwq/KWQTextArea.h:
2289         * kwq/KWQTextArea.mm:
2290         eliminated ALLOW_RESIZING_TEXT_AREAS #define in favor of using runtime setting
2291         (-[KWQTextArea isResizableByUser]):
2292         get value from settings, and cache it in KWQTextArea instance
2293         (-[KWQTextAreaTextView _enclosingTextArea]):
2294         new convenience method, extracted from _trackResizeFromMouseDown:
2295         (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
2296         now uses extracted method
2297         
2298         (-[KWQTextAreaTextView drawRect:]):
2299         now checks isResizableByUser
2300         (-[KWQTextAreaTextView mouseDown:]):
2301         ditto
2302         
2303         * kwq/WebCoreSettings.h:
2304         * kwq/WebCoreSettings.mm:
2305         (-[WebCoreSettings setTextAreasAreResizable:]):
2306         new setter
2307         (-[WebCoreSettings textAreasAreResizable]):
2308         new getter
2309
2310 2005-05-23  Maciej Stachowiak  <mjs@apple.com>
2311
2312         Reviewed by John.
2313
2314         - split remaining editing command classes out of htmlediting.cpp
2315         - rename InsertParagraphSeparatorInQuotedContentCommand to BreakBlockquoteCommand
2316
2317         No layout tests needed - this is a pure refactoring change.
2318         
2319         * WebCore.pbproj/project.pbxproj:
2320         * khtml/editing/apply_style_command.cpp:
2321         * khtml/editing/break_blockquote_command.cpp: Added.
2322         * khtml/editing/break_blockquote_command.h: Added.
2323         * khtml/editing/composite_edit_command.cpp:
2324         * khtml/editing/delete_selection_command.cpp:
2325         * khtml/editing/edit_command.cpp:
2326         * khtml/editing/htmlediting.cpp:
2327         * khtml/editing/htmlediting.h:
2328         * khtml/editing/insert_line_break_command.cpp: Added.
2329         * khtml/editing/insert_line_break_command.h: Added.
2330         * khtml/editing/insert_paragraph_separator_command.cpp: Added.
2331         * khtml/editing/insert_paragraph_separator_command.h: Added.
2332         * khtml/editing/insert_text_command.cpp: Added.
2333         * khtml/editing/insert_text_command.h: Added.
2334         * khtml/editing/join_text_nodes_command.cpp: Added.
2335         * khtml/editing/join_text_nodes_command.h: Added.
2336         * khtml/editing/merge_identical_elements_command.cpp: Added.
2337         * khtml/editing/merge_identical_elements_command.h: Added.
2338         * khtml/editing/move_selection_command.cpp: Added.
2339         * khtml/editing/move_selection_command.h: Added.
2340         * khtml/editing/rebalance_whitespace_command.cpp: Added.
2341         * khtml/editing/rebalance_whitespace_command.h: Added.
2342         * khtml/editing/remove_css_property_command.cpp: Added.
2343         * khtml/editing/remove_css_property_command.h: Added.
2344         * khtml/editing/remove_node_attribute_command.cpp: Added.
2345         * khtml/editing/remove_node_attribute_command.h: Added.
2346         * khtml/editing/remove_node_command.cpp: Added.
2347         * khtml/editing/remove_node_command.h: Added.
2348         * khtml/editing/remove_node_preserving_children_command.cpp: Added.
2349         * khtml/editing/remove_node_preserving_children_command.h: Added.
2350         * khtml/editing/replace_selection_command.cpp: Added.
2351         * khtml/editing/replace_selection_command.h: Added.
2352         * khtml/editing/set_node_attribute_command.cpp: Added.
2353         * khtml/editing/set_node_attribute_command.h: Added.
2354         * khtml/editing/split_element_command.cpp: Added.
2355         * khtml/editing/split_element_command.h: Added.
2356         * khtml/editing/split_text_node_command.cpp: Added.
2357         * khtml/editing/split_text_node_command.h: Added.
2358         * khtml/editing/split_text_node_containing_element_command.h: Added.
2359         * khtml/editing/typing_command.cpp: Added.
2360         * khtml/editing/typing_command.h: Added.
2361         * khtml/editing/wrap_contents_in_dummy_span_command.cpp: Added.
2362         * khtml/editing/wrap_contents_in_dummy_span_command.h: Added.
2363
2364 2005-05-23  Darin Adler  <darin@apple.com>
2365
2366         * WebCore.exp: Sorted file for more readable diffs.
2367
2368 2005-05-23  Adele Peterson  <adele@apple.com>
2369
2370         Reviewed by Darin.
2371
2372         fix for <rdar://problem/4122661> Regression: 10.3.8-10.3.9: Next lesson doesn't work on Dale Carnegie Action Systems page
2373
2374         * khtml/ecma/kjs_window.cpp: (KJS::WindowFunc::tryCall): added checks for NaN, in case it is passed into window.open for screenx, screeny, left, top, height, or width.
2375
2376 2005-05-23  David Harrison  <harrison@apple.com>
2377
2378         Reviewed by Darin.
2379
2380         Prevent crash when going from no selection to selection with mispelling checks enabled.
2381                 
2382         * kwq/KWQKHTMLPart.mm:
2383         (KWQKHTMLPart::markMisspellings):
2384         Repair check for null searchRange.  Was inadvertently broken in recent checkin.
2385
2386 2005-05-23  John Sullivan  <sullivan@apple.com>
2387
2388         Reviewed by Dave Hyatt.
2389         
2390         - fixed <rdar://problem/4123592> Can't resize textareas that have a width specified by a style
2391
2392         * kwq/KWQTextArea.mm:
2393         (-[KWQTextArea getNumColumns:andNumRows:forSize:]):
2394         removed this method, which I had added earlier to set cols and rows correctly
2395         (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
2396         set width and height instead of cols and rows; handle the intrinsic margin that sometimes appears
2397         on form elements
2398
2399 2005-05-22  Adele Peterson  <adele@apple.com>
2400
2401         Reviewed by Maciej.
2402
2403         fix for <rdar://problem/4127101> REGRESSION(412-TOT) crash when creating Option element
2404
2405         * khtml/ecma/kjs_html.cpp: (KJS::OptionConstructorImp::construct):
2406         Changed ElementImpl pointer to a SharedPtr because it was getting destroyed before we were done with it.  
2407
2408 2005-05-20  John Sullivan  <sullivan@apple.com>
2409
2410         Reviewed by Chris.
2411         
2412         - fixed <rdar://problem/4126160> Crash sending mouse-exited event after reloading 
2413         page with resizable textarea
2414
2415         * kwq/KWQTextArea.mm:
2416         (-[KWQTextAreaTextView resetCursorRects]):
2417         This was some side effect of tracking rect code used for resizable textareas. I discovered
2418         that I didn't need the tracking rect code at all (at least to achieve the level of only-somewhat-working
2419         cursor behavior that I already had). Removing it caused the bug to vanish.
2420
2421 2005-05-19  Darin Adler  <darin@apple.com>
2422
2423         Reviewed by Maciej.
2424         
2425         - turned off exceptions and RTTI; seems to cut WebCore code size by about 35%
2426
2427         * WebCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for the framework.
2428
2429 2005-05-19  Darin Adler  <darin@apple.com>
2430
2431         Reviewed by Chris Petersen.
2432
2433         - fixed a mistake I introduced in my previous check-in that caused a Deployment build failure
2434
2435         * kwq/DOM.mm: (-[DOMDocument createTreeWalker::::]): Initialize cppFilter to 0, which fixes both
2436         the build failure and a potential bug!
2437
2438 2005-05-17  Darin Adler  <darin@apple.com>
2439
2440         Reviewed by Maciej.
2441         No new layout tests required.
2442
2443         - remove all dependencies on exceptions and RTTI (but don't turn them off yet, that will be in a later patch)
2444
2445         * WebCore.pbproj/project.pbxproj: Set a new KHTML_NO_CPLUSPLUS_DOM define.
2446         Removed all C++ DOM wrapper files that we don't need to compile any more.
2447
2448         * khtml/dom/css_stylesheet.h: Added more KHTML_NO_CPLUSPLUS_DOM checks so we don't include any
2449         headers when including this file.
2450
2451         * khtml/dom/dom2_events.h: Fixed up KHTML_NO_CPLUSPLUS_DOM checks so that everything but EventListener
2452         is turned off when that's on. Also moved the public so that the constants from KeyboardEvent are public.
2453         * khtml/dom/dom2_events.cpp: Put everything except for EventListener inside KHTML_NO_CPLUSPLUS_DOM.
2454
2455         * khtml/dom/dom2_range.h: Added KHTML_NO_CPLUSPLUS_DOM checks so that only the constants are defined,
2456         no classes.
2457
2458         * khtml/dom/dom2_traversal.cpp: Put everything except for NodeFilterCondition inside KHTML_NO_CPLUSPLUS_DOM.
2459
2460         * khtml/dom/dom_node.h: Added more KHTML_NO_CPLUSPLUS_DOM checks so we don't include any
2461         headers when including this file.
2462
2463         * khtml/ecma/kjs_binding.cpp:
2464         (KJS::DOMObject::get): Removed exception-handling code. Now we can eliminate tryGet altogether.
2465         (KJS::DOMObject::put): Ditto.
2466         (KJS::DOMFunction::get): Ditto.
2467         (KJS::DOMFunction::call): Ditto.
2468
2469         * khtml/editing/visible_text.h: Added an include of <qstring.h>.
2470
2471         * khtml/misc/loader.h: Added isKHTMLLoader.
2472         * khtml/misc/loader.cpp: (Loader::isKHTMLLoader): Added. Poor-man's replacement for dynamic_cast.
2473
2474         * khtml/rendering/render_form.h:
2475         * khtml/rendering/render_form.cpp: (RenderFormElement::slotTextChanged): Added. Hack to make KWQSlot work
2476         for this function.
2477
2478         * khtml/xml/dom2_rangeimpl.h: Added a forward declaration of class DOMString, needed now that the C++
2479         DOM wrappers aren't defining it.
2480
2481         * khtml/xml/dom_docimpl.cpp:
2482         (DocumentImpl::defaultEventHandler): Changed to call handleEventImpl so we don't have to make the
2483         C++ DOM wrapper for the event.
2484         * khtml/xml/dom_nodeimpl.cpp:
2485         (NodeImpl::handleLocalEvents): Ditto.
2486         (ContainerNodeImpl::insertBefore): Used SharedPtr<NodeImpl> rather than Node to protect the child node.
2487         (ContainerNodeImpl::replaceChild): Ditto.
2488         (ContainerNodeImpl::appendChild): Ditto.
2489         (ContainerNodeImpl::addChild): Ditto.
2490
2491         * kwq/DOM.mm:
2492         (ObjCNodeFilterCondition::acceptNode): Update to add a KHTML_NO_CPLUSPLUS_DOM check since FilterCondition
2493         has a different API depending on the state.
2494         (-[DOMDocument createNodeIterator::::]): Rewrote to use NodeFilterImpl instead of NodeFilter.
2495         (-[DOMDocument createTreeWalker::::]): Ditto.
2496
2497         * kwq/KWQAccObject.mm:
2498         (-[KWQAccObject role]): Use identifier instead of casting to Node and using elementId.
2499         (-[KWQAccObject title]): Ditto.
2500         (-[KWQAccObject accessibilityIsIgnored]): Ditto.
2501         (-[KWQAccObject rendererForView:]): Ditto.
2502
2503         * kwq/KWQFrame.mm: (QFrame::setFrameStyle): Use isKHTMLView instead of dynamic_cast.
2504
2505         * kwq/KWQKHTMLPart.mm:
2506         (KWQKHTMLPart::currentForm): Use focusNode instead of activeNode.
2507         (KWQKHTMLPart::nextKeyViewInFrame): Use isWidget instead of dynamic_cast.
2508         (KWQKHTMLPart::currentEventIsMouseDownInWidget): Use KHTMLView's nodeUnderMouse instead of our public one
2509         that uses a DOM C++ wrapper.
2510         (KWQKHTMLPart::partForWidget): Use isKHTMLView instead of dynamic_cast.
2511         (KWQKHTMLPart::passSubframeEventToSubframe): Use isWidget instead of dynamic_cast.
2512
2513         * kwq/KWQObject.h: Made isXXX functions all public since we use them in a few more places now.
2514         Also added isKHTMLLoader.
2515         * kwq/KWQObject.mm: (QObject::isKHTMLLoader): Added. Returns false by default.
2516
2517         * kwq/KWQSlot.mm: Removed all uses of dynamic_cast.
2518
2519         * kwq/WebCoreBridge.mm:
2520         (-[WebCoreBridge stringForRange:]): Used plainText instead of text.
2521         (-[WebCoreBridge copyRenderNode:copier:]): Used isWidget instead of dynamic_cast.
2522
2523 2005-05-16  Darin Adler  <darin@apple.com>
2524
2525         - attempt to get things building under "Saffron" development tools
2526
2527         * WebCore.pbproj/project.pbxproj: Use BUILT_PRODUCTS_DIR instead of SYMROOT.
2528
2529 2005-05-16  Adele Peterson  <adele@apple.com>
2530
2531         Changes by Darin. Reviewed by myself.
2532
2533         Changed the Render Tree debug code to write out an indication that the affinity is upstream
2534         when writing out caret position. Updated the one layout test with output affected by the change.
2535         Also updated one test to use the new dumpAsText method in dumpRenderTree.
2536
2537         * kwq/KWQRenderTreeDebug.cpp: (writeSelection): writes out affinity if it's upstream in the caret case
2538         * layout-tests/editing/style/create-block-for-style-004-expected.txt: new results that contain the affinity
2539         * layout-tests/fast/js/char-at.html: now calls layoutController.dumpAsText()
2540         * layout-tests/fast/js/char-at-expected.txt: plain text result (replaces old render tree result)
2541
2542 2005-05-16  Darin Adler  <darin@apple.com>
2543
2544         Reviewed by Adele.
2545
2546         - fixed issues preventing us from compiling with newer versions of gcc 4.0
2547
2548         * khtml/dom/dom2_events.cpp: Add definitions of some static data member constants, as required
2549         by the C++ standard and the gcc 4.0 compiler.
2550
2551         * khtml/editing/selection.h: Specified KHTMLPart friend class as ::KHTMLPart, since if it's
2552         not explicitly qualified, it means DOM::KHTMLPart.
2553
2554         * khtml/dom/dom_string.cpp:
2555         (DOM::strcasecmp): Removed redundant and illegal DOM:: prefix.
2556         (DOM::operator==): Ditto.
2557         * khtml/ecma/kjs_binding.cpp:
2558         (KJS::getStringOrNull): Removed redundant and illegal KJS:: prefix.
2559         (KJS::ValueToVariant): Ditto.
2560         * khtml/ecma/kjs_css.cpp:
2561         (KJS::getCSSRuleConstructor): Ditto.
2562         (KJS::getCSSValueConstructor): Ditto.
2563         (KJS::getCSSPrimitiveValueConstructor): Ditto.
2564         * khtml/ecma/kjs_events.cpp:
2565         (KJS::getEventConstructor): Ditto.
2566         (KJS::getEventExceptionConstructor): Ditto.
2567         (KJS::getMutationEventConstructor): Ditto.
2568         * khtml/ecma/kjs_traversal.cpp:
2569         (KJS::getNodeFilterConstructor): Ditto.
2570
2571         * khtml/misc/loader_client.h: Added an empty virtual destructor to CachedObjectClient
2572         to quiet the compiler. This doesn't really do any good, but also does no harm.
2573         * khtml/misc/loader.cpp: (CachedObjectClient::~CachedObjectClient): Added.
2574
2575         * khtml/rendering/render_block.cpp: (khtml::RenderBlock::fillBlockSelectionGaps):
2576         Initialize a couple of variables that should have been initialized to 0.
2577         Not just about making the compiler happy -- warning found a real bug!
2578
2579         * kwq/KWQTextArea.mm: (RangeOfParagraph): Change else structure to work around compiler
2580         warning bug.
2581
2582 2005-05-13  John Sullivan  <sullivan@apple.com>
2583
2584         * kwq/KWQTextArea.mm:
2585         (-[KWQTextAreaTextView _trackResizeFromMouseDown:]):
2586         added Radar numbers to FIXMEs about resizable textareas
2587         (-[KWQTextAreaTextView resetCursorRects]):
2588         ditto
2589         (-[KWQTextAreaTextView mouseDown:]):
2590         ditto
2591
2592 2005-05-12  Darin Adler  <darin@apple.com>
2593
2594         Reviewed by Chris Blumenberg.
2595
2596         - more "getting off the C++ DOM wrappers" changes
2597           This pass involves replacing uses of DOM::Range with use of DOM::RangeImpl
2598           plus some more use of DOM::DocumentImpl instead of DOM::Document.
2599
2600         * khtml/dom/dom2_range.cpp:
2601         * khtml/dom/dom2_range.h:
2602         * khtml/ecma/kjs_window.cpp:
2603         (KJS::Window::get):
2604         (KJS::WindowFunc::tryCall):
2605         (KJS::Window::updateLayout):
2606         (KJS::ScheduledAction::execute):
2607         (KJS::Selection::toString):
2608         * khtml/ecma/xmlhttprequest.cpp:
2609         (KJS::XMLHttpRequestProtoFunc::tryCall):
2610         * khtml/editing/htmlediting.cpp:
2611         (khtml::InsertLineBreakCommand::doApply):
2612         * khtml/editing/selection.cpp:
2613         (khtml::Selection::Selection):
2614         (khtml::Selection::moveTo):
2615         (khtml::Selection::toRange):
2616         * khtml/editing/selection.h:
2617         * khtml/editing/visible_position.cpp:
2618         (khtml::makeRange):
2619         (khtml::startVisiblePosition):
2620         (khtml::endVisiblePosition):
2621         (khtml::setStart):
2622         (khtml::setEnd):
2623         * khtml/editing/visible_position.h:
2624         * khtml/editing/visible_range.h:
2625         * khtml/editing/visible_text.cpp:
2626         (khtml::TextIterator::TextIterator):
2627         (khtml::TextIterator::range):
2628         (khtml::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
2629         (khtml::SimplifiedBackwardsTextIterator::range):
2630         (khtml::CharacterIterator::CharacterIterator):
2631         (khtml::CharacterIterator::range):
2632         (khtml::WordAwareIterator::WordAwareIterator):
2633         (khtml::WordAwareIterator::advance):
2634         (khtml::TextIterator::rangeLength):
2635         (khtml::TextIterator::rangeFromLocationAndLength):
2636         (khtml::plainText):
2637         (khtml::findPlainText):
2638         * khtml/editing/visible_text.h:
2639         (khtml::WordAwareIterator::range):
2640         * khtml/editing/visible_units.cpp:
2641         (khtml::previousBoundary):
2642         (khtml::nextBoundary):
2643         * khtml/html/html_elementimpl.cpp:
2644         (HTMLElementImpl::innerText):
2645         * khtml/html/htmltokenizer.cpp:
2646         (khtml::HTMLTokenizer::scriptExecution):
2647         * khtml/khtml_part.cpp:
2648         (KHTMLPart::text):
2649         (KHTMLPart::selectedText):
2650         (KHTMLPart::shouldBeginEditing):
2651         (KHTMLPart::shouldEndEditing):
2652         (KHTMLPart::selectionComputedStyle):
2653         * khtml/khtml_part.h:
2654         * khtml/khtmlview.h:
2655         * khtml/rendering/render_text.cpp:
2656         (InlineTextBox::paint):
2657         * khtml/xml/dom2_rangeimpl.cpp:
2658         (DOM::operator==):
2659         (DOM::rangeOfContents):
2660         * khtml/xml/dom2_rangeimpl.h:
2661         (DOM::operator!=):
2662         * khtml/xml/dom_docimpl.cpp:
2663         (DocumentImpl::relinquishesEditingFocus):
2664         (DocumentImpl::acceptsEditingFocus):
2665         (DocumentImpl::addMarker):
2666         (DocumentImpl::removeMarker):
2667         * khtml/xml/dom_docimpl.h:
2668         * khtml/xml/dom_position.cpp:
2669         (DOM::startPosition):
2670         * khtml/xml/dom_position.h:
2671         * kwq/DOMHTML.mm:
2672         (-[DOMHTMLLinkElement href]):
2673         (-[DOMHTMLBaseElement href]):
2674         (-[DOMHTMLInputElement src]):
2675         (-[DOMHTMLAnchorElement href]):
2676         (-[DOMHTMLImageElement src]):
2677         (-[DOMHTMLAreaElement href]):
2678         * kwq/KWQAccObject.mm:
2679         (-[KWQAccObject textUnderElement]):
2680         (-[KWQAccObject value]):
2681         (-[KWQAccObject doAXStringForTextMarkerRange:]):
2682         (-[KWQAccObject doAXAttributedStringForTextMarkerRange:]):
2683         * kwq/KWQKHTMLPart.h:
2684         (KWQKHTMLPart::markedTextRange):
2685         * kwq/KWQKHTMLPart.mm:
2686         (KWQKHTMLPart::findString):
2687         (KWQKHTMLPart::advanceToNextMisspelling):
2688         (KWQKHTMLPart::fontForSelection):
2689         (KWQKHTMLPart::markMisspellings):
2690         (KWQKHTMLPart::respondToChangedSelection):
2691         (KWQKHTMLPart::shouldBeginEditing):
2692         (KWQKHTMLPart::shouldEndEditing):
2693         (convertAttributesToUnderlines):
2694         (KWQKHTMLPart::setMarkedTextRange):
2695         * kwq/WebCoreBridge.mm:
2696         (-[WebCoreBridge elementAtPoint:]):
2697         (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:]):
2698         (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:]):
2699         (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]):
2700         (-[WebCoreBridge selectedDOMRange]):
2701         (-[WebCoreBridge convertToNSRange:DOM::]):
2702         (-[WebCoreBridge convertToDOMRange:]):
2703         (-[WebCoreBridge convertToObjCDOMRange:]):
2704         (-[WebCoreBridge selectNSRange:]):
2705         (-[WebCoreBridge selectedNSRange]):
2706         (-[WebCoreBridge markDOMRange]):
2707         (-[WebCoreBridge markedTextDOMRange]):
2708         (-[WebCoreBridge markedTextNSRange]):
2709         (-[WebCoreBridge replaceMarkedTextWithText:]):
2710         (-[WebCoreBridge smartDeleteRangeForProposedRange:]):
2711         (-[WebCoreBridge dragCaretDOMRange]):
2712         (-[WebCoreBridge editableDOMRangeForPoint:]):
2713         (-[WebCoreBridge rangeOfCharactersAroundCaret]):
2714
2715 2005-05-13  Maciej Stachowiak  <mjs@apple.com>
2716
2717         Reviewed by Dave.
2718
2719         - more splitting up of htmlediting.cpp
2720
2721         * WebCore.pbproj/project.pbxproj:
2722         * khtml/editing/composite_edit_command.cpp:
2723         * khtml/editing/delete_from_text_node_command.cpp: Added.
2724         * khtml/editing/delete_from_text_node_command.h: Added.
2725         * khtml/editing/delete_selection_command.cpp: Added.
2726         * khtml/editing/delete_selection_command.h: Added.
2727         * khtml/editing/htmlediting.cpp:
2728         * khtml/editing/htmlediting.h:
2729         * khtml/editing/insert_into_text_node_command.cpp: Added.
2730         * khtml/editing/insert_into_text_node_command.h: Added.
2731         * khtml/editing/insert_node_before_command.cpp: Added.
2732         * khtml/editing/insert_node_before_command.h: Added.
2733
2734 2005-05-12  Adele Peterson  <adele@apple.com>
2735
2736         Reviewed by Maciej.
2737
2738         fix for  <rdar://problem/4117656> deleting an input element in its onBlur handler crashes Safari
2739
2740         * khtml/rendering/render_form.cpp: (RenderLineEdit::handleFocusOut): added nil check for element
2741
2742 2005-05-12  John Sullivan  <sullivan@apple.com>
2743
2744         Reviewed by Kevin.
2745         
2746         - rolled in changes from experimental-ui-branch to support resizable textareas
2747         and find-as-you-type. The files/functions modified are listed just below. After
2748         that are the ChangeLog comments from the branch.
2749
2750         * Resources/textAreaResizeCorner.tiff: Added.
2751         * WebCore.pbproj/project.pbxproj:
2752         * kwq/KWQKHTMLPart.h:
2753         * kwq/KWQKHTMLPart.mm:
2754         (KWQKHTMLPart::findString):
2755         * kwq/KWQTextArea.mm:
2756         (-[KWQTextArea textDidChange:]):
2757         (-[KWQTextAreaTextView _resizeCornerImage]):
2758         (-[KWQTextAreaTextView _resizeCornerRect]):
2759         (-[KWQTextAreaTextView resetCursorRects]):
2760         (-[KWQTextAreaTextView drawRect:]):
2761         (-[KWQTextAreaTextView mouseDown:]):
2762         * kwq/WebCoreBridge.h:
2763         * kwq/WebCoreBridge.mm:
2764         (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:findInSelection:]):
2765
2766         2005-05-05  John Sullivan  <sullivan@apple.com>
2767
2768                 Reviewed by Chris.
2769
2770                 * kwq/KWQTextArea.mm:
2771                 (-[KWQTextAreaTextView _resizeCornerRect]):
2772                 Get corner rect from enclosing clipView, rather than using visibleRect.
2773                 VisibleRect would return the wrong result when the textarea was clipped
2774                 by the bottom of the window, leading to redraw schmutz among other things.
2775
2776         2005-05-02  John Sullivan  <sullivan@apple.com>
2777
2778                 Reviewed by Chris.
2779                 
2780                 Improvements to resizable textarea experiment:
2781                 - resize image is now drawn in the resize corner
2782                 - cursor sometimes tracks to arrow when over resize corner (but usually not)
2783                 - cursor changes to arrow on mouse down in any case
2784
2785                 * Resources/textAreaResizeCorner.tiff: Added.
2786                 * WebCore.pbproj/project.pbxproj:
2787                 updated for added image file
2788                 
2789                 * kwq/KWQTextArea.mm:
2790                 (-[KWQTextAreaTextView _resizeCornerImage]):
2791                 new method, reads resize image once and caches it
2792                 (-[KWQTextAreaTextView _resizeCornerRect]):
2793                 new method, computes rect from image
2794                 (-[KWQTextAreaTextView resetCursorRects]):
2795                 overridden to attempt to make the cursor change to an arrow when over this
2796                 corner. Only works sometimes, as explained in comments.
2797                 (-[KWQTextAreaTextView drawRect:]):
2798                 overridden to draw resize image
2799                 (-[KWQTextAreaTextView mouseDown:]):
2800                 now uses _resizeCornerRect, and sets cursor to arrow when pressed in resize corner
2801
2802         2005-04-18  John Sullivan  <sullivan@apple.com>
2803
2804                 WebCore support for notifying a form delegate when a
2805                 textarea's contents have changed (as opposed to a 
2806                 textfield, which was already handled).
2807
2808                 Reviewed by Maciej.
2809
2810                 * kwq/WebCoreBridge.h:
2811                 add textDidChange: method
2812
2813                 * kwq/KWQTextArea.mm:
2814                 (-[KWQTextArea textDidChange:]):
2815                 call through to bridge
2816
2817         2005-04-07  John Sullivan  <sullivan@apple.com>
2818
2819                 WebCore support for find-as-you-type; needed an additional parameter
2820                 to findString and searchFor:...
2821
2822                 Reviewed by Dave Hyatt.
2823
2824                 * kwq/KWQKHTMLPart.h:
2825                 * kwq/KWQKHTMLPart.mm:
2826                 (KWQKHTMLPart::findString):
2827                 new findInSelection parameter; if true, start from the beginning of the selection
2828                 when searching forward, or the end of the selection when searching backward
2829                 
2830                 * kwq/WebCoreBridge.h:
2831                 * kwq/WebCoreBridge.mm:
2832                 (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:findInSelection:]):
2833                 new findInSelection parameter; passed through to findString
2834
2835 2005-05-12  Darin Adler  <darin@apple.com>
2836
2837         Reviewed by Maciej (except for some parts outside the ECMA directory).
2838
2839         - switch KJS wrappers over to using the DOM impl. classes rather than using
2840           the DOM wrappers; will allow us to not even compile the DOM wrappers and
2841           make the code smaller
2842
2843         * khtml/css/css_valueimpl.h: Added CSSStyleDeclarationImpl::isPropertyName,
2844         removed CSSStyleDeclarationImpl::propertyID.
2845         * khtml/css/css_valueimpl.cpp:
2846         (DOM::propertyID): Added. Gets property ID given a DOM string. Replaces the
2847         previous version that had hacks that we want to leave in the JS wrapper for now.
2848         (DOM::CSSStyleDeclarationImpl::isPropertyName): Added.
2849
2850         * khtml/css/cssproperties.in: Fixed up comments.
2851
2852         * khtml/css/makeprop: Added new maxCSSPropertyNameLength constant, used for
2853         buffer size in the propertyID function.
2854
2855         * khtml/dom/dom2_events.h: Added handleEventImpl, making it easier to call
2856         handleEvent in a way that works either with or without the C++ DOM wrappers.
2857         * khtml/dom/dom2_events.cpp: (EventListener::handleEventImpl): Added.
2858
2859         * khtml/dom/dom2_views.cpp: Added now-needed include.
2860         * khtml/dom/dom_doc.cpp: Added now-needed include.
2861         * khtml/dom/dom_element.cpp: Tweaked includes.
2862
2863         * khtml/editing/htmlediting.cpp: Removed now-unneeded include.
2864         * khtml/html/html_baseimpl.cpp: Ditto.
2865         * khtml/html/html_formimpl.h: Ditto.
2866         * khtml/rendering/render_form.h: Ditto.
2867         * khtml/rendering/render_style.h: Ditto.
2868         * khtml/xml/dom2_eventsimpl.cpp: Ditto.
2869         * khtml/xml/dom2_viewsimpl.h: Ditto.
2870         * khtml/xml/dom_elementimpl.h: Ditto.
2871         * khtml/xml/dom_stringimpl.h: Ditto.
2872         * kwq/DOM.mm: Ditto.
2873         * kwq/DOMHTML.mm: Ditto.
2874
2875         * khtml/khtml_part.cpp: Tweaked incluudes.
2876         * khtml/khtmlpart_p.h: Ditto.
2877
2878         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::canCachePage): Change to use DOM impl. rather
2879         than C++ DOM.
2880
2881         * khtml/xml/dom_docimpl.cpp:
2882         (DOMImplementationImpl::createDocumentType): Disabled the calls to the not-implemented
2883         name checks in the C++ DOM wrappers. If we add name changes, we'll want them inside the
2884         impl, not in the wrappers.
2885         (DOMImplementationImpl::createDocument): Ditto.
2886         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkSetPrefix): Ditto.
2887
2888         * khtml/ecma/kjs_binding.cpp:
2889         (KJS::ScriptInterpreter::wasRunByUserGesture):
2890         (KJS::KJS::ValueToVariant):
2891         (KJS::setDOMException):
2892         * khtml/ecma/kjs_binding.h:
2893         (KJS::ScriptInterpreter::setCurrentEvent):
2894         (KJS::ScriptInterpreter::getCurrentEvent):
2895         (KJS::cacheDOMObject):
2896         (KJS::DOMExceptionTranslator::DOMExceptionTranslator):
2897         (KJS::DOMExceptionTranslator::~DOMExceptionTranslator):
2898         (KJS::DOMExceptionTranslator::operator int &):
2899         (KJS::cacheGlobalObject):
2900         * khtml/ecma/kjs_css.cpp:
2901         (KJS::cssPropertyName):
2902         (KJS::isCSSPropertyName):
2903         (KJS::DOMCSSStyleDeclaration::DOMCSSStyleDeclaration):
2904         (KJS::DOMCSSStyleDeclaration::~DOMCSSStyleDeclaration):
2905         (KJS::DOMCSSStyleDeclaration::hasProperty):
2906         (KJS::DOMCSSStyleDeclaration::tryGet):
2907         (KJS::DOMCSSStyleDeclaration::tryPut):
2908         (KJS::DOMCSSStyleDeclarationProtoFunc::tryCall):
2909         (KJS::getDOMCSSStyleDeclaration):
2910         (KJS::DOMStyleSheet::~DOMStyleSheet):
2911         (KJS::DOMStyleSheet::getValueProperty):
2912         (KJS::DOMStyleSheet::tryPut):
2913         (KJS::getDOMStyleSheet):
2914         (KJS::DOMStyleSheetList::~DOMStyleSheetList):
2915         (KJS::DOMStyleSheetList::tryGet):
2916         (KJS::getDOMStyleSheetList):
2917         (KJS::DOMStyleSheetListFunc::tryCall):
2918         (KJS::DOMMediaList::DOMMediaList):
2919         (KJS::DOMMediaList::~DOMMediaList):
2920         (KJS::DOMMediaList::tryGet):
2921         (KJS::DOMMediaList::tryPut):
2922         (KJS::getDOMMediaList):
2923         (KJS::KJS::DOMMediaListProtoFunc::tryCall):
2924         (KJS::DOMCSSStyleSheet::DOMCSSStyleSheet):
2925         (KJS::DOMCSSStyleSheet::tryGet):
2926         (KJS::DOMCSSStyleSheetProtoFunc::tryCall):
2927         (KJS::DOMCSSRuleList::~DOMCSSRuleList):
2928         (KJS::DOMCSSRuleList::tryGet):
2929         (KJS::DOMCSSRuleListFunc::tryCall):
2930         (KJS::getDOMCSSRuleList):
2931         (KJS::DOMCSSRule::~DOMCSSRule):
2932         (KJS::DOMCSSRule::classInfo):
2933         (KJS::DOMCSSRule::tryGet):
2934         (KJS::DOMCSSRule::getValueProperty):
2935         (KJS::DOMCSSRule::putValue):
2936         (KJS::DOMCSSRuleFunc::tryCall):
2937         (KJS::getDOMCSSRule):
2938         (KJS::DOMCSSValue::~DOMCSSValue):
2939         (KJS::DOMCSSValue::tryGet):
2940         (KJS::DOMCSSValue::tryPut):
2941         (KJS::getDOMCSSValue):
2942         (KJS::DOMCSSPrimitiveValue::DOMCSSPrimitiveValue):
2943         (KJS::DOMCSSPrimitiveValue::tryGet):
2944         (KJS::DOMCSSPrimitiveValueProtoFunc::tryCall):
2945         (KJS::DOMCSSValueList::DOMCSSValueList):
2946         (KJS::DOMCSSValueList::tryGet):
2947         (KJS::DOMCSSValueListFunc::tryCall):
2948         (KJS::DOMRGBColor::getValueProperty):
2949         (KJS::getDOMRGBColor):
2950         (KJS::DOMRect::~DOMRect):
2951         (KJS::DOMRect::getValueProperty):
2952         (KJS::getDOMRect):
2953         (KJS::DOMCounter::~DOMCounter):
2954         (KJS::DOMCounter::getValueProperty):
2955         (KJS::getDOMCounter):
2956         * khtml/ecma/kjs_css.h:
2957         (KJS::DOMCSSStyleDeclaration::impl):
2958         (KJS::DOMStyleSheet::DOMStyleSheet):
2959         (KJS::DOMStyleSheet::impl):
2960         (KJS::DOMStyleSheetList::DOMStyleSheetList):
2961         (KJS::DOMStyleSheetList::impl):
2962         (KJS::DOMMediaList::impl):
2963         (KJS::DOMCSSStyleSheet::):
2964         (KJS::DOMCSSRuleList::DOMCSSRuleList):
2965         (KJS::DOMCSSRuleList::impl):
2966         (KJS::DOMCSSRule::DOMCSSRule):
2967         (KJS::DOMCSSRule::impl):
2968         (KJS::DOMCSSValue::DOMCSSValue):
2969         (KJS::DOMCSSValue::impl):
2970         (KJS::DOMCSSValueList::):
2971         (KJS::DOMRGBColor::DOMRGBColor):
2972         (KJS::DOMRect::DOMRect):
2973         (KJS::DOMCounter::DOMCounter):
2974         * khtml/ecma/kjs_dom.cpp:
2975         (KJS::DOMNodeListFunc::):
2976         (KJS::DOMNode::DOMNode):
2977         (KJS::DOMNode::toBoolean):
2978         (KJS::DOMNode::getValueProperty):
2979         (KJS::DOMNode::putValue):
2980         (KJS::DOMNode::toPrimitive):
2981         (KJS::DOMNode::toString):
2982         (KJS::DOMNode::setListener):
2983         (KJS::DOMNode::getListener):
2984         (KJS::DOMNodeProtoFunc::tryCall):
2985         (KJS::toNode):
2986         (KJS::DOMNodeList::~DOMNodeList):
2987         (KJS::DOMNodeList::toPrimitive):
2988         (KJS::DOMNodeList::tryGet):
2989         (KJS::DOMNodeList::tryCall):
2990         (KJS::DOMNodeListFunc::tryCall):
2991         (KJS::DOMAttr::DOMAttr):
2992         (KJS::DOMAttr::getValueProperty):
2993         (KJS::DOMAttr::putValue):
2994         (KJS::toAttr):
2995         (KJS::DOMDocument::DOMDocument):
2996         (KJS::DOMDocument::~DOMDocument):
2997         (KJS::DOMDocument::getValueProperty):
2998         (KJS::DOMDocument::putValue):
2999         (KJS::DOMDocumentProtoFunc::tryCall):
3000         (KJS::DOMElement::DOMElement):
3001         (KJS::DOMElement::tryGet):
3002         (KJS::DOMElementProtoFunc::tryCall):
3003         (KJS::toElement):
3004         (KJS::DOMDOMImplementation::DOMDOMImplementation):
3005         (KJS::DOMDOMImplementation::~DOMDOMImplementation):
3006         (KJS::DOMDOMImplementationProtoFunc::tryCall):
3007         (KJS::DOMDocumentType::DOMDocumentType):
3008         (KJS::DOMDocumentType::getValueProperty):
3009         (KJS::toDocumentType):
3010         (KJS::DOMNamedNodeMap::DOMNamedNodeMap):
3011         (KJS::DOMNamedNodeMap::~DOMNamedNodeMap):
3012         (KJS::DOMNamedNodeMap::tryGet):
3013         (KJS::DOMNamedNodeMapProtoFunc::tryCall):
3014         (KJS::DOMProcessingInstruction::DOMProcessingInstruction):
3015         (KJS::DOMProcessingInstruction::getValueProperty):
3016         (KJS::DOMProcessingInstruction::tryPut):
3017         (KJS::DOMNotation::DOMNotation):
3018         (KJS::DOMNotation::getValueProperty):
3019         (KJS::DOMEntity::DOMEntity):
3020         (KJS::DOMEntity::getValueProperty):
3021         (KJS::getDOMDocumentNode):
3022         (KJS::checkNodeSecurity):
3023         (KJS::getDOMNode):
3024         (KJS::getDOMNamedNodeMap):
3025         (KJS::getRuntimeObject):
3026         (KJS::getDOMNodeList):
3027         (KJS::getDOMDOMImplementation):
3028         (KJS::getNodeConstructor):
3029         (KJS::getDOMExceptionConstructor):
3030         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
3031         (KJS::DOMNamedNodesCollection::tryGet):
3032         (KJS::DOMCharacterData::DOMCharacterData):
3033         (KJS::DOMCharacterData::getValueProperty):
3034         (KJS::DOMCharacterData::tryPut):
3035         (KJS::DOMCharacterDataProtoFunc::tryCall):
3036         (KJS::DOMText::DOMText):
3037         (KJS::DOMTextProtoFunc::tryCall):
3038         * khtml/ecma/kjs_dom.h:
3039         (KJS::DOMNode::impl):
3040         (KJS::DOMNodeList::DOMNodeList):
3041         (KJS::DOMNodeList::impl):
3042         (KJS::DOMDOMImplementation::impl):
3043         (KJS::DOMNamedNodeMap::impl):
3044         * khtml/ecma/kjs_events.cpp:
3045         (KJS::JSAbstractEventListener::handleEvent):
3046         (KJS::JSLazyEventListener::handleEvent):
3047         (KJS::getNodeEventListener):
3048         (KJS::DOMEvent::DOMEvent):
3049         (KJS::DOMEvent::~DOMEvent):
3050         (KJS::DOMEvent::getValueProperty):
3051         (KJS::DOMEvent::putValue):
3052         (KJS::DOMEventProtoFunc::tryCall):
3053         (KJS::getDOMEvent):
3054         (KJS::toEvent):
3055         (KJS::DOMUIEvent::DOMUIEvent):
3056         (KJS::DOMUIEvent::getValueProperty):
3057         (KJS::DOMUIEventProtoFunc::tryCall):
3058         (KJS::DOMMouseEvent::DOMMouseEvent):
3059         (KJS::DOMMouseEvent::getValueProperty):
3060         (KJS::DOMMouseEventProtoFunc::tryCall):
3061         (KJS::DOMKeyboardEvent::DOMKeyboardEvent):
3062         (KJS::DOMKeyboardEvent::getValueProperty):
3063         (KJS::DOMKeyboardEventProtoFunc::tryCall):
3064         (KJS::DOMMutationEvent::DOMMutationEvent):
3065         (KJS::DOMMutationEvent::getValueProperty):
3066         (KJS::DOMMutationEventProtoFunc::tryCall):
3067         (KJS::DOMWheelEvent::DOMWheelEvent):
3068         (KJS::DOMWheelEvent::getValueProperty):
3069         (KJS::ClipboardProtoFunc::tryCall):
3070         * khtml/ecma/kjs_events.h:
3071         (KJS::DOMEvent::impl):
3072         (KJS::DOMUIEvent::):
3073         (KJS::DOMMouseEvent::):
3074         (KJS::DOMKeyboardEvent::):
3075         (KJS::DOMMutationEvent::):
3076         * khtml/ecma/kjs_html.cpp:
3077         (KJS::KJS::HTMLDocFunction::tryCall):
3078         (KJS::HTMLDocument::HTMLDocument):
3079         (KJS::HTMLDocument::hasProperty):
3080         (KJS::HTMLDocument::tryGet):
3081         (KJS::KJS::HTMLDocument::putValue):
3082         (KJS::KJS::HTMLElement::classInfo):
3083         (KJS::HTMLElement::HTMLElement):
3084         (KJS::KJS::HTMLElement::tryGet):
3085         (KJS::KJS::HTMLElement::implementsCall):
3086         (KJS::KJS::HTMLElement::call):
3087         (KJS::KJS::HTMLElement::getValueProperty):
3088         (KJS::KJS::HTMLElement::hasProperty):
3089         (KJS::KJS::HTMLElement::toString):
3090         (KJS::getForm):
3091         (KJS::KJS::HTMLElement::pushEventHandlerScope):
3092         (KJS::KJS::HTMLElementFunction::tryCall):
3093         (KJS::KJS::HTMLElement::tryPut):
3094         (KJS::HTMLElement::putValue):
3095         (KJS::toHTMLElement):
3096         (KJS::toHTMLTableCaptionElement):
3097         (KJS::toHTMLTableSectionElement):
3098         (KJS::HTMLCollection::HTMLCollection):
3099         (KJS::HTMLCollection::~HTMLCollection):
3100         (KJS::KJS::HTMLCollection::tryGet):
3101         (KJS::KJS::HTMLCollection::tryCall):
3102         (KJS::KJS::HTMLCollection::getNamedItems):
3103         (KJS::KJS::HTMLCollectionProtoFunc::tryCall):
3104         (KJS::HTMLSelectCollection::HTMLSelectCollection):
3105         (KJS::KJS::HTMLSelectCollection::tryGet):
3106         (KJS::KJS::HTMLSelectCollection::tryPut):
3107         (KJS::OptionConstructorImp::OptionConstructorImp):
3108         (KJS::OptionConstructorImp::construct):
3109         (KJS::ImageConstructorImp::ImageConstructorImp):
3110         (KJS::ImageConstructorImp::construct):
3111         (KJS::Image::notifyFinished):
3112         (KJS::Image::Image):
3113         (KJS::KJS::Context2DFunction::tryCall):
3114         (KJS::):
3115         (KJS::colorRefFromValue):
3116         (KJS::colorFromValue):
3117         (KJS::Context2D::putValue):
3118         (KJS::Context2D::Context2D):
3119         (KJS::Context2D::mark):
3120         (KJS::GradientFunction::tryCall):
3121         (KJS::ImagePattern::tryGet):
3122         (KJS::getHTMLCollection):
3123         (KJS::getSelectHTMLCollection):
3124         * khtml/ecma/kjs_html.h:
3125         (KJS::HTMLDocument::):
3126         (KJS::HTMLElement::):
3127         (KJS::HTMLCollection::impl):
3128         * khtml/ecma/kjs_navigator.cpp:
3129         * khtml/ecma/kjs_proxy.cpp:
3130         (KJSProxyImpl::evaluate):
3131         (KJSProxyImpl::finishedWithEvent):
3132         * khtml/ecma/kjs_proxy.h:
3133         * khtml/ecma/kjs_range.cpp:
3134         (KJS::DOMRange::DOMRange):
3135         (KJS::DOMRange::~DOMRange):
3136         (KJS::DOMRange::tryGet):
3137         (KJS::DOMRange::getValueProperty):
3138         (KJS::DOMRangeProtoFunc::tryCall):
3139         (KJS::getDOMRange):
3140         (KJS::RangeConstructor::tryGet):
3141         (KJS::getRangeConstructor):
3142         (KJS::toRange):
3143         * khtml/ecma/kjs_range.h:
3144         (KJS::DOMRange::impl):
3145         * khtml/ecma/kjs_traversal.cpp:
3146         (KJS::DOMNodeIterator::DOMNodeIterator):
3147         (KJS::DOMNodeIterator::~DOMNodeIterator):
3148         (KJS::DOMNodeIterator::getValueProperty):
3149         (KJS::DOMNodeIteratorProtoFunc::tryCall):
3150         (KJS::getDOMNodeIterator):
3151         (KJS::DOMNodeFilter::DOMNodeFilter):
3152         (KJS::DOMNodeFilter::~DOMNodeFilter):
3153         (KJS::DOMNodeFilterProtoFunc::tryCall):
3154         (KJS::getDOMNodeFilter):
3155         (KJS::toNodeFilter):
3156         (KJS::DOMTreeWalker::DOMTreeWalker):
3157         (KJS::DOMTreeWalker::~DOMTreeWalker):
3158         (KJS::DOMTreeWalker::getValueProperty):
3159         (KJS::DOMTreeWalker::tryPut):
3160         (KJS::DOMTreeWalkerProtoFunc::tryCall):
3161         (KJS::getDOMTreeWalker):
3162         (KJS::JSNodeFilterCondition::acceptNode):
3163         * khtml/ecma/kjs_traversal.h:
3164         (KJS::DOMNodeIterator::impl):
3165         (KJS::DOMNodeFilter::impl):
3166         (KJS::DOMTreeWalker::impl):
3167         * khtml/ecma/kjs_views.cpp:
3168         (KJS::DOMAbstractView::~DOMAbstractView):
3169         (KJS::DOMAbstractView::tryGet):
3170         (KJS::DOMAbstractViewFunc::tryCall):
3171         (KJS::getDOMAbstractView):
3172         (KJS::toAbstractView):
3173         * khtml/ecma/kjs_views.h:
3174         (KJS::DOMAbstractView::DOMAbstractView):
3175         (KJS::DOMAbstractView::impl):
3176         * khtml/ecma/kjs_window.cpp:
3177         (KJS::Window::get):
3178         (KJS::Window::hasProperty):
3179         (KJS::Window::put):
3180         (KJS::Window::setListener):
3181         (KJS::Window::getListener):
3182         (KJS::Window::setCurrentEvent):
3183         (KJS::WindowFunc::tryCall):
3184         (KJS::Location::put):
3185         (KJS::LocationFunc::tryCall):
3186         (KJS::Selection::get):
3187         (KJS::SelectionFunc::tryCall):
3188         * khtml/ecma/kjs_window.h:
3189         * khtml/ecma/xmlhttprequest.cpp:
3190         (KJS::XMLHttpRequestConstructorImp::XMLHttpRequestConstructorImp):
3191         (KJS::XMLHttpRequestConstructorImp::~XMLHttpRequestConstructorImp):
3192         (KJS::XMLHttpRequestConstructorImp::construct):
3193         (KJS::XMLHttpRequest::getValueProperty):
3194         (KJS::XMLHttpRequest::XMLHttpRequest):
3195         (KJS::XMLHttpRequest::changeState):
3196         (KJS::XMLHttpRequest::open):
3197         (KJS::XMLHttpRequestProtoFunc::tryCall):
3198         * khtml/ecma/xmlhttprequest.h:
3199         * khtml/ecma/xmlserializer.cpp:
3200         (KJS::XMLSerializerProtoFunc::tryCall):
3201         * khtml/ecma/xmlserializer.h:
3202         * kwq/DOMInternal.mm:
3203         (-[WebScriptObject _initializeScriptDOMNodeImp]):
3204         * kwq/DOMUtility.mm:
3205         (KJS::ScriptInterpreter::createObjcInstanceForValue):
3206
3207 2005-05-11  David Hyatt  <hyatt@apple.com>
3208
3209         Improve the display of apple.com.  innerWidth and innerHeight refer to the size of the visible view and
3210         so they do not need to do a layout in order to yield correct values from JS.  Removing this stops an
3211         early layout and paint before the apple.com images are typically loaded.
3212
3213         This is an improvement of the fix for wired.com's FOUC.  For that bug I eliminated the need to ignore pending
3214         stylesheets, but now I'm going further and just eliminating the layout all together.  This means that the old
3215         updateLayout function can be reverted to how it was before the wired.com fix.
3216         
3217         Reviewed by john
3218
3219         * khtml/ecma/kjs_window.cpp:
3220         (Window::get):
3221         (Window::updateLayout):
3222         * khtml/ecma/kjs_window.h:
3223
3224 2005-05-11  Maciej Stachowiak  <mjs@apple.com>
3225
3226         Reviewed by Kevin.
3227
3228         - split some more individual classes out of htmlediting.cpp
3229         (CompositeEditcommand, AppendnodeCommand, ApplyStyleCommand)
3230
3231         Also moves StyleChange directly into ApplyStyleCommand
3232         implementation file, it doesn't need to be in a header at all.
3233         
3234         * WebCore.pbproj/project.pbxproj:
3235         * khtml/editing/append_node_command.cpp: Added.
3236         * khtml/editing/append_node_command.h: Added.
3237         * khtml/editing/apply_style_command.cpp: Added.
3238         * khtml/editing/apply_style_command.h: Added.
3239         * khtml/editing/composite_edit_command.cpp: Added.
3240         * khtml/editing/composite_edit_command.h: Added.
3241         * khtml/editing/edit_command.cpp: Minor clean-ups.
3242         * khtml/editing/edit_command.h:
3243         * khtml/editing/htmlediting.cpp:
3244         * khtml/editing/htmlediting.h:
3245
3246 2005-05-11  Adele Peterson  <adele@apple.com>
3247
3248         Reviewed by Darin.
3249
3250         fix for <rdar://problem/4061979> crash in DOM::ElementImpl::setAttribute at www.nitto-kohki.co.jp
3251
3252         * khtml/html/html_imageimpl.cpp: (HTMLImageLoader::updateFromElement): added a nil check for the document
3253         * khtml/xml/dom_nodeimpl.h: (DOM::NodeImpl::inDocument): added check for document in case the document has been destroyed before the node has been removed.  A lot of code already assumes that if inDocument returns true, a document exists.
3254  
3255         * layout-tests/fast/events/onload-re-entry.html: removed alert.
3256         * layout-tests/fast/events/onload-re-entry-expected.txt: updated.
3257         * layout-tests/fast/dom/attr_dead_doc-expected.txt: Added.
3258         * layout-tests/fast/dom/attr_dead_doc.html: Added.
3259         * layout-tests/fast/dom/resources/apple.gif: Added.
3260         * layout-tests/fast/dom/resources/mozilla.gif: Added.
3261         * layout-tests/fast/dom/resources/top.html: Added.
3262
3263 2005-05-10  Maciej Stachowiak  <mjs@apple.com>
3264
3265         Reviewed by Kevin.
3266
3267         - start on splitting htmlediting.cpp into smaller files - pull
3268         EditCommand and EditCommandPtr out.
3269
3270         * WebCore.pbproj/project.pbxproj:
3271         * khtml/editing/edit_command.cpp: Added.
3272         * khtml/editing/edit_command.h: Added.
3273         * khtml/editing/htmlediting.cpp: Took EditCommand and EditCommandPtr out.
3274         * khtml/editing/htmlediting.h: Ditto.
3275
3276 2005-05-10  David Hyatt  <hyatt@apple.com>
3277
3278         Refactor the DOM so that the concept of class/style/id is no longer unique to HTML elements.  This paves the way
3279         for SVG and MathML elements to also support these capabilities.  In addition the concept of presentational
3280         attributes has also been factored out.
3281         
3282         Reviewed by mjs
3283
3284         * khtml/css/css_ruleimpl.cpp:
3285         (CSSStyleRuleImpl::setDeclaration):
3286         * khtml/css/cssstyleselector.cpp:
3287         (khtml::parseUASheet):
3288         (khtml::CSSStyleSelector::loadDefaultStyle):
3289         (khtml::CSSStyleSelector::initElementAndPseudoState):
3290         (khtml::CSSStyleSelector::canShareStyleWithElement):
3291         (khtml::CSSStyleSelector::locateSharedStyle):
3292         (khtml::CSSStyleSelector::styleForElement):
3293         (khtml::CSSStyleSelector::checkOneSelector):
3294         * khtml/css/cssstyleselector.h:
3295         * khtml/html/html_baseimpl.cpp:
3296         (HTMLBodyElementImpl::parseMappedAttribute):
3297         (HTMLFrameElementImpl::parseMappedAttribute):
3298         (HTMLFrameSetElementImpl::parseMappedAttribute):
3299         (HTMLIFrameElementImpl::parseMappedAttribute):
3300         * khtml/html/html_baseimpl.h:
3301         * khtml/html/html_blockimpl.cpp:
3302         (HTMLDivElementImpl::parseMappedAttribute):
3303         (HTMLHRElementImpl::parseMappedAttribute):
3304         (HTMLParagraphElementImpl::parseMappedAttribute):
3305         (HTMLMarqueeElementImpl::parseMappedAttribute):
3306         * khtml/html/html_blockimpl.h:
3307         * khtml/html/html_canvasimpl.cpp:
3308         (HTMLCanvasElementImpl::parseMappedAttribute):
3309         * khtml/html/html_canvasimpl.h:
3310         * khtml/html/html_elementimpl.cpp:
3311         (HTMLElementImpl::HTMLElementImpl):
3312         (HTMLElementImpl::~HTMLElementImpl):
3313         (HTMLElementImpl::mapToEntry):
3314         (HTMLElementImpl::parseMappedAttribute):
3315         (HTMLElementImpl::addHTMLAlignment):
3316         (HTMLElementImpl::setContentEditable):
3317         (HTMLElementImpl::toString):
3318         * khtml/html/html_elementimpl.h:
3319         * khtml/html/html_formimpl.cpp:
3320         (DOM::HTMLFormElementImpl::parseMappedAttribute):
3321         (DOM::HTMLGenericFormElementImpl::parseMappedAttribute):
3322         (DOM::HTMLButtonElementImpl::parseMappedAttribute):
3323         (DOM::HTMLInputElementImpl::setType):
3324         (DOM::HTMLInputElementImpl::parseMappedAttribute):
3325         (DOM::HTMLLabelElementImpl::parseMappedAttribute):
3326         (DOM::HTMLSelectElementImpl::parseMappedAttribute):
3327         (DOM::HTMLKeygenElementImpl::parseMappedAttribute):
3328         (DOM::HTMLOptGroupElementImpl::parseMappedAttribute):
3329         (DOM::HTMLOptionElementImpl::parseMappedAttribute):
3330         (DOM::HTMLTextAreaElementImpl::parseMappedAttribute):
3331         (DOM::HTMLIsIndexElementImpl::parseMappedAttribute):
3332         * khtml/html/html_formimpl.h:
3333         * khtml/html/html_headimpl.cpp:
3334         (HTMLBaseElementImpl::parseMappedAttribute):
3335         (HTMLLinkElementImpl::parseMappedAttribute):
3336         (HTMLMetaElementImpl::parseMappedAttribute):
3337         (HTMLStyleElementImpl::parseMappedAttribute):
3338         * khtml/html/html_headimpl.h:
3339         * khtml/html/html_imageimpl.cpp:
3340         (HTMLImageElementImpl::parseMappedAttribute):
3341         (HTMLMapElementImpl::parseMappedAttribute):
3342         (HTMLAreaElementImpl::parseMappedAttribute):
3343         * khtml/html/html_imageimpl.h:
3344         * khtml/html/html_inlineimpl.cpp:
3345         (DOM::HTMLAnchorElementImpl::parseMappedAttribute):
3346         (DOM::HTMLBRElementImpl::parseMappedAttribute):
3347         (DOM::HTMLFontElementImpl::parseMappedAttribute):
3348         * khtml/html/html_inlineimpl.h:
3349         * khtml/html/html_listimpl.cpp:
3350         (DOM::HTMLUListElementImpl::parseMappedAttribute):
3351         (DOM::HTMLOListElementImpl::parseMappedAttribute):
3352         (DOM::HTMLLIElementImpl::parseMappedAttribute):
3353         * khtml/html/html_listimpl.h:
3354         * khtml/html/html_objectimpl.cpp:
3355         (DOM::HTMLAppletElementImpl::parseMappedAttribute):
3356         (DOM::HTMLEmbedElementImpl::parseMappedAttribute):
3357         (DOM::HTMLObjectElementImpl::parseMappedAttribute):
3358         (DOM::HTMLParamElementImpl::parseMappedAttribute):
3359         * khtml/html/html_objectimpl.h:
3360         * khtml/html/html_tableimpl.cpp:
3361         (DOM::HTMLTableElementImpl::parseMappedAttribute):
3362         (DOM::HTMLTableElementImpl::additionalAttributeStyleDecl):
3363         (DOM::HTMLTableElementImpl::getSharedCellDecl):
3364         (DOM::HTMLTablePartElementImpl::parseMappedAttribute):
3365         (DOM::HTMLTableCellElementImpl::parseMappedAttribute):
3366         (DOM::HTMLTableColElementImpl::parseMappedAttribute):
3367         (DOM::HTMLTableCaptionElementImpl::parseMappedAttribute):
3368         * khtml/html/html_tableimpl.h:
3369         * khtml/html/htmltokenizer.h:
3370         (khtml::Token::addAttribute):
3371         * khtml/misc/htmlattrs.in:
3372         * khtml/misc/htmltags.in:
3373         * khtml/xml/dom_docimpl.cpp:
3374         (DocumentImpl::createAttribute):
3375         (DocumentImpl::createElementNS):
3376         (DocumentImpl::createHTMLElement):
3377         * khtml/xml/dom_elementimpl.cpp:
3378         (XMLElementImpl::cloneNode):
3379         (NamedAttrMapImpl::isMappedAttributeMap):
3380         (CSSMappedAttributeDeclarationImpl::~CSSMappedAttributeDeclarationImpl):
3381         (StyledElementImpl::getMappedAttributeDecl):
3382         (StyledElementImpl::setMappedAttributeDecl):
3383         (StyledElementImpl::removeMappedAttributeDecl):
3384         (StyledElementImpl::invalidateStyleAttribute):
3385         (StyledElementImpl::updateStyleAttributeIfNeeded):
3386         (MappedAttributeImpl::~MappedAttributeImpl):
3387         (MappedAttributeImpl::clone):
3388         (m_mappedAttributeCount):
3389         (NamedMappedAttrMapImpl::clearAttributes):
3390         (NamedMappedAttrMapImpl::isMappedAttributeMap):
3391         (NamedMappedAttrMapImpl::declCount):
3392         (NamedMappedAttrMapImpl::mapsEquivalent):
3393         (NamedMappedAttrMapImpl::parseClassAttribute):
3394         (StyledElementImpl::StyledElementImpl):
3395         (StyledElementImpl::~StyledElementImpl):
3396         (StyledElementImpl::createAttribute):
3397         (StyledElementImpl::createInlineStyleDecl):
3398         (StyledElementImpl::destroyInlineStyleDecl):
3399         (StyledElementImpl::attributeChanged):
3400         (StyledElementImpl::mapToEntry):
3401         (StyledElementImpl::parseMappedAttribute):
3402         (StyledElementImpl::createAttributeMap):
3403         (StyledElementImpl::getInlineStyleDecl):
3404         (StyledElementImpl::style):
3405         (StyledElementImpl::additionalAttributeStyleDecl):
3406         (StyledElementImpl::getClassList):
3407         (isHexDigit):