Merge "[WK2] Revert patch / set a limit of layer count and atlas size." into 2.0_beta
[framework/web/webkit-efl.git] / Source / WebCore / ChangeLog-2003-10-25
1 === Safari-111 ===
2
3 2003-10-24  Richard Williamson   <rjw@apple.com>
4
5         Fixed 3425358.  Don't try to create page cache for pages that
6         have a nil view().
7
8         Reviewed by Hyatt.
9
10         * kwq/WebCoreBridge.mm:
11         (-[WebCoreBridge saveDocumentToPageCache]):
12
13 2003-10-24  David Hyatt  <hyatt@apple.com>
14
15         Fix for 3133375, the minwidth computation for pres is wrong.  There were a couple of bugs here.
16         One is that pres only should have a breakable character if they contain a newline.  Otherwise they're
17         treated essentially like nowrap.  The other was that m_beginMinWidth and m_endMinWidth needed to be
18         set to the maxwidth of the first line and the maxwidth of the last line respectively for pres instead of
19         being only the first and last words.
20         
21         Reviewed by mjs
22
23         * khtml/rendering/render_text.cpp:
24         (RenderText::calcMinMaxWidth):
25
26 2003-10-24  David Hyatt  <hyatt@apple.com>
27
28         Two fixes to the computation of min/max width for text runs.
29         (1) Make sure that pre runs don't add in word-spacing to the last word on a line (e.g., when a newline explicitly
30         breaks a pre).
31         (2) Fix a bug where breakable characters weren't getting factored into minwidth properly.  When a word got broken
32         because of a breakable character, we were treating the breakable character like a space, and not including its
33         width as part of the minimum width of the text run.
34         
35         Reviewed by john
36
37         * khtml/rendering/render_text.cpp:
38         (RenderText::calcMinMaxWidth):
39
40 2003-10-23  David Hyatt  <hyatt@apple.com>
41
42         This patch fixes the pseudo-elements ::first-line and ::first-letter to inherit styles properly.  More
43         specifically it does the following:
44
45         (1) Implements caching of pseudo-styles once computed off the style() which originated the pseudo-style.
46         The old code did this, and this was a regression from my previous patch.
47
48         (2) Fixes first-letter checking so that it happens at layout time rather than during render object
49         construction time, since that makes first-letter more dynamic and causes it to be discovered in cases
50         where it was being missed before.  This fixes the front page of meyerweb.com.
51
52         (3) Make first-letter inherit from first-line like it's supposed to, and also make first-line styles
53         cross blocks and inherit properly from enclosing containers.
54
55         (4) Make first-letter changes cause a detach/attach to fire just as when the display changes.  I generalized
56         the notion of needing to detach on a style change by making it a new kind of hint in dom_nodeimpl's style
57         diff function.
58
59         (5) Fixed isBlockFlow to return true for inline-blocks.
60         
61         Reviewed by john
62
63         * khtml/rendering/render_block.cpp:
64         (khtml::RenderBlock::addChildToFlow):
65         (khtml::RenderBlock::layoutBlock):
66         (khtml::RenderBlock::getFirstLineBox):
67         (khtml::RenderBlock::firstLineBlock):
68         (khtml::RenderBlock::updateFirstLetter):
69         * khtml/rendering/render_block.h:
70         (khtml::RenderBlock::isBlockFlow):
71         * khtml/rendering/render_line.cpp:
72         (InlineFlowBox::paintBackgroundAndBorder):
73         * khtml/rendering/render_list.cpp:
74         (RenderListItem::setStyle):
75         * khtml/rendering/render_object.cpp:
76         (RenderObject::RenderObject):
77         (RenderObject::firstLineBlock):
78         (RenderObject::updateFirstLetter):
79         (RenderObject::dump):
80         (RenderObject::setStyle):
81         (RenderObject::recalcMinMaxWidths):
82         (RenderObject::style):
83         (RenderObject::getPseudoStyle):
84         * khtml/rendering/render_object.h:
85         (khtml::RenderObject::overhangingContents):
86         * khtml/rendering/render_style.cpp:
87         (pseudoBit):
88         * khtml/rendering/render_style.h:
89         (khtml::RenderStyle::):
90         * khtml/rendering/render_table.cpp:
91         (RenderTable::firstLineBlock):
92         (RenderTable::updateFirstLetter):
93         * khtml/rendering/render_table.h:
94         * khtml/rendering/render_text.cpp:
95         (RenderText::paintObject):
96         (RenderText::htmlFont):
97         * khtml/xml/dom_elementimpl.cpp:
98         (ElementImpl::recalcStyle):
99         * khtml/xml/dom_nodeimpl.cpp:
100         (NodeImpl::diff):
101         * khtml/xml/dom_nodeimpl.h:
102         (DOM::NodeImpl::):
103
104 2003-10-23  Ken Kocienda  <kocienda@apple.com>
105
106         Reviewed by David
107
108         Fix for these bugs:
109
110         <rdar://problem/3171929>: Safari picks a different button in a 
111         form when you hit return if the first button has no name
112         <rdar://problem/3200386>: investigate which button is activated 
113         when hitting return in form text input fields
114
115         HTML spec says that buttons must have names to be considered
116         successful. However, other browsers do not impose this constraint.
117         Therefore, we behave differently, and can use different buttons than
118         the author intended.
119
120         * khtml/html/html_formimpl.cpp:
121         (HTMLButtonElementImpl::isSuccessfulSubmitButton)
122         (HTMLInputElementImpl::isSuccessfulSubmitButton)
123
124 2003-10-22  David Hyatt  <hyatt@apple.com>
125
126         Fix for 3460726, the user agent string was returning nil.  
127
128         Fix for 3386544, empty documents did not get a layout, and so they looked white.  Also fixed the positioning
129         of widgets to account for border/padding in updateWidgetPositions.
130
131         Fix for espn.com crasher, 3458143, caused by layout object not being properly cleared when layouts were
132         unscheduled.
133         
134         Reviewed by darin
135
136         * khtml/khtmlview.cpp:
137         * khtml/rendering/render_canvas.cpp:
138         (RenderCanvas::RenderCanvas):
139         * khtml/rendering/render_replaced.cpp:
140         (RenderWidget::updateWidgetPositions):
141         * kwq/KWQKHTMLPart.mm:
142         (KWQKHTMLPart::userAgent):
143
144 2003-10-22  Maciej Stachowiak  <mjs@apple.com>
145
146         Reviewed by 
147
148         - fixed 3460664 - Exception handlers not properly removed
149         
150         * kwq/KWQKHTMLPart.mm:
151         (KWQKHTMLPart::mouseMoved): Don't return from exception block
152         (KWQKHTMLPart::khtmlMouseReleaseEvent): Add exception blocking (whoops)
153
154 2003-10-22  John Sullivan  <sullivan@apple.com>
155
156         - fixed 3460652 -- REGRESSION (100-110+): Can't tab out of a 
157         frameset page
158
159         Reviewed by Darin (actually he made the change on my machine)
160
161         * khtml/html/html_baseimpl.cpp:
162         (HTMLFrameSetElementImpl::defaultEventHandler):
163         only set defaultHandled for the one event that we actually
164         handle (mouse event to resize frame borders); this was always
165         being set, hence preventing key events from being used elsewhere.
166
167 2003-10-22  Richard Williamson   <rjw@apple.com>
168
169         Fixed 3454067.  RenderText's repaint wasn't called because of recent changes to de-virtualize repaint.  Modified getAbsoluteRepaintRect() to return containing block's getAbsoluteRepaintRect().
170         
171         Also removed the long standing +1 from QFontMetrics::height().
172
173         Reviewed by Hyatt.
174
175         * khtml/rendering/render_text.cpp:
176         (RenderText::getAbsoluteRepaintRect):
177         * khtml/rendering/render_text.h:
178         * kwq/KWQFontMetrics.mm:
179         (QFontMetrics::height):
180
181 2003-10-22  David Hyatt  <hyatt@apple.com>
182
183         Fix visibility to be done when widgets are added or when styles are set rather than at paint time.  Fixes
184         the ads painting on top of content at tvguide.com.
185         
186         Reviewed by cblu
187
188         * khtml/rendering/render_replaced.cpp:
189         (RenderWidget::setQWidget):
190         (RenderWidget::setStyle):
191         (RenderWidget::paintObject):
192         * kwq/KWQWidget.h:
193         * kwq/KWQWidget.mm:
194         (QWidget::QWidget):
195         (QWidget::show):
196         (QWidget::hide):
197
198 2003-10-21  Maciej Stachowiak  <mjs@apple.com>
199
200         Reviewed by Dave.
201
202         Finished exception blocking changes, so now I can finally say:
203
204         - fixed 3137084 - Many non-reproducible crashers in ContextImp::mark / ScopeChain::mark
205         - fixed 3308848 - nil-deref in KHTMLView::topLevelWidget
206         - fixed 3311511 - nil deref inside KJS::Screen
207         - fixed 3397422 - 7B51: Safari crashed in KJS::ObjectImp::mark()
208         - fixed 3408373 - Panther7B58 : Safari Crashed in KJS::ObjectImp::mark
209         - fixed 3409307 - 7B55: safari crashed in KJS::Interpreter::globalExec() (idle, nothing particular going on)
210         - fixed 3410160 - 7B60 Safari crashed in KHTMLPart::parentPart called from JS while in the background
211         - fixed 3413224 - unrepro crash in KJS::Window::mark
212         - fixed 3419940 - unrepro crash in KJS::Collector::allocate trying to access http://www.lindyinthepalms.com
213         - fixed 3420123 - Panther7B66: Safari crashed while going to http://www.tangents.co.uk/index2.html
214         - fixed 3423225 - Safari crash in vtable for KWQMapImpl (vtable for KWQMapImpl + 8).
215         - fixed 3437190 - nil-deref on quit in calling marked() from ScopeChain::mark()
216
217         * WebCore.pbproj/project.pbxproj:
218         * kwq/KWQFontMetrics.mm:
219         * kwq/KWQPainter.mm:
220         (QPainter::drawPixmap):
221         (QPainter::drawTiledPixmap):
222         (QPainter::_updateRenderer):
223         * kwq/WebCoreTextRenderer.h:
224
225 2003-10-21  David Hyatt  <hyatt@apple.com>
226
227         http://placenamehere.com/safari/fixedbgtest.html is now fixed with a patch from the KHTML trunk.
228         Fixed backgrounds repeated when they weren't supposed to.
229         
230         * khtml/rendering/render_box.cpp:
231         (RenderBox::paintBackgroundExtended):
232
233 2003-10-21  David Hyatt  <hyatt@apple.com>
234
235         Change pseudo-element style resolution to be lazy and to not occur until the style is actually asked
236         for by the front end render objects.  Also fix first-letter to inherit properly from first-line styles.
237         
238         Reviewed by mjs
239
240         * khtml/css/cssstyleselector.cpp:
241         (khtml::CSSStyleSelector::initForStyleResolve):
242         (khtml::CSSStyleSelector::styleForElement):
243         (khtml::CSSStyleSelector::pseudoStyleForElement):
244         (khtml::CSSStyleSelector::checkSelector):
245         (khtml::CSSStyleSelector::checkOneSelector):
246         * khtml/css/cssstyleselector.h:
247         * khtml/rendering/render_block.cpp:
248         (khtml::RenderBlock::addChildToFlow):
249         * khtml/rendering/render_container.cpp:
250         (RenderContainer::updatePseudoChild):
251         * khtml/rendering/render_object.cpp:
252         (RenderObject::setStyle):
253         (RenderObject::createInlineBox):
254         (RenderObject::style):
255         (RenderObject::getPseudoStyle):
256         * khtml/rendering/render_object.h:
257         * khtml/rendering/render_style.cpp:
258         (pseudoBit):
259         (RenderStyle::hasPseudoStyle):
260         (RenderStyle::setHasPseudoStyle):
261         (RenderStyle::getPseudoStyle):
262         (RenderStyle::addPseudoStyle):
263         * khtml/rendering/render_style.h:
264         (khtml::RenderStyle::NonInheritedFlags::operator==):
265         (khtml::RenderStyle::setBitDefaults):
266         * khtml/rendering/render_text.cpp:
267         (InlineTextBox::paintSelection):
268         (RenderText::paintObject):
269         (RenderText::htmlFont):
270
271 2003-10-21  Maciej Stachowiak  <mjs@apple.com>
272
273         Reviewed by Dave.
274
275         More exception blocking.
276
277         * kwq/KWQKHTMLPart.mm:
278         (KWQKHTMLPart::~KWQKHTMLPart):
279         (KWQKHTMLPart::generateFrameName):
280         (KWQKHTMLPart::openURL):
281         (KWQKHTMLPart::openURLRequest):
282         (regExpForLabels):
283         (KWQKHTMLPart::clearRecordedFormValues):
284         (KWQKHTMLPart::recordFormValue):
285         (KWQKHTMLPart::submitForm):
286         (KHTMLPart::frameDetached):
287         (KWQKHTMLPart::urlSelected):
288         (KWQKHTMLPart::createPart):
289         (KWQKHTMLPart::setTitle):
290         (KWQKHTMLPart::setStatusBarText):
291         (KWQKHTMLPart::scheduleClose):
292         (KWQKHTMLPart::unfocusWindow):
293         (KWQKHTMLPart::jumpToSelection):
294         (KWQKHTMLPart::redirectionTimerStartedOrStopped):
295         (KWQKHTMLPart::userAgent):
296         (KWQKHTMLPart::mimeTypeForFileName):
297         (KWQKHTMLPart::nextKeyView):
298         (KWQKHTMLPart::currentEventIsMouseDownInWidget):
299         (KWQKHTMLPart::openURLFromPageCache):
300         (KWQKHTMLPart::saveDocumentState):
301         (KWQKHTMLPart::restoreDocumentState):
302         (KWQKHTMLPart::requestedURLString):
303         (KWQKHTMLPart::incomingReferrer):
304         (KWQKHTMLPart::runJavaScriptAlert):
305         (KWQKHTMLPart::runJavaScriptConfirm):
306         (KWQKHTMLPart::runJavaScriptPrompt):
307         (KWQKHTMLPart::createEmptyDocument):
308         (KWQKHTMLPart::keyEvent):
309         (KWQKHTMLPart::khtmlMousePressEvent):
310         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
311         (KWQKHTMLPart::lastEventIsMouseUp):
312         (findViewInSubviews):
313         (KWQKHTMLPart::khtmlMouseMoveEvent):
314         (KWQKHTMLPart::passSubframeEventToSubframe):
315         (KWQKHTMLPart::buttonForCurrentEvent):
316         (KWQKHTMLPart::stateForCurrentEvent):
317         (KWQKHTMLPart::mouseDown):
318         (KWQKHTMLPart::mouseDragged):
319         (KWQKHTMLPart::mouseUp):
320         (KWQKHTMLPart::sendFakeEventsAfterWidgetTracking):
321         (KWQKHTMLPart::mouseMoved):
322         (KWQKHTMLPart::sendContextMenuEvent):
323         (fileWrapperForElement):
324         (KWQKHTMLPart::attributedString):
325         (KWQKHTMLPart::keyboardUIMode):
326
327 2003-10-21  Chris Blumenberg  <cblu@apple.com>
328
329         Fixed: <rdar://problem/3176170>: OBJECT tag with no or empty TYPE is mishandled
330
331         Reviewed by rjw.
332
333         * kwq/KWQKHTMLPart.mm:
334         (KWQKHTMLPart::createPart): call renamed frameRequiredForMIMEType:URL:
335         * kwq/WebCoreBridge.h: renamed frameRequiredForMIMEType: to frameRequiredForMIMEType:URL:
336
337 2003-10-20  David Hyatt  <hyatt@apple.com>
338
339         Fix generated content (before/after) so that it no longer has any restrictions on it.   CSS2.1 lifted 
340         restrictions preventing the floating/positioning of generated content.
341         
342         Reviewed by rjw
343
344         * khtml/css/cssstyleselector.cpp:
345         (khtml::CSSStyleSelector::adjustRenderStyle):
346         * khtml/rendering/render_container.cpp:
347         (RenderContainer::updatePseudoChild):
348
349 2003-10-20  Ken Kocienda  <kocienda@apple.com>
350
351         Reviewed by David
352
353         * khtml/dom/dom2_events.cpp:
354         (UIEvent::keyCode): Change over to use ascii value for key code.
355         (UIEvent::which): Ditto.
356         (KeyboardEvent::KeyboardEvent): New key event class which
357         tracks the DOM Level 3 spec more closely.
358         (KeyboardEvent::operator = ): New function.
359         (KeyboardEvent::~KeyboardEvent): New function.
360         (KeyboardEvent::ctrlKey): New function.
361         (KeyboardEvent::shiftKey): New function.
362         (KeyboardEvent::altKey): New function.
363         (KeyboardEvent::metaKey): New function.
364         (KeyboardEvent::altGraphKey): New function.
365         (KeyboardEvent::initKeyboardEvent): New function.
366         * khtml/dom/dom2_events.h: Ditto.
367         * khtml/html/html_formimpl.cpp:
368         (HTMLGenericFormElementImpl::defaultEventHandler): Use key 
369         identifiers to test which key was pressed, instead of removed keyVal().
370         (HTMLInputElementImpl::defaultEventHandler): Ditto.
371         (HTMLSelectElementImpl::defaultEventHandler): Ditto.
372         * khtml/html/html_inlineimpl.cpp:
373         (HTMLAnchorElementImpl::defaultEventHandler): Change casts to match new
374         class name. Use key identifiers to test which key was pressed, 
375         instead of removed keyVal(). Use new modifier accessors.
376         * khtml/xml/dom2_eventsimpl.cpp:
377         (EventImpl::typeToId): Some reorganization of the constants in the
378         switch statements. Name change for these to remove the KHTML_ prefix
379         from the key up and key down events will happen soon.
380         (EventImpl::idToType): Ditto.
381         (KeyboardEventImpl::KeyboardEventImpl): New key event class which
382         tracks the DOM Level 3 spec more closely.
383         (KeyboardEventImpl::~KeyboardEventImpl): Ditto.
384         (KeyboardEventImpl::initKeyboardEvent): Ditto.
385         * khtml/xml/dom2_eventsimpl.h:
386         (DOM::EventImpl::): Some reorganization of the constants in the
387         switch statements. Name change for these to remove the KHTML_ prefix
388         from the key up and key down events will happen soon.
389         (DOM::KeyboardEventImpl::keyIdentifier): New function.
390         (DOM::KeyboardEventImpl::keyLocation): New function.
391         (DOM::KeyboardEventImpl::ctrlKey): New function.
392         (DOM::KeyboardEventImpl::shiftKey): New function.
393         (DOM::KeyboardEventImpl::altKey): New function.
394         (DOM::KeyboardEventImpl::metaKey): New function.
395         (DOM::KeyboardEventImpl::altGraphKey): New function.
396         (DOM::KeyboardEventImpl::qKeyEvent): New function.
397         * khtml/xml/dom_docimpl.cpp:
398         (DocumentImpl::createEvent): Now can create keyboard events.
399         * khtml/xml/dom_nodeimpl.cpp:
400         (NodeImpl::dispatchKeyEvent): Class name changes.
401         * kwq/KWQEvent.h: Added QString identifier member.
402         * kwq/KWQEvent.mm:
403         (hexDigit): Added helper.
404         (identifierForKeyText): Added new function to map keys to DOM
405         key identifiers as listed in the DOM spec.
406         (QKeyEvent::identifier): Added accessor.
407         * kwq/KWQKHTMLPart.mm:
408         (KWQKHTMLPart::stateForCurrentEvent): Added check to see if
409         a key press is on one of the numeric keypad keys.
410         * kwq/KWQLogging.h: Added log constant for DOM events.
411         * kwq/KWQLogging.m: Ditto
412
413 2003-10-20  David Hyatt  <hyatt@apple.com>
414
415         Make first-letter and before/after work with text transforms.
416         
417         Reviewed by mjs
418
419         * khtml/rendering/render_block.cpp:
420         (khtml::RenderBlock::addChildToFlow):
421         * khtml/rendering/render_container.cpp:
422         (RenderContainer::updatePseudoChild):
423         * khtml/rendering/render_text.cpp:
424         (RenderText::setStyle):
425         (RenderText::isTextFragment):
426         (RenderText::originalString):
427         (RenderText::setText):
428         (m_generatedContentStr):
429         (m_start):
430         (RenderTextFragment::~RenderTextFragment):
431         (RenderTextFragment::isTextFragment):
432         (RenderTextFragment::originalString):
433         * khtml/rendering/render_text.h:
434         (khtml::RenderTextFragment::start):
435         (khtml::RenderTextFragment::end):
436         (khtml::RenderTextFragment::contentString):
437         * khtml/xml/dom_nodeimpl.h:
438         (DOM::NodeImpl::setRenderer):
439
440 2003-10-19  David Hyatt  <hyatt@apple.com>
441
442         Remove the "flow-around-floats" hack for lists.  Other browsers don't do this.
443         
444         Reviewed by darin
445
446         * khtml/css/quirks.css:
447
448 2003-10-19  David Hyatt  <hyatt@apple.com>
449
450         Fix for a regression/crash on tivocommunity.com caused by faulty border-collapse code in the collapsedRightBorder
451         case.  I forgot to deal with colspans.
452         
453         Reviewed by darin
454
455         * khtml/rendering/render_table.cpp:
456         (RenderTable::cellRight):
457         (RenderTableCell::collapsedRightBorder):
458
459 2003-10-19  David Hyatt  <hyatt@apple.com>
460
461         Patch from KHTML trunk that makes textareas work properly even when they have no render objects.
462
463         * khtml/html/html_formimpl.cpp:
464         (HTMLTextAreaElementImpl::encoding):
465         (HTMLTextAreaElementImpl::value):
466
467 2003-10-18  Darin Adler  <darin@apple.com>
468
469         Reviewed by Maciej.
470
471         - fixed 3454444 -- contents of mailto form shows up in Mail title instead of body (IE sends mail directly)
472
473         * kwq/KWQKURL.mm: (KURL::parse): Changed non-hierarchical code to consider everything
474         after a question mark as a query, just the way the hierarchical code does. This makes
475         the code that constructs the mailto URL work properly.
476
477 2003-10-18  David Hyatt  <hyatt@apple.com>
478
479         Fix the intrinsic minmax width computation for blocks and XUL boxes to actually check fixed min/max CSS widths.
480         
481         Reviewed by darin
482
483         * khtml/rendering/render_block.cpp:
484         (khtml::RenderBlock::calcMinMaxWidth):
485         * khtml/rendering/render_flexbox.cpp:
486         (khtml::RenderFlexibleBox::calcMinMaxWidth):
487
488 2003-10-18  David Hyatt  <hyatt@apple.com>
489
490         Change the names of the border-spacing properties to border-horizontal-spacing and border-vertical-spacing.
491         
492         * khtml/css/cssparser.cpp:
493         (CSSParser::parseValue):
494         * khtml/css/cssproperties.c:
495         (findProp):
496         * khtml/css/cssproperties.h:
497         * khtml/css/cssproperties.in:
498         * khtml/css/cssstyleselector.cpp:
499         (khtml::CSSStyleSelector::applyRule):
500
501 2003-10-18  David Hyatt  <hyatt@apple.com>
502
503         Fix for diveintomark className parsing bug.  class="bigblue blue" would fail to match a rule with .blue.
504         The bug was in the selector matching code for class attributes.
505
506         Also fixing a minmax width bug for blocks on the mozilla.org Web site.  XUL boxes had the same bug as
507         well.
508         
509         Reviewed by darin
510
511         * khtml/css/cssstyleselector.cpp:
512         (khtml::CSSStyleSelector::checkOneSelector):
513         * khtml/rendering/render_block.cpp:
514         (khtml::RenderBlock::calcMinMaxWidth):
515         * khtml/rendering/render_flexbox.cpp:
516         (khtml::RenderFlexibleBox::calcMinMaxWidth):
517
518 2003-10-18  David Hyatt  <hyatt@apple.com>
519
520         Fix for 3443502, generated content sometimes doesn't generate.  The bug is caused by an
521         uninitialized variable.  m_isContinuation needed to be set to false in the RenderInline
522         constructor.
523         
524         * khtml/rendering/render_inline.cpp:
525         (m_isContinuation):
526
527 2003-10-17  Darin Adler  <darin@apple.com>
528
529         Reviewed by Maciej.
530
531         - make text areas set the base writing direction based on the direction in the CSS style
532
533         * kwq/KWQTextArea.h: Added setBaseWritingDirection method.
534         * kwq/KWQTextArea.mm:
535         (-[KWQTextArea _createTextView]): Use _KWQ_setTypingParagraphStyle.
536         (-[KWQTextArea setWordWrap:]): Use _KWQ_setTypingParagraphStyle.
537         (-[KWQTextArea setBaseWritingDirection:]): Added. New method that sets the base writing
538         direction in both the style of the text and the typing attributes.
539         (-[NSTextView _KWQ_typingParagraphStyle]): Added. Helper method to make setBaseWritingDirection:
540         a little less gigantic.
541         (-[NSTextView _KWQ_setTypingParagraphStyle:]): Ditto.
542         (-[NSTextStorage _KWQ_setBaseWritingDirection:]): Ditto.
543
544         * kwq/KWQTextEdit.mm: (QTextEdit::setAlignment): Set both alignment and base writing direction.
545
546 2003-10-17  David Hyatt  <hyatt@apple.com>
547
548         Implement horizontal and vertical border-spacing.  Allow them to be specified individually.
549
550         Reviewed by mjs
551
552         ------
553
554         Fix the calcWidth method of tables to account for horizontal margins properly.
555
556         Reviewed by john
557
558         ------
559
560         Implement border collapsing in tables.
561
562         Reviewed by kocienda
563
564         * khtml/css/cssparser.cpp:
565         (CSSParser::parseValue):
566         * khtml/css/cssproperties.c:
567         (hash_prop):
568         (findProp):
569         * khtml/css/cssproperties.h:
570         * khtml/css/cssproperties.in:
571         * khtml/css/cssstyleselector.cpp:
572         (khtml::CSSStyleSelector::applyRule):
573         * khtml/css/cssvalues.c:
574         * khtml/css/cssvalues.h:
575         * khtml/css/cssvalues.in:
576         * khtml/rendering/bidi.cpp:
577         (khtml::RenderBlock::layoutInlineChildren):
578         * khtml/rendering/render_box.cpp:
579         (RenderBox::paintBoxDecorations):
580         * khtml/rendering/render_form.cpp:
581         (RenderFieldset::paintBorderMinusLegend):
582         * khtml/rendering/render_object.cpp:
583         (RenderObject::paintBorder):
584         (RenderObject::collectBorders):
585         * khtml/rendering/render_object.h:
586         * khtml/rendering/render_style.cpp:
587         (StyleInheritedData::StyleInheritedData):
588         (StyleInheritedData::operator==):
589         (RenderStyle::diff):
590         * khtml/rendering/render_style.h:
591         (khtml::):
592         (khtml::CollapsedBorderValue::precedence):
593         (khtml::CollapsedBorderValue::width):
594         (khtml::CollapsedBorderValue::style):
595         (khtml::CollapsedBorderValue::exists):
596         (khtml::CollapsedBorderValue::color):
597         (khtml::CollapsedBorderValue::isTransparent):
598         (khtml::CollapsedBorderValue::operator==):
599         (khtml::RenderStyle::borderLeft):
600         (khtml::RenderStyle::borderRight):
601         (khtml::RenderStyle::borderTop):
602         (khtml::RenderStyle::borderBottom):
603         (khtml::RenderStyle::horizontalBorderSpacing):
604         (khtml::RenderStyle::verticalBorderSpacing):
605         (khtml::RenderStyle::setHorizontalBorderSpacing):
606         (khtml::RenderStyle::setVerticalBorderSpacing):
607         * khtml/rendering/render_table.cpp:
608         (RenderTable::RenderTable):
609         (RenderTable::setStyle):
610         (RenderTable::calcWidth):
611         (RenderTable::paint):
612         (RenderTable::borderLeft):
613         (RenderTable::borderRight):
614         (RenderTable::borderTop):
615         (RenderTable::borderBottom):
616         (RenderTable::cellAbove):
617         (RenderTable::cellBelow):
618         (RenderTable::cellLeft):
619         (RenderTable::cellRight):
620         (RenderTableSection::setCellWidths):
621         (RenderTableSection::calcRowHeight):
622         (RenderTableSection::layoutRows):
623         (compareBorders):
624         (RenderTableCell::collapsedLeftBorder):
625         (RenderTableCell::collapsedRightBorder):
626         (RenderTableCell::collapsedTopBorder):
627         (RenderTableCell::collapsedBottomBorder):
628         (RenderTableCell::borderLeft):
629         (RenderTableCell::borderRight):
630         (RenderTableCell::borderTop):
631         (RenderTableCell::borderBottom):
632         (collapsedBorderStyle):
633         (CollapsedBorder::CollapsedBorder):
634         (CollapsedBorders:::count):
635         (CollapsedBorders::addBorder):
636         (CollapsedBorders::nextBorder):
637         (addBorderStyle):
638         (RenderTableCell::collectBorders):
639         (RenderTableCell::paintCollapsedBorder):
640         (RenderTableCell::paintObject):
641         (RenderTableCell::paintBoxDecorations):
642         * khtml/rendering/render_table.h:
643         (khtml::RenderTable::hBorderSpacing):
644         (khtml::RenderTable::vBorderSpacing):
645         (khtml::RenderTable::bordersPaddingAndSpacing):
646         (khtml::RenderTable::currentBorderStyle):
647         * khtml/rendering/table_layout.cpp:
648         (FixedTableLayout::layout):
649         (AutoTableLayout::calcEffectiveWidth):
650         (AutoTableLayout::layout):
651
652 2003-10-16  Maciej Stachowiak  <mjs@apple.com>
653
654         Reviewed by John.
655
656         More exception blocking.
657         
658         * kwq/KWQFont.mm:
659         (QFont::isFixedPitch):
660         (QFont::getNSFont):
661         * kwq/KWQKJobClasses.mm:
662         (KIO::TransferJob::~TransferJob):
663         * kwq/KWQLoader.mm:
664         (KWQServeRequest):
665         (KWQCheckIfReloading):
666         (KWQCheckCacheObjectStatus):
667         (KWQRetainResponse):
668         (KWQReleaseResponse):
669         (KWQResponseMIMEType):
670
671 === Safari-110 ===
672
673 2003-10-16  Darin Adler <darin@apple.com>
674
675         Reviewed by vicki. 
676
677         - fix buildit build failure 
678
679         * kwq/KWQScrollView.mm: 
680         (QScrollView::resizeContents):
681
682
683 2003-10-15  Darin Adler  <darin@apple.com>
684
685         Reviewed by Ken.
686
687         - change "volatile X * volatile" to "X * volatile" in cases where the
688           pointer needs to be volatile but the object pointed to do does not
689
690         * kwq/KWQKConfigBase.mm: (KConfig::readEntry):
691         * kwq/KWQKCursor.mm: (+[NSCursor _WebCore_cursorWithName:hotSpot:]):
692         * kwq/KWQKLocale.mm:
693         (inputElementAltText):
694         (resetButtonDefaultLabel):
695         (searchableIndexIntroduction):
696         (submitButtonDefaultLabel):
697         (KLocale::language):
698         * kwq/KWQLineEdit.mm: (QLineEdit::text):
699         * kwq/KWQScrollView.mm:
700         (QScrollView::setContentsPos):
701         (QScrollView::addChild):
702         (QScrollView::updateContents):
703         (QScrollView::contentsToViewport):
704         (QScrollView::viewportToContents):
705         (QScrollView::getDocumentView):
706         * kwq/KWQTextEdit.mm:
707         (QTextEdit::text):
708         (QTextEdit::textWithHardLineBreaks):
709         * kwq/KWQWidget.mm: (QWidget::getOuterView):
710         Removed the excess volatiles and excess casts that go with them.
711
712         * kwq/KWQKCookieJar.mm: (KWQKCookieJar::cookie): Do the same, but also
713         remove an unnecessary nil check that is the same as QString::fromNSString's
714         default behavior.
715
716 2003-10-15  Maciej Stachowiak  <mjs@apple.com>
717
718         Reviewed by Dave.
719
720         More objc-exception-blocking excitement.
721
722         * kwq/KWQKConfigBase.mm:
723         (KConfig::readEntry):
724         (KConfig::readNumEntry):
725         (RefreshPlugins):
726         * kwq/KWQKCursor.mm:
727         (+[NSCursor _WebCore_cursorWithName:hotSpot:]):
728         * kwq/KWQKJavaAppletWidget.mm:
729         (KJavaAppletWidget::showApplet):
730         * kwq/KWQKLocale.mm:
731         (inputElementAltText):
732         (resetButtonDefaultLabel):
733         (searchableIndexIntroduction):
734         (submitButtonDefaultLabel):
735         (KLocale::language):
736         * kwq/KWQRegion.mm:
737         (QRegion::QRegion):
738
739 2003-10-14  David Hyatt  <hyatt@apple.com>
740
741         Fix an obvious little typo with smallCaps inheritance.  Richard reviewed.
742
743         Also merge in Dirk's patch to fix a crasher caused by an obvious deref mistake.
744         
745         Reviewed by rjw and nobody
746
747         * khtml/css/cssstyleselector.cpp:
748         (khtml::convertToLength):
749         (khtml::CSSStyleSelector::applyRule):
750
751 2003-10-14  Ken Kocienda  <kocienda@apple.com>
752
753         Reviewed by Hyatt
754
755         * khtml/dom/dom_misc.h: Declared TristateFlag enum used to implement
756         inheritance behavior for inheritable attributes like designMode.
757         * khtml/dom/html_document.cpp:
758         (HTMLDocument::designMode): Added getter.
759         (HTMLDocument::setDesignMode): Added setter.
760         * khtml/dom/html_document.h: Added declarations for designMode getter and setter.
761         * khtml/dom/html_element.cpp:
762         (HTMLElement::isContentEditable): Added convenience.
763         (HTMLElement::contentEditable): Added getter.
764         (HTMLElement::setContentEditable): Added setter.
765         * khtml/dom/html_element.h: Added declarations for contentEditable accessors.
766         * khtml/ecma/kjs_html.cpp: Added js support for contentEditable and designMode.
767         (KJS::HTMLDocument::tryGet)
768         (KJS::HTMLDocument::putValue)
769         (KJS::HTMLElement::getValueProperty)
770         (KJS::HTMLElement::putValue)
771         * khtml/ecma/kjs_html.h:
772         (KJS::HTMLDocument::): Added DesignMode to attribuute enum.
773         (KJS::HTMLElement::): Added ContentEditable to attribute enum.
774         * khtml/html/html_documentimpl.cpp:
775         (HTMLDocumentImpl::designMode): Added getter.
776         (HTMLDocumentImpl::setDesignMode): Added setter.
777         * khtml/html/html_documentimpl.h: Declared designMode accessors.
778         * khtml/html/html_elementimpl.cpp:
779         (HTMLElementImpl::HTMLElementImpl):
780         (HTMLElementImpl::parseAttribute): Added support for contentEditable.
781         (HTMLElementImpl::isContentEditable): Added. Implements inheritance feature
782         for this attribute.
783         (HTMLElementImpl::contentEditable): Getter for contentEditable attribute.
784         (HTMLElementImpl::setContentEditable): Setter for contentEditable attribute.
785         * khtml/html/html_elementimpl.h:
786         * khtml/khtml_part.cpp:
787         (KHTMLPart::setEditMode): Added.
788         (KHTMLPart::editMode): Added. Implements inheritance behavior for
789         attribute.
790         (KHTMLPart::inEditMode): Helper that calls on editMode function.
791         (KHTMLPart::parentPart): Made const.
792         * khtml/khtml_part.h: Rolled in a couple of typo fixes. Added
793         declarations for the changes made in the implementation file.
794         * khtml/khtmlpart_p.h:
795         (KHTMLPartPrivate::KHTMLPartPrivate): Declared editMode flag.
796         Also added support for editMode flag in initializers and copy function.
797         * khtml/misc/htmlattrs.in: Added contentEditable as an attribute name.
798
799 2003-10-13  David Hyatt  <hyatt@apple.com>
800
801         Fix for a small-caps rendering error when used in conjunction with ::first-line.  Always update
802         the Font variable even when QFonts are the same, since small-caps is not stored in QFonts.
803         
804         Reviewed by rjw
805
806         * khtml/rendering/render_text.cpp:
807         (RenderText::paintObject):
808
809 2003-10-13  Richard Williamson (Home0  <rjw@apple.com>
810
811         Updated layout tests actuals to reflect implementation of small-caps style.
812
813         * layout-tests/css1/font_properties/font-expected.txt:
814         * layout-tests/css1/font_properties/font_variant-expected.txt:
815         * layout-tests/css1/pseudo/firstline-expected.txt:
816         * layout-tests/css1/pseudo/multiple_pseudo_elements-expected.txt:
817
818 2003-10-13  Richard Williamson <rjw@apple.com>
819
820         Added support for small-caps.
821
822         Reviewed by John.
823
824         * khtml/rendering/font.h:
825         (khtml::Font::isSmallCaps):
826         * khtml/rendering/render_text.cpp:
827         (RenderText::shouldUseMonospaceCache):
828
829 2003-10-12  Darin Adler  <darin@apple.com>
830
831         * layout-tests/fast/js/date-parse-test.html: Fixed a couple of silly mistakes.
832
833         * kwq/character-sets.txt: New version of file from www.iana.org. No substantive change.
834         Also, now that we don't use MIB numbers any more, I could leave out our one local change,
835         the MIB number we added for ISO-10646-J-1.
836
837 2003-10-10  David Hyatt  <hyatt@apple.com>
838
839         Beginning of work on border collapsing.  This patch makes sure that cell spacing between cells is
840         ignored and that padding on tables is ignored.  This ensures that there is no space between cells
841         or between the edges of cells and the border of the table itself.  
842
843         Reviewed by john
844
845         * khtml/rendering/render_style.h:
846         (khtml::RenderStyle::setBitDefaults):
847         * khtml/rendering/render_table.cpp:
848         (RenderTable::setStyle):
849         (RenderTable::layout):
850         * khtml/rendering/render_table.h:
851         (khtml::RenderTable::collapseBorders):
852         (khtml::RenderTable::bordersPaddingAndSpacing):
853
854 2003-10-10  David Hyatt  <hyatt@apple.com>
855
856         Fix for table regression 3449444, as well as a patch to support padding on tables and to stop
857         honoring borders on row groups (both of which are correct for the "separate" border model).
858         
859         * khtml/rendering/render_table.cpp:
860         (RenderTable::layout):
861         (RenderTableSection::calcRowHeight):
862         (RenderTableSection::layoutRows):
863         * khtml/rendering/render_table.h:
864         (khtml::RenderTable::bordersPaddingAndSpacing):
865         * khtml/rendering/table_layout.cpp:
866         (FixedTableLayout::calcMinMaxWidth):
867         (FixedTableLayout::layout):
868         (AutoTableLayout::calcMinMaxWidth):
869         (AutoTableLayout::layout):
870
871         Reviewed by darin
872
873 2003-10-10  David Hyatt  <hyatt@apple.com>
874         
875         Patch to move the widgets during layout instead of at paint time.
876         
877         Reviewed by darin
878
879         * khtml/khtmlview.cpp:
880         * khtml/rendering/render_canvas.cpp:
881         (RenderCanvas::repaintViewRectangle):
882         * khtml/rendering/render_form.cpp:
883         (RenderFormElement::baselinePosition):
884         (RenderFormElement::layout):
885         * khtml/rendering/render_object.cpp:
886         (RenderObject::updateWidgetPositions):
887         * khtml/rendering/render_object.h:
888         * khtml/rendering/render_replaced.cpp:
889         (RenderWidget::layout):
890         (RenderWidget::updateWidgetPositions):
891         * khtml/rendering/render_replaced.h:
892         * kwq/KWQCheckBox.h:
893         * kwq/KWQCheckBox.mm:
894         (QCheckBox::baselinePosition):
895         * kwq/KWQComboBox.h:
896         * kwq/KWQComboBox.mm:
897         (QComboBox::baselinePosition):
898         * kwq/KWQFileButton.h:
899         * kwq/KWQFileButton.mm:
900         (KWQFileButton::baselinePosition):
901         * kwq/KWQLineEdit.h:
902         * kwq/KWQLineEdit.mm:
903         (QLineEdit::baselinePosition):
904         * kwq/KWQPushButton.h:
905         * kwq/KWQPushButton.mm:
906         (QPushButton::baselinePosition):
907         * kwq/KWQRadioButton.h:
908         * kwq/KWQRadioButton.mm:
909         (QRadioButton::baselinePosition):
910         * kwq/KWQWidget.h:
911         * kwq/KWQWidget.mm:
912         (QWidget::baselinePosition):
913         (QWidget::setFrameGeometry):
914         * kwq/WebCoreBridge.h:
915         * kwq/WebCoreBridge.mm:
916
917 2003-10-10  David Hyatt  <hyatt@apple.com>
918
919         Make sure the i-beam cursor is only forced if you have a selection.
920
921         Reviewed by John
922
923         * khtml/khtmlview.cpp
924         
925 2003-10-10  Ken Kocienda  <kocienda@apple.com>
926
927         Reviewed by John
928
929         Fix for this bug:
930
931         <rdar://problem/3440703>: Textarea form controls do not respect disabled attribute
932
933         * khtml/rendering/render_form.cpp:
934         (RenderTextArea::updateFromElement): Check for disabled attribute.
935         * kwq/KWQTextArea.h:
936         * kwq/KWQTextArea.mm:
937         (-[KWQTextArea setEnabled:]): Added. 
938         (-[KWQTextArea isEnabled]): Added.
939         (-[KWQTextArea drawRect:]): Draws a disabled-looking  bezel when disabled.
940         (-[KWQTextAreaTextView becomeFirstResponder]): Return NO if disabled.
941         (-[KWQTextAreaTextView mouseDown:]): Block events if disabled.
942         (-[KWQTextAreaTextView keyDown:]): Ditto.
943         (-[KWQTextAreaTextView keyUp:]): Ditto.
944         (-[KWQTextAreaTextView setEnabled:]): Added. Pass value through to editable
945         attribute on text view.
946         (-[KWQTextAreaTextView isEnabled]): Added.
947         (-[KWQTextAreaTextView drawRect:]): Set the text color to a disabled color
948         when disabled.
949         * kwq/KWQTextEdit.h:
950         * kwq/KWQTextEdit.mm:
951         (QTextEdit::isDisabled): Added.
952         (QTextEdit::setDisabled): Added.
953
954 2003-10-10  Maciej Stachowiak  <mjs@apple.com>
955
956         - fixed 3449405 - REGRESSION: reproducible crash changing focus w/ button on page, e.g. on www.aa.com
957         
958         More fallout from the exception blocking.
959
960         * kwq/KWQButton.mm:
961         (QButton::focusPolicy): Don't return from exception block (caught
962         by Darin).
963
964 2003-10-09  Darin Adler  <darin@apple.com>
965
966         Reviewed by Maciej.
967
968         - fixed 3449280 -- REGRESSION: crash copying a selection that ends in a <br>
969
970         * khtml/rendering/render_br.h: Add checkSelectionPointIgnoringContinuations.
971         * khtml/rendering/render_br.cpp: (RenderBR::checkSelectionPointIgnoringContinuations):
972         Override to never return an offset of 1. We can't use a character offset because the
973         DOM doesn't know that we're implemented as a text object. So an offset of 1 turns into
974         "after this element".
975
976 2003-10-09  Maciej Stachowiak  <mjs@apple.com>
977
978         - fixed crash I just added.
979
980         * kwq/KWQWidget.mm:
981         (QWidget::setCursor): Move BLOCK_NS_EXCEPTIONS macros so
982         you don't `break' out of the blocking code.
983
984 2003-10-09  Maciej Stachowiak  <mjs@apple.com>
985
986         Reviewed by Ken.
987
988         More Cocoa exception blocking work.
989
990         * kwq/KWQFrame.mm:
991         (QFrame::setFrameStyle):
992         * kwq/KWQLineEdit.mm:
993         (QLineEdit::QLineEdit):
994         (QLineEdit::~QLineEdit):
995         (QLineEdit::setEchoMode):
996         (QLineEdit::setFont):
997         (QLineEdit::setText):
998         (QLineEdit::text):
999         (QLineEdit::isReadOnly):
1000         (QLineEdit::setReadOnly):
1001         (QLineEdit::maxLength):
1002         (QLineEdit::selectAll):
1003         (QLineEdit::edited):
1004         (QLineEdit::setEdited):
1005         (QLineEdit::sizeForCharacterWidth):
1006         (QLineEdit::baselinePosition):
1007         (QLineEdit::setAlignment):
1008         * kwq/KWQListBox.mm:
1009         (QListBox::QListBox):
1010         (QListBox::~QListBox):
1011         (QListBox::count):
1012         (QListBox::clear):
1013         (QListBox::setSelectionMode):
1014         (QListBox::insertItem):
1015         (QListBox::insertGroupLabel):
1016         (QListBox::endBatchInsert):
1017         (QListBox::setSelected):
1018         (QListBox::isSelected):
1019         (QListBox::setEnabled):
1020         (QListBox::sizeForNumberOfLines):
1021         (QListBox::focusPolicy):
1022         * kwq/KWQPushButton.mm:
1023         (QPushButton::QPushButton):
1024         (QPushButton::sizeHint):
1025         (QPushButton::baselinePosition):
1026         (QPushButton::dimensions):
1027         * kwq/KWQRadioButton.mm:
1028         (QRadioButton::QRadioButton):
1029         (QRadioButton::setChecked):
1030         (QRadioButton::isChecked):
1031         (QRadioButton::dimensions):
1032         * kwq/KWQScrollBar.mm:
1033         (-[KWQScrollBar initWithQScrollBar:]):
1034         (:m_valueChanged):
1035         (QScrollBar::~QScrollBar):
1036         (QScrollBar::setValue):
1037         (QScrollBar::setKnobProportion):
1038         (QScrollBar::scrollbarHit):
1039         * kwq/KWQScrollView.mm:
1040         (QScrollView::visibleWidth):
1041         (QScrollView::visibleHeight):
1042         (QScrollView::contentsWidth):
1043         (QScrollView::contentsHeight):
1044         (QScrollView::contentsX):
1045         (QScrollView::contentsY):
1046         (QScrollView::setContentsPos):
1047         (QScrollView::setVScrollBarMode):
1048         (QScrollView::setHScrollBarMode):
1049         (QScrollView::setScrollBarsMode):
1050         (QScrollView::vScrollBarMode):
1051         (QScrollView::hScrollBarMode):
1052         (QScrollView::hasVerticalScrollBar):
1053         (QScrollView::hasHorizontalScrollBar):
1054         (QScrollView::suppressScrollBars):
1055         (QScrollView::addChild):
1056         (QScrollView::removeChild):
1057         (QScrollView::resizeContents):
1058         (QScrollView::updateContents):
1059         (QScrollView::contentsToViewport):
1060         (QScrollView::viewportToContents):
1061         (QScrollView::setStaticBackground):
1062         (QScrollView::ensureVisible):
1063         (QScrollView::getDocumentView):
1064         * kwq/KWQTextEdit.mm:
1065         (QTextEdit::QTextEdit):
1066         (QTextEdit::setText):
1067         (QTextEdit::text):
1068         (QTextEdit::textWithHardLineBreaks):
1069         (QTextEdit::getCursorPosition):
1070         (QTextEdit::setCursorPosition):
1071         (QTextEdit::wordWrap):
1072         (QTextEdit::setWordWrap):
1073         (QTextEdit::isReadOnly):
1074         (QTextEdit::setReadOnly):
1075         (QTextEdit::selectAll):
1076         (QTextEdit::setFont):
1077         (QTextEdit::setAlignment):
1078         (QTextEdit::sizeWithColumnsAndRows):
1079         * kwq/KWQWidget.mm:
1080         (QWidget::QWidget):
1081         (QWidget::~QWidget):
1082         (QWidget::setActiveWindow):
1083         (QWidget::setEnabled):
1084         (QWidget::isEnabled):
1085         (QWidget::frameGeometry):
1086         (QWidget::hasFocus):
1087         (QWidget::setFocus):
1088         (QWidget::focusPolicy):
1089         (QWidget::isVisible):
1090         (QWidget::setCursor):
1091         (QWidget::cursor):
1092         (QWidget::setFrameGeometry):
1093         (QWidget::mapFromGlobal):
1094         (QWidget::setView):
1095         (QWidget::getOuterView):
1096         (QWidget::lockDrawingFocus):
1097         (QWidget::unlockDrawingFocus):
1098         (QWidget::disableFlushDrawing):
1099         (QWidget::enableFlushDrawing):
1100         (QWidget::setDrawingAlpha):
1101         (QWidget::paint):
1102         (QWidget::sendConsumedMouseUp):
1103
1104 2003-10-09  David Hyatt  <hyatt@apple.com>
1105
1106         Stop printing extra spaces before list items.  Fixes ordered lists with list-style-position: inside.
1107         
1108         Reviewed by mjs
1109
1110         * khtml/rendering/render_list.cpp:
1111
1112 2003-10-09  David Hyatt  <hyatt@apple.com>
1113
1114         Make definition of kMin and kMax match the KHTML trunk.  Someone still needs to eliminate uses of QMIN
1115         and QMAX from the code.
1116
1117         * kwq/KWQDef.h:
1118         (kMin):
1119         (kMax):
1120
1121 2003-10-09  Chris Blumenberg  <cblu@apple.com>
1122
1123         Fixed: <rdar://problem/3333897>: should support navigator.plugins.refresh as a way to add a plugin without restarting Safari
1124
1125         Reviewed by rjw.
1126
1127         * khtml/ecma/kjs_navigator.cpp:
1128         (PluginBase::refresh): new
1129         (PluginsFunc::tryCall): call refresh
1130         * kwq/KWQKConfigBase.h:
1131         * kwq/KWQKConfigBase.mm:
1132         (RefreshPlugins): new
1133         * kwq/WebCoreViewFactory.h:
1134
1135 === Safari-109 ===
1136
1137 2003-10-08  David Hyatt  <hyatt@apple.com>
1138
1139         Fix for 3436723, the shrink-to-fit algorithm for positioned elements did not match
1140         the algorithm specified in section 10.3.7 of the CSS2.1 specification.  The min-width
1141         of the element was not being taken into account like it should have been.
1142         
1143         Reviewed by mjs
1144
1145         * khtml/rendering/render_box.cpp:
1146         (RenderBox::calcAbsoluteHorizontal):
1147
1148 2003-10-08  David Hyatt  <hyatt@apple.com>
1149
1150         Implement min/max width and min/max height support for replaced elements.
1151         
1152         Reviewed by ken
1153
1154         * khtml/rendering/render_box.cpp:
1155         (RenderBox::calcReplacedWidth):
1156         (RenderBox::calcReplacedWidthUsing):
1157         (RenderBox::calcReplacedHeight):
1158         (RenderBox::calcReplacedHeightUsing):
1159         (RenderBox::availableHeight):
1160         (RenderBox::availableHeightUsing):
1161         * khtml/rendering/render_box.h:
1162
1163 2003-10-08  Maciej Stachowiak  <mjs@apple.com>
1164
1165         Fix development build.
1166         
1167         * kwq/KWQExceptions.h: Correct assertion args.
1168
1169 2003-10-08  Maciej Stachowiak  <mjs@apple.com>
1170
1171         Reviewed by Ken.
1172
1173         Start on blocking Cocoa exceptions when calling ObjC from C++ to
1174         avoid unreproducible crashes when this happens.
1175
1176         * kwq/KWQExceptions.h: Added. Helper macros for exception blocking.
1177         * WebCore.pbproj/project.pbxproj: Add new header
1178
1179         In all these files, block exceptions when calling ObjC from C++,
1180         or explain why not.
1181         
1182         * kwq/KWQAccObjectCache.mm:
1183         * kwq/KWQApplication.mm:
1184         * kwq/KWQButton.mm:
1185         (QButton::QButton):
1186         (QButton::~QButton):
1187         (QButton::setText):
1188         (QButton::text):
1189         (QButton::clicked):
1190         (QButton::simulateClick):
1191         (QButton::setFont):
1192         (QButton::focusPolicy):
1193         * kwq/KWQCheckBox.mm:
1194         (QCheckBox::QCheckBox):
1195         (QCheckBox::setChecked):
1196         (QCheckBox::isChecked):
1197         (QCheckBox::dimensions):
1198         * kwq/KWQColor.mm:
1199         * kwq/KWQComboBox.mm:
1200         (QComboBox::QComboBox):
1201         (QComboBox::~QComboBox):
1202         (QComboBox::insertItem):
1203         (QComboBox::sizeHint):
1204         (QComboBox::setCurrentItem):
1205         (QComboBox::updateCurrentItem):
1206         (QComboBox::setFont):
1207         (QComboBox::dimensions):
1208         * kwq/KWQCursor.mm:
1209         * kwq/KWQFile.mm:
1210         * kwq/KWQFileButton.mm:
1211         (KWQFileButton::KWQFileButton):
1212         (KWQFileButton::~KWQFileButton):
1213         (KWQFileButton::setFilename):
1214         (KWQFileButton::sizeForCharacterWidth):
1215         (KWQFileButton::frameGeometry):
1216         (KWQFileButton::setFrameGeometry):
1217         (KWQFileButton::baselinePosition):
1218         (KWQFileButton::filenameChanged):
1219         * kwq/KWQKCookieJar.mm:
1220         (KWQKCookieJar::cookie):
1221         (KWQKCookieJar::setCookie):
1222         (KWQKCookieJar::cookieEnabled):
1223         * kwq/KWQKHTMLPartBrowserExtension.mm:
1224         (KHTMLPartBrowserExtension::createNewWindow):
1225         (KHTMLPartBrowserExtension::setIconURL):
1226         (KHTMLPartBrowserExtension::setTypedIconURL):
1227         * kwq/KWQKHistoryProvider.mm:
1228         (KParts::HistoryProvider::contains):
1229         * kwq/KWQKPartsBrowserInterface.mm:
1230         (KParts::BrowserInterface::callMethod):
1231         * kwq/KWQKStandardDirs.mm:
1232         * kwq/KWQKURL.mm:
1233         * kwq/KWQKWinModule.mm:
1234         (KWinModule::workArea):
1235         * kwq/KWQObject.mm:
1236         * kwq/KWQString.mm:
1237         (QString::getNSString):
1238         * kwq/KWQTimer.mm:
1239         * kwq/KWQWindowWidget.mm:
1240
1241 2003-10-07  David Hyatt  <hyatt@apple.com>
1242
1243         Fix for link dragging regression in the titles of links.  More accessibility 
1244         improvements.
1245         
1246         Reviewed by darin
1247
1248         * khtml/khtml_part.cpp:
1249         (KHTMLPart::text):
1250         * kwq/KWQAccObject.mm:
1251         (-[KWQAccObject role]):
1252         (-[KWQAccObject roleDescription]):
1253         (-[KWQAccObject helpText]):
1254         (-[KWQAccObject textUnderElement]):
1255         (-[KWQAccObject value]):
1256         (-[KWQAccObject title]):
1257         (-[KWQAccObject accessibilityIsIgnored]):
1258         (-[KWQAccObject accessibilityAttributeValue:]):
1259         * kwq/WebCoreBridge.mm:
1260         (-[WebCoreBridge elementAtPoint:]):
1261
1262 2003-10-07  Ken Kocienda  <kocienda@apple.com>
1263
1264         Reviewed by Darin
1265
1266         Fix for these bugs:
1267
1268         <rdar://problem/3443296>: REGRESSION: pop-up menu gets focus, but once it has   
1269         focus doesn't work right
1270         <rdar://problem/3444873>: Select widgets that use list views do not take part in tab order
1271         <rdar://problem/3446306>: Text area form widgets do not accept DOM focus correctly
1272         <rdar://problem/3446323>: Using keyboard to work popup button select form 
1273         widget causes a crash
1274
1275         The intention of this patch is to add keyboard navigation support for
1276         HTML form select widgets. This includes the two visual representations
1277         for these widgets: popup buttons and lists. Many keyboard, focus, and
1278         tabbing fixes are included in this work, as indicated below.
1279
1280         * khtml/html/html_formimpl.cpp:
1281         (HTMLSelectElementImpl::defaultEventHandler): Added. Submit form when
1282         return or enter key is pressed when focused on a select widget.
1283         * khtml/html/html_formimpl.h: Make HTMLSelectElementImpl a friend class
1284         of HTMLInputElementImpl. This is done so that an HTMLSelectElementImpl
1285         can call the private method which simulates a form submit.
1286         Also add declaration of defaultEventHandler function.
1287         * kwq/KWQButton.h: Clean up focusPolicy declaration.
1288         * kwq/KWQComboBox.h: Add focusPolicy declaration.
1289         * kwq/KWQComboBox.mm:
1290         (QComboBox::focusPolicy): Added. Widget will focus if full keyboard
1291         access is on.
1292         (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]): Now
1293         calls sendFakeEventsAfterWidgetTracking instead of 
1294         doFakeMouseUpAfterWidgetTracking now that name has changed.
1295         (-[KWQPopUpButton becomeFirstResponder]): Added. Needed for setting
1296         focus correctly.
1297         (-[KWQPopUpButton resignFirstResponder]): Ditto.
1298         (-[KWQPopUpButton nextKeyView]): Added. Makes tabbing work correctly
1299         for this widget.
1300         (-[KWQPopUpButton previousKeyView]): Ditto.
1301         (-[KWQPopUpButton nextValidKeyView]): Ditto.
1302         (-[KWQPopUpButton previousValidKeyView]): Ditto.
1303         * kwq/KWQKHTMLPart.h: Change name of doFakeMouseUpAfterWidgetTracking
1304         to sendFakeEventsAfterWidgetTracking now that it handles key events
1305         as well.
1306         * kwq/KWQKHTMLPart.mm:
1307         (KWQKHTMLPart::sendFakeEventsAfterWidgetTracking): Name change as
1308         noted above. Also handles sending simulated key up events.
1309         * kwq/KWQLineEdit.h:
1310         (QLineEdit::checksDescendantsForFocus): Added. This is a big
1311         part of the fiz for <rdar://problem/3446306>.
1312         * kwq/KWQListBox.h:
1313         (QListBox::checksDescendantsForFocus): Ditto. Yes for this widget.
1314         * kwq/KWQListBox.mm:
1315         (QListBox::focusPolicy): Added. Widget will focus if full keyboard
1316         access is on.
1317         (-[KWQListBoxScrollView becomeFirstResponder]): Added. Needed for setting
1318         focus correctly. This sets the focus to its document view.
1319         (-[KWQTableView becomeFirstResponder]): Added. Needed for setting
1320         focus correctly.
1321         (-[KWQTableView resignFirstResponder]): Added. Needed for setting
1322         focus correctly.
1323         (-[KWQTableView nextKeyView]): Added. Makes tabbing work correctly
1324         for this widget.
1325         (-[KWQTableView previousKeyView]): Ditto.
1326         (-[KWQTableView nextValidKeyView]): Ditto.
1327         (-[KWQTableView previousValidKeyView]): Ditto.
1328         (-[KWQTableView _KWQ_setKeyboardFocusRingNeedsDisplay]): Added.
1329         * kwq/KWQTextArea.mm:
1330         (-[KWQTextAreaTextView becomeFirstResponder]): Other part of fix for
1331         <rdar://problem/3446306>. The recursion guards were bad and wrong.
1332         The checksDescendantsForFocus improvement prevents the erroneous
1333         recursion from happening.
1334         * kwq/KWQTextEdit.h:
1335         (QTextEdit::checksDescendantsForFocus): Added. Yes for this widget.
1336         * kwq/KWQWidget.h:
1337         (QWidget::checksDescendantsForFocus): Added. No by default.
1338         * kwq/KWQWidget.mm:
1339         (QWidget::hasFocus): Now uses checksDescendantsForFocus to perform
1340         proper checks for views that may have a subview which is first
1341         responder.
1342
1343 2003-10-07  David Hyatt  <hyatt@apple.com>
1344
1345         Fix for 3363421, event handlers could be triggered for content outside an overflow:hidden
1346         area.  The layer checks that test for intersection/point containment need to only include
1347         layers with overhanging floats if the element is overflow:visible.
1348
1349         Fix for 3366801, assignment to scrollLeft/Top of an overflow:hidden layer makes the layer
1350         disappear.  overflow:hidden blocks actually were never computing their scroll dimensions,
1351         and so had bogus answers for those values.
1352
1353         Fix for 3366686, no reliable scrollHeight/Width reporting for overflow:hidden or
1354         overflow:visible elements.  The former was caused by the same bug as 3366801.  The
1355         latter was just me using the wrong method (clientWidth/Height instead of
1356         overflowWidth/Height).
1357
1358         This patch also tightens the assignment to scrollLeft/Top to not do anything if you don't 
1359         have an overflow value other than visible.
1360         
1361         Reviewed by darin
1362
1363         * khtml/ecma/kjs_dom.cpp:
1364         (DOMNode::putValue):
1365         * khtml/rendering/render_block.cpp:
1366         (khtml::RenderBlock::layoutBlock):
1367         * khtml/rendering/render_flexbox.cpp:
1368         (khtml::RenderFlexibleBox::layoutBlock):
1369         * khtml/rendering/render_layer.cpp:
1370         (RenderLayer::RenderLayer):
1371         (RenderLayer::scrollToOffset):
1372         (RenderLayer::scrollWidth):
1373         (RenderLayer::scrollHeight):
1374         (RenderLayer::computeScrollDimensions):
1375         (RenderLayer::updateScrollInfoAfterLayout):
1376         (RenderLayer::intersectsDamageRect):
1377         (RenderLayer::containsPoint):
1378         * khtml/rendering/render_layer.h:
1379         * khtml/rendering/render_object.cpp:
1380         (RenderObject::scrollWidth):
1381         (RenderObject::scrollHeight):
1382         * khtml/rendering/render_object.h:
1383
1384 2003-10-07  Darin Adler  <darin@apple.com>
1385
1386         Reviewed by Chris.
1387
1388         - fixed some exceptions I was seeing with my recent text change
1389
1390         * khtml/khtml_part.cpp:
1391         (KHTMLPart::text): Return an empty string for a null range rather than raising an exception.
1392         (KHTMLPart::selection): Return a null range rather than raising an exception if there is
1393         no selection.
1394
1395 2003-10-07  Darin Adler  <darin@apple.com>
1396
1397         Reviewed by Dave.
1398
1399         - removed code that mutates \n into a space so we can pass more W3C DOM Level 1 Core tests
1400
1401         * khtml/rendering/bidi.cpp:
1402         (khtml::addRun): Treat \n as a space.
1403         (khtml::RenderBlock::computeHorizontalPositionsForLine): Treat \n as a space.
1404         (khtml::RenderBlock::findNextLineBreak): Treat \n outside <pre> as a space.
1405         Removed code that mutates the \n into a space.
1406
1407         * khtml/rendering/render_text.cpp:
1408         (RenderText::trimmedMinMaxWidth): Treat \n outside <pre> as a space.
1409         (RenderText::calcMinMaxWidth): Treat \n outside <pre> as a space.
1410         Removed code that mutates the \n into a space.
1411         (RenderText::position): Detect a <br> with isBR instead of assuming a 1-character
1412         string with a \n in it is a <br>.
1413
1414 2003-10-06  David Hyatt  <hyatt@apple.com>
1415
1416         Several fixes preparing for the incremental repainting patch to be enabled.
1417
1418         (1) Make layers update their positions after layout instead of during layout or
1419         during painting.
1420
1421         (2) Fix a regression from the overflow:hidden body quirk landing.  Make sure repaint()
1422         understands that quirk exists and avoids clipping when it shouldn't.
1423
1424         (3) Fix a regression from the scrollbar improvements.  The vertical scrollbar repainted
1425         on every layout.
1426
1427         (4) Make sure outside list bullets are repainted when a list item needs to repaint.
1428         
1429         (5) A whole bunch of INCREMENTAL_REPAINTING code that isn't turned on yet.
1430         
1431         Reviewed by kocienda
1432
1433         * khtml/khtmlview.cpp:
1434         (KHTMLViewPrivate::KHTMLViewPrivate):
1435         (KHTMLViewPrivate::reset):
1436         (KHTMLView::resetScrollBars):
1437         (KHTMLView::needsFullRepaint):
1438         * khtml/khtmlview.h:
1439         * khtml/rendering/bidi.cpp:
1440         (khtml::RenderBlock::layoutInlineChildren):
1441         * khtml/rendering/render_block.cpp:
1442         (khtml::RenderBlock::layoutBlock):
1443         (khtml::RenderBlock::layoutBlockChildren):
1444         (khtml::RenderBlock::getAbsoluteRepaintRectIncludingFloats):
1445         (khtml::RenderBlock::repaintFloatingDescendants):
1446         (khtml::RenderBlock::repaintObjectsBeforeLayout):
1447         * khtml/rendering/render_block.h:
1448         * khtml/rendering/render_box.cpp:
1449         (RenderBox::computeAbsoluteRepaintRect):
1450         (RenderBox::repaintDuringLayoutIfMoved):
1451         * khtml/rendering/render_box.h:
1452         * khtml/rendering/render_canvas.cpp:
1453         (RenderCanvas::layout):
1454         * khtml/rendering/render_canvas.h:
1455         (khtml::RenderCanvas::hasOverhangingFloats):
1456         * khtml/rendering/render_flexbox.cpp:
1457         (khtml::RenderFlexibleBox::layoutBlock):
1458         (khtml::RenderFlexibleBox::layoutHorizontalBox):
1459         (khtml::RenderFlexibleBox::layoutVerticalBox):
1460         (khtml::RenderFlexibleBox::placeChild):
1461         * khtml/rendering/render_flexbox.h:
1462         * khtml/rendering/render_flow.cpp:
1463         (RenderFlow::getAbsoluteRepaintRect):
1464         * khtml/rendering/render_image.cpp:
1465         (RenderImage::setPixmap):
1466         (RenderImage::layout):
1467         * khtml/rendering/render_layer.cpp:
1468         (RenderLayer::RenderLayer):
1469         (RenderLayer::computeRepaintRects):
1470         (RenderLayer::updateLayerPositions):
1471         (RenderLayer::updateLayerPosition):
1472         (RenderLayer::checkScrollbarsAfterLayout):
1473         (RenderLayer::paintLayer):
1474         (RenderLayer::calculateClipRects):
1475         (RenderLayer::calculateRects):
1476         * khtml/rendering/render_layer.h:
1477         (khtml::RenderLayer::relativePositionOffset):
1478         * khtml/rendering/render_list.cpp:
1479         (RenderListItem::getAbsoluteRepaintRect):
1480         * khtml/rendering/render_list.h:
1481         (khtml::RenderListMarker::listImage):
1482         * khtml/rendering/render_object.cpp:
1483         (RenderObject::repaint):
1484         (RenderObject::repaintRectangle):
1485         (RenderObject::repaintAfterLayoutIfNeeded):
1486         (RenderObject::repaintDuringLayoutIfMoved):
1487         (RenderObject::repaintFloatingDescendants):
1488         (RenderObject::checkForRepaintDuringLayout):
1489         (RenderObject::repaintObjectsBeforeLayout):
1490         (RenderObject::getAbsoluteRepaintRectIncludingFloats):
1491         (RenderObject::container):
1492         * khtml/rendering/render_object.h:
1493         * khtml/rendering/render_table.cpp:
1494         (RenderTable::layout):
1495         * kwq/KWQKHTMLPart.mm:
1496         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
1497
1498 2003-10-06  Darin Adler  <darin@apple.com>
1499
1500         Reviewed by Ken.
1501         
1502         - preparation for the upcoming whitespace patch; refactored some of the code that extracts text
1503
1504         * khtml/khtml_part.h: Added text() member function.
1505         * khtml/khtml_part.cpp:
1506         (KHTMLPart::text): Added. Refactored from selectedText; takes a DOM::Range as a parameter.
1507         Also added code to change newlines to spaces when extracting text from the DOM.
1508         (KHTMLPart::selectedText): Now calls text().
1509         (KHTMLPart::selection): Removed stray declaration.
1510
1511         * kwq/KWQAccObject.mm: (-[KWQAccObject value]): Changed to call KHTMLPart::text.
1512         * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Changed to call KHTMLPart::text
1513         instead of doing it ourselves.
1514         
1515         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::attributedString): Added code to change change '\n'
1516         newlines to spaces when extracting text from the DOM.
1517
1518 2003-10-05  Maciej Stachowiak  <mjs@apple.com>
1519
1520         Reviewed by Ken.
1521
1522         - fixed 3444255 - REGRESSION: www.aa.com crashes (innerHTML)
1523
1524         * khtml/html/html_elementimpl.cpp:
1525         (HTMLElementImpl::createContextualFragment): Keep the fragment
1526         ref'd since the tokenizer will ref and deref it. Then turn
1527         TreeShared's evil against itself to get the fragment back in the
1528         floating 0-ref state.
1529         * khtml/html/html_elementimpl.h: Remove stray whitespace.
1530         * khtml/html/htmlparser.cpp:
1531         (KHTMLParser::KHTMLParser): Initialize current to 0 in the other
1532         constructor too.
1533
1534 2003-10-06  Darin Adler  <darin@apple.com>
1535
1536         * khtml/ecma/kjs_css.lut.h:
1537         * khtml/ecma/kjs_dom.lut.h:
1538         * khtml/ecma/kjs_events.lut.h:
1539         * khtml/ecma/kjs_html.lut.h:
1540         * khtml/ecma/kjs_navigator.lut.h:
1541         * khtml/ecma/kjs_range.lut.h:
1542         * khtml/ecma/kjs_traversal.lut.h:
1543         * khtml/ecma/kjs_views.lut.h:
1544         * khtml/ecma/kjs_window.lut.h:
1545         Regenerated, without stray semicolon.
1546
1547 2003-10-03  Darin Adler  <darin@apple.com>
1548
1549         - updated layout tests for recent WebTextRenderer changes
1550
1551         * layout-tests/apple-only/base/www.cnn.com/index-expected.txt:
1552         * layout-tests/apple-only/base/www.sun.com/index-expected.txt:
1553         * layout-tests/css1/font_properties/font_weight-expected.txt:
1554
1555 2003-10-03  Chris Blumenberg  <cblu@apple.com>
1556
1557         Removed eastCursor.tiff because it was added by mistake.
1558
1559         * Resources/eastCursor.tiff: Removed.
1560         * WebCore.pbproj/project.pbxproj:
1561
1562 2003-10-03  Maciej Stachowiak  <mjs@apple.com>
1563
1564         Reviewed by Richard.
1565         
1566         - fixed 3398420 - crash when creating a new document.body object in <body>
1567
1568         Also included David Faure's improvement to throw an exception.
1569         
1570         * khtml/html/html_documentimpl.cpp:
1571         (HTMLDocumentImpl::setBody): Don't remove the body when null is passed in,
1572         as this means type error at the higher level, so throw an exception.
1573         * khtml/html/htmlparser.cpp:
1574         (KHTMLParser::KHTMLParser): Initialize current to 0.
1575         (KHTMLParser::setCurrent): Ref new current and deref old; we need to
1576         keep it ref'd because script execution could drop the current node on the
1577         floor.
1578         (KHTMLParser::reset): Use setCurrent.
1579         (KHTMLParser::insertNode): Likewise.
1580         (KHTMLParser::reopenResidualStyleTags): Likewise.
1581         (KHTMLParser::popOneBlock): Likewise.
1582         (KHTMLParser::finished): Likewise.
1583         * khtml/html/htmlparser.h: Prototype setCurrent.
1584
1585 2003-10-03  Chris Blumenberg  <cblu@apple.com>
1586
1587         Ran compress-tiffs on new cursor images.
1588
1589         * Resources/eastCursor.tiff:
1590         * Resources/eastResizeCursor.tiff:
1591         * Resources/helpCursor.tiff:
1592         * Resources/moveCursor.tiff:
1593         * Resources/northEastResizeCursor.tiff:
1594         * Resources/northResizeCursor.tiff:
1595         * Resources/northWestResizeCursor.tiff:
1596         * Resources/southEastResizeCursor.tiff:
1597         * Resources/southResizeCursor.tiff:
1598         * Resources/southWestResizeCursor.tiff:
1599         * Resources/waitCursor.tiff:
1600         * Resources/westResizeCursor.tiff:
1601
1602 2003-10-03  Ken Kocienda  <kocienda@apple.com>
1603
1604         Reviewed by Darin, with much help from Maciej and Hyatt
1605
1606         Fix for these bugs:
1607
1608         <rdar://problem/3441321>: Form buttons do not respond to key events when focused
1609         <rdar://problem/3441060>: Form buttons do not scroll to view when focused
1610
1611         * khtml/html/html_formimpl.cpp:
1612         (HTMLInputElementImpl::simulateMouseClickForEvent): Added helper to simulate
1613         mouse clicks in elements. Used to trigger button actions in response to
1614         keyboard events.
1615         (HTMLInputElementImpl::defaultEventHandler): Improved handler to process
1616         key press events for radio, checkbox, image, reset, and submit buttons.
1617         * khtml/html/html_formimpl.h: Added simulateMouseClickForEvent function.
1618         * khtml/xml/dom2_eventsimpl.h:
1619         (DOM::EventImpl::isKeyboardEvent): Added type check virtual function.
1620         (DOM::KeyEventImpl::isKeyboardEvent): Ditto.
1621         * kwq/KWQButton.h:
1622         * kwq/KWQButton.mm:
1623         (-[KWQButton simulateClick]): New method. This makes AppKit do a 
1624         button click programatically for button types. For <input type=image>, 
1625         we just simulate a the click in the DOM since there is no real "clickable"
1626         AppKit widget.
1627         (-[KWQButton becomeFirstResponder]): Fixes the button scroll to visible when
1628         focused issue.
1629         (-[KWQButton resignFirstResponder]): Correctly give up focus when user clicks
1630         into the page body when a button has the focus.
1631         (QButton::simulateClick): QWidget bridge to the KWQButton simulateClick
1632         method.
1633
1634 2003-10-03  David Hyatt  <hyatt@apple.com>
1635
1636         Removing redundant layouts and adding a few !needsLayout and !normalChildNeedsLayout
1637         checks to prevent extra layouts.
1638
1639         Also, fixing the recalcStyle changed() bottleneck to go through view's layout and to
1640         not do a full repaint.  The layout method will then do the right thing (full repaint
1641         without INCREMENTAL_REPAINTING turned on, the precise repainting needed otherwise).
1642         
1643         Reviewed by darin
1644
1645         * khtml/html/html_tableimpl.cpp:
1646         (HTMLTableElementImpl::parseAttribute):
1647         * khtml/rendering/render_block.cpp:
1648         * khtml/rendering/render_container.cpp:
1649         (RenderContainer::appendChildNode):
1650         (RenderContainer::insertChildNode):
1651         * khtml/xml/dom_docimpl.cpp:
1652         (DocumentImpl::recalcStyle):
1653
1654 2003-10-02  David Hyatt  <hyatt@apple.com>
1655
1656         Remove the speed hit from using the UC break locators by not using them when
1657         checking if the current character is &nbsp; and by also using a global text
1658         break locator object.
1659         
1660         Reviewed by rjw
1661
1662         * khtml/rendering/break_lines.cpp:
1663
1664 === Safari-108 ===
1665
1666 2003-10-02  Maciej Stachowiak  <mjs@apple.com>
1667
1668         Reviewed by Darin.
1669
1670         - fixed 3398622 - Crash when JavaScript changes display style
1671
1672         This was a problem with one of the many global variables in
1673         bidi.cpp, last, having a stale value from the last layout that
1674         pointed to a dead node. I fixed this by refactoring the code to
1675         put most of the global variables in a struct allocated on the
1676         stack, and pass around a reference to the struct. Seems much
1677         cleaner (if somewhat wordier) this way. There are still more
1678         global variables to kill here.
1679         
1680         * khtml/rendering/bidi.cpp:
1681         (khtml::BidiIterator::BidiIterator):
1682         (khtml::BidiStatus::BidiStatus):
1683         (khtml::BidiInfo::BidiInfo):
1684         (khtml::Bidinext):
1685         (khtml::first):
1686         (khtml::BidiIterator::increment):
1687         (khtml::checkMidpoints):
1688         (khtml::appendRunsForObject):
1689         (khtml::appendRun):
1690         (khtml::embed):
1691         (khtml::RenderBlock::computeHorizontalPositionsForLine):
1692         (khtml::RenderBlock::bidiReorderLine):
1693         (khtml::buildCompactRuns):
1694         (khtml::RenderBlock::layoutInlineChildren):
1695         (khtml::RenderBlock::findNextLineBreak):
1696         * khtml/rendering/bidi.h:
1697         * khtml/rendering/render_block.h:
1698
1699 2003-10-02  David Hyatt  <hyatt@apple.com>
1700
1701         Work on exposing elements to the Acc API.  This patch gets us to the point where text
1702         under the mouse is voiced.
1703         
1704         Reviewed by darin
1705
1706         * kwq/KWQAccObject.h:
1707         * kwq/KWQAccObject.mm:
1708         (-[KWQAccObject initWithRenderer:]):
1709         (-[KWQAccObject parentObject]):
1710         (-[KWQAccObject parentObjectUnignored]):
1711         (-[KWQAccObject addChildrenToArray:]):
1712         (-[KWQAccObject role]):
1713         (-[KWQAccObject roleDescription]):
1714         (-[KWQAccObject value]):
1715         (-[KWQAccObject title]):
1716         (-[KWQAccObject position]):
1717         (-[KWQAccObject size]):
1718         (-[KWQAccObject accessibilityIsIgnored]):
1719         (-[KWQAccObject accessibilityAttributeNames]):
1720         (-[KWQAccObject accessibilityActionNames]):
1721         (-[KWQAccObject accessibilityIsAttributeSettable:]):
1722         (-[KWQAccObject accessibilityAttributeValue:]):
1723         (-[KWQAccObject accessibilityHitTest:]):
1724         * kwq/KWQAccObjectCache.mm:
1725         (KWQAccObjectCache::accObject):
1726         (KWQAccObjectCache::setAccObject):
1727         (KWQAccObjectCache::removeAccObject):
1728         * kwq/WebCoreBridge.h:
1729         * kwq/WebCoreBridge.mm:
1730         (-[WebCoreBridge accessibilityTree]):
1731
1732 2003-10-02  Darin Adler  <darin@apple.com>
1733
1734         Reviewed by Ken.
1735
1736         * kwq/KWQRenderTreeDebug.cpp: (quoteAndEscapeNonPrintables): Since our text rendering renders
1737         non-breaking spaces the same as spaces, dump them as spaces. Do the same with newlines since
1738         I am about to change our text rendering to do the same with newlines.
1739
1740         * layout-tests: Updated test results.
1741
1742 2003-10-01  David Hyatt  <hyatt@apple.com>
1743
1744         Avoid doing extra work when tearing down the document by checking to see if
1745         we're in the destruction of the document.
1746         
1747         Reviewed by darin
1748
1749         * khtml/rendering/render_block.cpp:
1750         * khtml/rendering/render_container.cpp:
1751         (RenderContainer::removeChildNode):
1752
1753 2003-10-01  Richard Williamson   <rjw@apple.com>
1754
1755         Fixed 3438441.  Pass extra info up to WebKit about load type, specifically is a load is triggered by JS running in an onLoad handler.
1756
1757         Reviewed by Ken.
1758
1759         * khtml/ecma/kjs_binding.h:
1760         * kwq/KWQKHTMLPart.mm:
1761         (KWQKHTMLPart::openURL):
1762         (KWQKHTMLPart::openURLRequest):
1763         (KWQKHTMLPart::submitForm):
1764         (KWQKHTMLPart::urlSelected):
1765         * kwq/KWQKHTMLPartBrowserExtension.mm:
1766         (KHTMLPartBrowserExtension::createNewWindow):
1767
1768         * kwq/WebCoreBridge.h:
1769         * kwq/WebCoreBridge.mm:
1770         (-[WebCoreBridge saveDocumentToPageCache]):
1771         Nothing changed.  Tweaked spacing.
1772
1773 2003-10-01  Chris Blumenberg  <cblu@apple.com>
1774
1775         <rdar://problem/2942589>: CSS cursors are not implemented
1776
1777         Reviewed by Dave.
1778
1779         * Resources/eastCursor.tiff: Added.
1780         * Resources/eastResizeCursor.tiff: Added.
1781         * Resources/helpCursor.tiff: Added.
1782         * Resources/moveCursor.tiff: Added.
1783         * Resources/northEastResizeCursor.tiff: Added.
1784         * Resources/northResizeCursor.tiff: Added.
1785         * Resources/northWestResizeCursor.tiff: Added.
1786         * Resources/southEastResizeCursor.tiff: Added.
1787         * Resources/southResizeCursor.tiff: Added.
1788         * Resources/southWestResizeCursor.tiff: Added.
1789         * Resources/waitCursor.tiff: Added.
1790         * Resources/westResizeCursor.tiff: Added.
1791         * WebCore.pbproj/project.pbxproj:
1792         * khtml/css/cssparser.cpp: special-case the hand cursor to mean pointer
1793         (CSSParser::parseValue):
1794         * khtml/css/cssvalues.c: generated changes
1795         (hash_val):
1796         (findValue):
1797         * khtml/css/cssvalues.h: generated changes
1798         * khtml/css/cssvalues.in: removed the progress cursor from the list because it was messing up the mapping
1799         * khtml/khtmlview.cpp: call new cursor methods
1800         * kwq/KWQKCursor.h:
1801         * kwq/KWQKCursor.mm:
1802         (+[NSCursor _WebCore_cursorWithName:hotSpot:]): new, loads and caches cursors
1803         (KCursor::crossCursor): get the AppKit cross hair cursor
1804         (KCursor::handCursor): call _WebCore_cursorWithName:hotSpot:
1805         (KCursor::sizeAllCursor): ditto
1806         (KCursor::waitCursor): ditto
1807         (KCursor::whatsThisCursor): ditto
1808         (KCursor::eastResizeCursor): new, call _WebCore_cursorWithName:hotSpot:
1809         (KCursor::northResizeCursor): ditto
1810         (KCursor::northEastResizeCursor): ditto
1811         (KCursor::northWestResizeCursor): ditto
1812         (KCursor::southResizeCursor): ditto
1813         (KCursor::southEastResizeCursor): ditto
1814         (KCursor::southWestResizeCursor): ditto
1815         (KCursor::westResizeCursor): ditto
1816
1817 2003-10-01  David Hyatt  <hyatt@apple.com>
1818
1819         Clean up our detach model so that you can always get to a document, even for
1820         anonymous content.  Also stubbing out and adding the accessibility objects.
1821         
1822         Reviewed by darin, mjs, john
1823
1824         * ChangeLog:
1825         * WebCore.pbproj/project.pbxproj:
1826         * khtml/rendering/render_block.cpp:
1827         * khtml/rendering/render_box.cpp:
1828         (RenderBox::detach):
1829         * khtml/rendering/render_box.h:
1830         * khtml/rendering/render_canvas.cpp:
1831         (RenderCanvas::RenderCanvas):
1832         * khtml/rendering/render_container.cpp:
1833         (RenderContainer::detach):
1834         (RenderContainer::addChild):
1835         (RenderContainer::updatePseudoChild):
1836         (RenderContainer::insertChildNode):
1837         (RenderContainer::removeLeftoverAnonymousBoxes):
1838         * khtml/rendering/render_container.h:
1839         * khtml/rendering/render_flow.cpp:
1840         (RenderFlow::createAnonymousFlow):
1841         (RenderFlow::deleteLineBoxes):
1842         (RenderFlow::detach):
1843         * khtml/rendering/render_flow.h:
1844         * khtml/rendering/render_form.cpp:
1845         (RenderTextArea::detach):
1846         * khtml/rendering/render_form.h:
1847         * khtml/rendering/render_image.cpp:
1848         (RenderImage::RenderImage):
1849         (RenderImage::detach):
1850         * khtml/rendering/render_image.h:
1851         * khtml/rendering/render_inline.cpp:
1852         (RenderInline::addChildToFlow):
1853         (RenderInline::splitFlow):
1854         (RenderInline::renderName):
1855         * khtml/rendering/render_list.cpp:
1856         (RenderListItem::setStyle):
1857         (RenderListItem::detach):
1858         (RenderListItem::updateMarkerLocation):
1859         (RenderListMarker::RenderListMarker):
1860         * khtml/rendering/render_list.h:
1861         * khtml/rendering/render_object.cpp:
1862         (RenderObject::RenderObject):
1863         (RenderObject::information):
1864         (RenderObject::dump):
1865         (RenderObject::createAnonymousBlock):
1866         (RenderObject::remove):
1867         (RenderObject::detach):
1868         * khtml/rendering/render_object.h:
1869         * khtml/rendering/render_replaced.cpp:
1870         (RenderWidget::detach):
1871         * khtml/rendering/render_replaced.h:
1872         * khtml/rendering/render_table.cpp:
1873         (RenderTable::addChild):
1874         (RenderTableSection::detach):
1875         (RenderTableSection::addChild):
1876         (RenderTableRow::detach):
1877         (RenderTableRow::addChild):
1878         (RenderTableCell::detach):
1879         * khtml/rendering/render_table.h:
1880         * khtml/rendering/render_text.cpp:
1881         (RenderText::detach):
1882         (RenderText::deleteRuns):
1883         * khtml/rendering/render_text.h:
1884         * khtml/xml/dom_docimpl.cpp:
1885         (DocumentImpl::DocumentImpl):
1886         (DocumentImpl::~DocumentImpl):
1887         (DocumentImpl::detach):
1888         (DocumentImpl::getOrCreateAccObjectCache):
1889         * khtml/xml/dom_docimpl.h:
1890         * khtml/xml/dom_nodeimpl.cpp:
1891         (NodeImpl::detach):
1892         * kwq/KWQAccObject.h: Added.
1893         * kwq/KWQAccObject.mm: Added.
1894         (-[KWQAccObject x]):
1895         (-[KWQAccObject y]):
1896         (-[KWQAccObject width]):
1897         (-[KWQAccObject height]):
1898         (-[KWQAccObject detached]):
1899         (-[KWQAccObject detach]):
1900         (-[KWQAccObject data]):
1901         (-[KWQAccObject setData:]):
1902         (-[KWQAccObject firstChild]):
1903         (-[KWQAccObject lastChild]):
1904         (-[KWQAccObject previousSibling]):
1905         (-[KWQAccObject nextSibling]):
1906         (-[KWQAccObject parentObject]):
1907         * kwq/KWQAccObjectCache.h: Added.
1908         * kwq/KWQAccObjectCache.mm: Added.
1909         (KWQAccObjectCache::KWQAccObjectCache):
1910         (KWQAccObjectCache::~KWQAccObjectCache):
1911         (KWQAccObjectCache::accObject):
1912         (KWQAccObjectCache::setAccObject):
1913         (KWQAccObjectCache::removeAccObject):
1914         (KWQAccObjectCache::detach):
1915         * layout-tests/css1/pseudo/firstletter-expected.txt:
1916         * layout-tests/css1/pseudo/multiple_pseudo_elements-expected.txt:
1917         * layout-tests/fast/css-generated-content/002-expected.txt:
1918         * layout-tests/fast/css-generated-content/004-expected.txt:
1919         * layout-tests/fast/css-generated-content/005-expected.txt:
1920         * layout-tests/fast/css-generated-content/006-expected.txt:
1921         * layout-tests/fast/selectors/039-expected.txt:
1922         * layout-tests/fast/selectors/039b-expected.txt:
1923         * layout-tests/fast/selectors/041-expected.txt:
1924         * layout-tests/fast/selectors/042-expected.txt:
1925         * layout-tests/fast/selectors/166a-expected.txt:
1926         * layout-tests/fast/selectors/168-expected.txt:
1927         * layout-tests/fast/selectors/168a-expected.txt:
1928         * layout-tests/fast/selectors/169-expected.txt:
1929         * layout-tests/fast/selectors/169a-expected.txt:
1930         * layout-tests/fast/text/firstline/002-expected.txt:
1931         * layout-tests/fast/text/firstline/003-expected.txt:
1932
1933 2003-10-01  David Hyatt  <hyatt@apple.com>
1934
1935         Fix for 3163840, the images are mispositioned on the DHTML menus at the top of
1936         www.aa.com (and in many other places).  We needed to support returning the right
1937         value from hasProperty and tryGet for 'cssFloat'.  
1938
1939         This patch also adds support for getting/setting our custom CSS properties (-khtml-*)
1940         and just factors the code a bit better for all the special values.
1941         
1942         Reviewed by darin
1943
1944         * khtml/ecma/kjs_css.cpp:
1945         (cssPropertyName):
1946         (DOMCSSStyleDeclaration::hasProperty):
1947         (DOMCSSStyleDeclaration::tryGet):
1948         (DOMCSSStyleDeclaration::tryPut):
1949
1950 2003-10-01  Darin Adler  <darin@apple.com>
1951
1952         Reviewed by Dave.
1953
1954         - fixed 3437309 -- REGRESSION (100-107): Javascript menu doesn't work at www.aa.com
1955
1956         * khtml/xml/dom_elementimpl.cpp: (ElementImpl::removeAttribute): Restored the old behavior
1957         for removeAttribute and removeAttributeNS; these don't give NOT_FOUND_ERR. But keep the
1958         NOT_FOUND_ERR for removeAttributeNode and removedNamedItem.
1959
1960 2003-10-01  Ken Kocienda  <kocienda@apple.com>
1961
1962         Reviewed by me
1963
1964         * kwq/KWQWidget.mm:
1965         (QWidget::focusPolicy): Improved comment.
1966
1967 2003-10-01  Ken Kocienda  <kocienda@apple.com>
1968
1969         Reviewed by Maciej
1970
1971         Fix for these bugs:
1972
1973         <rdar://problem/3439736>: WebCore form button widgets do not accept focus
1974         <rdar://problem/3440770>: WebCore form button widgets do not take part in tabbing order
1975
1976         * kwq/KWQButton.h: Add focusPolicy function declaration.
1977         * kwq/KWQButton.mm: 
1978         (-[KWQButton nextKeyView]): Add tabbing support for buttons.
1979         (-[KWQButton previousKeyView]): Ditto
1980         (-[KWQButton nextValidKeyView]): Ditto
1981         (-[KWQButton previousValidKeyView]): Ditto
1982         (QButton::focusPolicy): Add focusPolicy implementation. This calls through
1983         to the recently-added accessor for full keyboard access to help in the
1984         determination for focus policy. For now, full keyboard access must be
1985         turned on for buttons to receive focus.
1986         * kwq/KWQTextEdit.h: Remove focusPolicy specialization from this class. The
1987         implementation in QWidget now serves this class well.
1988         * kwq/KWQTextEdit.mm: Ditto
1989         * kwq/KWQWidget.h: Added isEnabled function. Small, unrelated cleanup to 
1990         move the no-implementation setFocusPolicy() and setFocusProxy() functions
1991         fully into the header file.
1992         * kwq/KWQWidget.mm:
1993         (QWidget::isEnabled): Added. Calls through to the Cocoa view to retrieve
1994         this information.
1995         (QWidget::focusPolicy): Much improved focus policy function is now more
1996         general in stipulating the conditions for focus policy, and will work for
1997         more widgets.
1998
1999 2003-10-01  David Hyatt  <hyatt@apple.com>
2000
2001         Fix for 3440804, broken scrollbars in downloads window.  Make Auto be the default
2002         value in the enum, so that all scrollviews will be automatically initialized to be
2003         auto.
2004
2005         Reviewed by cblu
2006
2007         * kwq/KWQScrollView.h:
2008         * kwq/WebCoreFrameView.h:
2009
2010 2003-09-30  Ken Kocienda  <kocienda@apple.com>
2011
2012         Reviewed by me
2013
2014         * WebCore.pbproj/project.pbxproj: Made WebCoreKeyboardAccess.h a private header.
2015
2016 2003-09-30  Ken Kocienda  <kocienda@apple.com>
2017
2018         Reviewed by Maciej
2019         
2020         Fix for this bug:
2021         
2022         <rdar://problem/3439688>: WebKit needs to retrieve full keyboard access preference
2023         
2024         * WebCore.pbproj/project.pbxproj:
2025         * kwq/KWQKHTMLPart.h: Declare keyboardUIMode accessor.
2026         * kwq/KWQKHTMLPart.mm:
2027         (KWQKHTMLPart::keyboardUIMode): Implement keyboardUIMode accessor (calls through the bridge).
2028         * kwq/WebCoreBridge.h: Declare the bridge accessor.
2029         * kwq/WebCoreKeyboardAccess.h: Added. Header defines keyboard UI mode constants.
2030         
2031 2003-09-30  Maciej Stachowiak  <mjs@apple.com>
2032
2033         Reviewed by Ken.
2034
2035         - fixed 3375281 - Keyboard event handlers not fired if focus not in form field
2036         - fixed 3242927 - KeyPressed Event in Javascript don't work
2037         - fixed 3375353 - keyboard event.target not updated when blurring from form items
2038         - fixed 3183754 - returning false from key press handlers does not prevent typing or form submission
2039         
2040         * khtml/xml/dom_nodeimpl.cpp:
2041         (NodeImpl::dispatchKeyEvent): Force false when defaultHandled instead of
2042         based on a weird rule appropriate for KDE but not for us.
2043         * kwq/KWQKHTMLPart.mm:
2044         (KWQKHTMLPart::keyEvent): If there's no focus node, give the event
2045         to the body element instead of giving up. Also, reverse
2046         expectedsense of return value dispatchKeyEvent, since it returns
2047         true if it *didn't* swallow the event. And finally, let the key press
2048         event as well as the key down event for the initial NSKeyDown block
2049         default handling.
2050         * kwq/KWQListBox.mm:
2051         (-[KWQTableView keyDown:]): Respect return value from interceptKeyEvent:
2052         (-[KWQTableView keyUp:]): ditto
2053         * kwq/KWQTextArea.mm:
2054         (-[KWQTextAreaTextView keyDown:]): ditto
2055         (-[KWQTextAreaTextView keyUp:]): ditto
2056         * kwq/KWQTextField.mm:
2057         (-[KWQTextField textView:shouldHandleEvent:]): ditto
2058
2059 2003-09-30  David Hyatt  <hyatt@apple.com>
2060
2061         Improvements to layout transitions and scrollbar appearance/disappearance.  
2062         Also implementing a fix for 3264346, overflow applied to body should apply to
2063         the document's scrollers.
2064         
2065         Reviewed by darin
2066
2067         * khtml/html/html_baseimpl.cpp:
2068         (HTMLFrameElementImpl::parseAttribute):
2069         * khtml/khtmlview.cpp:
2070         (KHTMLView::KHTMLView):
2071         (KHTMLView::~KHTMLView):
2072         (KHTMLView::resetScrollBars):
2073         (KHTMLView::clear):
2074         (KHTMLView::initScrollBars):
2075         (KHTMLView::applyBodyScrollQuirk):
2076         (KHTMLView::inLayout):
2077         * khtml/khtmlview.h:
2078         * khtml/rendering/render_block.cpp:
2079         * khtml/rendering/render_block.h:
2080         * khtml/rendering/render_canvas.cpp:
2081         (RenderCanvas::layout):
2082         * khtml/rendering/render_form.cpp:
2083         (TextAreaWidget::TextAreaWidget):
2084         * khtml/rendering/render_frames.cpp:
2085         (RenderFrame::slotViewCleared):
2086         (RenderPartObject::slotViewCleared):
2087         * khtml/rendering/render_list.cpp:
2088         (RenderListMarker::calcMinMaxWidth):
2089         * khtml/rendering/render_object.cpp:
2090         (RenderObject::repaint):
2091         (RenderObject::repaintRectangle):
2092         * khtml/xml/dom_docimpl.cpp:
2093         (DocumentImpl::setInPageCache):
2094         * kwq/KWQKHTMLPart.mm:
2095         (KWQKHTMLPart::createPart):
2096         * kwq/KWQRenderTreeDebug.cpp:
2097         (write):
2098         (externalRepresentation):
2099         * kwq/KWQScrollView.h:
2100         * kwq/KWQScrollView.mm:
2101         (QScrollView::setVScrollBarMode):
2102         (QScrollView::setHScrollBarMode):
2103         (QScrollView::setScrollBarsMode):
2104         (QScrollView::vScrollBarMode):
2105         (QScrollView::hScrollBarMode):
2106         (QScrollView::hasVerticalScrollBar):
2107         (QScrollView::hasHorizontalScrollBar):
2108         (QScrollView::suppressScrollBars):
2109         * kwq/WebCoreBridge.mm:
2110         (-[WebCoreBridge installInFrame:]):
2111         * kwq/WebCoreFrameView.h:
2112
2113 2003-09-30  David Hyatt  <hyatt@apple.com>
2114
2115         Fix for 3437260, nil deref of the render style because it hasn't been set yet.
2116         Fallout from my incremental repainting landing.
2117         
2118         Reviewed by darin
2119
2120         * khtml/rendering/render_replaced.cpp:
2121         (RenderWidget::setQWidget):
2122
2123 2003-09-29  David Hyatt  <hyatt@apple.com>
2124
2125         Fix for 3438479, tables expand on every layout when a cell has percentage height
2126         children.
2127         
2128         Reviewed by darin
2129
2130         * khtml/rendering/render_table.cpp:
2131         (RenderTableSection::calcRowHeight):
2132         (RenderTableRow::layout):
2133
2134 2003-09-29  Chris Blumenberg  <cblu@apple.com>
2135
2136         Fixed: <rdar://problem/3332460>: nil-deref in khtml::RenderWidget::eventFilter with onchange handler
2137
2138         Reviewed by darin.
2139
2140         * kwq/KWQTextField.mm:
2141         (-[KWQTextField controlTextDidEndEditing:]): call setHasFocus:NO last so we have the widget that lets us get to the bridge and lets us call controlTextDidEndEditing
2142
2143 2003-09-29  David Hyatt  <hyatt@apple.com>
2144
2145         Fix for 3425053, text past the bottom of a positioned table doesn't repaint.
2146         3426847 is the same bug.  Both are fixed by ensuring that calcHeight doesn't actually
2147         do anything other than margin computation and position determination for positioned
2148         elements.  In reality, for weird edge cases like implying the height via explicit top and
2149         bottom properties, we'll still be wrong.
2150         
2151         Reviewed by darin
2152
2153         * ChangeLog:
2154         * khtml/rendering/render_table.cpp:
2155         (RenderTable::layout):
2156
2157 2003-09-29  David Hyatt  <hyatt@apple.com>
2158
2159         Make sure that timeouts updateRendering after they execute the scheduled timer
2160         action.  
2161
2162         Also fixing 3429455, maxwidth of pres miscomputed when two blank lines occur at
2163         the end of a pre text run.
2164         
2165         Reviewed by darin, mjs (setTimeout fix), darin (pre fix)
2166
2167         * khtml/ecma/kjs_window.cpp:
2168         (ScheduledAction::execute):
2169         * khtml/rendering/render_text.cpp:
2170         (RenderText::trimmedMinMaxWidth):
2171         (RenderText::calcMinMaxWidth):
2172
2173 2003-09-29  Darin Adler  <darin@apple.com>
2174
2175         Reviewed by John.
2176
2177         - fixed 3437292 -- Safari uses wrong characters for &and; and &or; entities
2178
2179         * khtml/html/kentities.gperf: Corrected values for &and; and &or; entities.
2180         Checked all the rest against a list on the W3C site, and those are the only two that were wrong.
2181         * khtml/html/kentities.c: Regnenerated.
2182
2183 2003-09-26  Ken Kocienda  <kocienda@apple.com>
2184
2185         Reviewed by John
2186
2187         Fix for this bug:
2188
2189         <rdar://problem/3435532>: REGRESSION: tabbing to textareas causes infinite recursion
2190
2191         Add recursion guards to the becomeFirstResponder method, otherwise calling
2192         eventFilter with a FocusIn event will cause the infinite recursion
2193         described in the bug.
2194
2195         * kwq/KWQTextArea.mm:
2196         (-[KWQTextAreaTextView becomeFirstResponder]):
2197
2198 2003-09-25  Maciej Stachowiak  <mjs@apple.com>
2199
2200         Reviewed by John.
2201
2202         * khtml/ecma/kjs_window.cpp:
2203         (Window::installTimeout): Variant that takes a function and args.
2204         (WindowFunc::tryCall): If the argument is a function, call the
2205         function variant of installTimeout instead of pointlessly passing
2206         the string. Also, correctly implement the code to pass extra args
2207         along.
2208         * khtml/ecma/kjs_window.h:
2209
2210 2003-09-25  Maciej Stachowiak  <mjs@apple.com>
2211
2212         Roll out build system change since it did not actually work. :-(
2213         
2214         * WebCore.pbproj/project.pbxproj:
2215
2216 2003-09-25  David Hyatt  <hyatt@apple.com>
2217
2218         Landing the new repainting code.  This code eliminates many redundant layouts, makes
2219         layout scheduling work properly when called from WebKit, cleans up relpositioned inlines
2220         that act as containing blocks for absolute positioned children, and eliminates the
2221         repaint timer.
2222         
2223         Reviewed by kocienda
2224
2225         * khtml/html/html_documentimpl.cpp:
2226         (HTMLDocumentImpl::close):
2227         * khtml/khtmlview.cpp:
2228         (KHTMLView::KHTMLView):
2229         * khtml/khtmlview.h:
2230         * khtml/rendering/render_block.cpp:
2231         * khtml/rendering/render_block.h:
2232         * khtml/rendering/render_box.cpp:
2233         (RenderBox::setStyle):
2234         (RenderBox::setPixmap):
2235         (RenderBox::getAbsoluteRepaintRect):
2236         (RenderBox::computeAbsoluteRepaintRect):
2237         (RenderBox::repaintIfMoved):
2238         (RenderBox::calcAbsoluteHorizontal):
2239         (RenderBox::calcAbsoluteVertical):
2240         * khtml/rendering/render_box.h:
2241         * khtml/rendering/render_canvas.cpp:
2242         (RenderCanvas::layout):
2243         (RenderCanvas::repaintViewRectangle):
2244         (RenderCanvas::getAbsoluteRepaintRect):
2245         (RenderCanvas::computeAbsoluteRepaintRect):
2246         * khtml/rendering/render_canvas.h:
2247         * khtml/rendering/render_container.cpp:
2248         (RenderContainer::addChild):
2249         (RenderContainer::removeChildNode):
2250         (RenderContainer::removeChild):
2251         (RenderContainer::appendChildNode):
2252         (RenderContainer::insertChildNode):
2253         * khtml/rendering/render_flexbox.cpp:
2254         * khtml/rendering/render_flow.cpp:
2255         (RenderFlow::getAbsoluteRepaintRect):
2256         * khtml/rendering/render_flow.h:
2257         * khtml/rendering/render_image.cpp:
2258         (RenderImage::setPixmap):
2259         (RenderImage::layout):
2260         * khtml/rendering/render_inline.cpp:
2261         (RenderInline::addChildToFlow):
2262         * khtml/rendering/render_layer.cpp:
2263         (RenderLayer::convertToLayerCoords):
2264         * khtml/rendering/render_list.cpp:
2265         (RenderListMarker::setPixmap):
2266         * khtml/rendering/render_object.cpp:
2267         (RenderObject::RenderObject):
2268         (RenderObject::setNeedsLayout):
2269         (RenderObject::setChildNeedsLayout):
2270         (RenderObject::markContainingBlocksForLayout):
2271         (RenderObject::containingBlock):
2272         (RenderObject::repaint):
2273         (RenderObject::repaintRectangle):
2274         (RenderObject::repaintAfterLayoutIfNeeded):
2275         (RenderObject::repaintIfMoved):
2276         (RenderObject::repaintPositionedAndFloatingDescendants):
2277         (RenderObject::getAbsoluteRepaintRect):
2278         (RenderObject::getAbsoluteRepaintRectIncludingDescendants):
2279         (RenderObject::computeAbsoluteRepaintRect):
2280         (RenderObject::setStyle):
2281         (RenderObject::container):
2282         (RenderObject::detach):
2283         (RenderObject::scheduleRelayout):
2284         * khtml/rendering/render_object.h:
2285         * khtml/rendering/render_style.cpp:
2286         (RenderStyle::diff):
2287         * khtml/rendering/render_table.cpp:
2288         (RenderTable::layout):
2289         (RenderTableRow::getAbsoluteRepaintRect):
2290         (RenderTableCell::computeAbsoluteRepaintRect):
2291         * khtml/rendering/render_table.h:
2292         * khtml/xml/dom_nodeimpl.cpp:
2293         (NodeBaseImpl::insertBefore):
2294         (NodeBaseImpl::replaceChild):
2295         (NodeBaseImpl::appendChild):
2296         * kwq/KWQKHTMLPart.mm:
2297         (KWQKHTMLPart::clearTimers):
2298         * kwq/KWQRenderTreeDebug.cpp:
2299         (write):
2300         (externalRepresentation):
2301         * kwq/KWQRenderTreeDebug.h:
2302
2303 2003-09-25  Maciej Stachowiak  <mjs@apple.com>
2304
2305         Reviewed by Darin.
2306
2307         * WebCore.pbproj/project.pbxproj: Don't hack install name. Instead
2308         of embedding into Safari, embed into WebKit as sub-umbrella.
2309
2310 === Safari-107 ===
2311
2312 2003-09-25  Darin Adler  <darin@apple.com>
2313
2314         - rolled out change to fix 3390850 because it caused a performance regression
2315
2316         * khtml/misc/decoder.cpp: (Decoder::decode): Rolled out change.
2317
2318 2003-09-25  Ken Kocienda  <kocienda@apple.com>
2319
2320         Reviewed by Dave
2321
2322         Name change: TextRun is now InlineTextBox. Some related names
2323         have been changed as well. There should be no change in
2324         behavior as a result of this patch.
2325
2326         * khtml/khtml_part.cpp:
2327         (KHTMLPart::selectedText):
2328         (firstRunAt):
2329         (lastRunAt):
2330         (startAndEndLineNodesIncludingNode):
2331         * khtml/rendering/bidi.cpp:
2332         * khtml/rendering/render_flow.cpp:
2333         (RenderFlow::paintLineBoxDecorations):
2334         * khtml/rendering/render_line.cpp:
2335         (InlineFlowBox::placeBoxesHorizontally):
2336         (InlineFlowBox::placeBoxesVertically):
2337         * khtml/rendering/render_line.h:
2338         * khtml/rendering/render_text.cpp:
2339         (InlineTextBox::detach):
2340         (throw):
2341         (InlineTextBox::operator delete):
2342         (InlineTextBox::paintSelection):
2343         (InlineTextBox::paintDecoration):
2344         (InlineTextBox::checkSelectionPoint):
2345         (InlineTextBoxArray::InlineTextBoxArray):
2346         (InlineTextBoxArray::compareItems):
2347         (InlineTextBoxArray::findFirstMatching):
2348         (RenderText::deleteRuns):
2349         (RenderText::findNextInlineTextBox):
2350         (RenderText::nodeAtPoint):
2351         (RenderText::checkSelectionPointIgnoringContinuations):
2352         (RenderText::cursorPos):
2353         (RenderText::posOfChar):
2354         (RenderText::paintObject):
2355         (RenderText::createInlineBox):
2356         (RenderText::position):
2357         (RenderText::width):
2358         * khtml/rendering/render_text.h:
2359         * kwq/KWQKHTMLPart.mm:
2360         (KWQKHTMLPart::attributedString):
2361         * kwq/KWQRenderTreeDebug.cpp:
2362         (writeTextRun):
2363         (write):
2364
2365 2003-09-25  Darin Adler  <darin@apple.com>
2366
2367         Added a new layout test.
2368
2369         * layout-tests/fast/forms/form-element-geometry-expected.txt: Added.
2370         * layout-tests/fast/forms/form-element-geometry.html: Added.
2371
2372 2003-09-24  Darin Adler  <darin@apple.com>
2373
2374         * layout-tests/fast/table/003-expected.txt: Updated for textarea width change.
2375
2376 2003-09-24  David Hyatt  <hyatt@apple.com>
2377
2378         Fix for 3429646, <img src="blah"<img src="foo"> should show up as two images.
2379         
2380         Reviewed by darin
2381
2382         * khtml/html/htmlparser.cpp:
2383         (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
2384         * khtml/html/htmltokenizer.cpp:
2385         (HTMLTokenizer::parseTag):
2386
2387 2003-09-24  Darin Adler  <darin@apple.com>
2388
2389         Reviewed by Dave.
2390
2391         - fixed a recent regression, and ...
2392         - fixed 3386544 -- ARCH: <object>s don't support transclusion like <iframe>s do
2393
2394         * khtml/khtml_part.cpp: (KHTMLPart::childFrame): Added back a cast I should
2395         not have removed to fix the function.
2396
2397 2003-09-24  David Hyatt  <hyatt@apple.com>
2398
2399         Fix for 3430612, crash on about:blank in updateHoverActiveState.  Just missing
2400         a null-check.  Also remove a hover optimization that was bogus.
2401         
2402         Reviewed by darin
2403
2404         * khtml/rendering/render_layer.cpp:
2405         (RenderLayer::updateHoverActiveState):
2406
2407 2003-09-24  Richard Williamson   <rjw@apple.com>
2408
2409         Fixed 3420736.  Clear renderer caches when get an ATS font changed notification.  This fix may be moot depending on progress toward fixing 2695906.
2410
2411         * kwq/WebCoreBridge.h:
2412         * kwq/WebCoreBridge.mm:
2413         (+[WebCoreBridge updateAllViews]):
2414
2415 2003-09-24  Darin Adler  <darin@apple.com>
2416
2417         - a new test for JavaScript date parsing
2418
2419         * layout-tests/fast/js/date-parse-test-expected.txt: Added.
2420         * layout-tests/fast/js/date-parse-test.html: Added.
2421
2422 2003-09-24  Darin Adler  <darin@apple.com>
2423
2424         Reviewed by Ken.
2425
2426         - fixed ownerElement for documents in HTML objects (helpful for some work Dave is doing)
2427
2428         * khtml/khtml_part.h: Change name of frame function to childFrame for clarity.
2429         * khtml/khtml_part.cpp:
2430         (KHTMLPart::slotChildStarted): Call the frame function by its new name, childFrame.
2431         (KHTMLPart::slotChildCompleted): Ditto.
2432         (KHTMLPart::slotChildURLRequest): Ditto.
2433         (KHTMLPart::childFrame): Change name from frame to childFrame for clarity, and make it work
2434         for parts inside HTML objects, not just normal frames and iframes. The change in behavior is
2435         the actual fix. Note that for the three callers above, it's an error to call this when the
2436         result would be 0, so there's no harm in doing the extra search of HTML objects in those cases.
2437
2438         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::ownerElement): Call the frame function by its new
2439         name, childFrame. This is the caller that will benefit most from the change in behavior.
2440
2441         * kwq/KWQKHTMLPart.h: Remove childFrameForPart function, which is superseded by the
2442         childFrame function now.
2443         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::nextKeyViewInFrameHierarchy): Use childFrame instead
2444         of childFrameForPart.
2445
2446 2003-09-23  Darin Adler  <darin@apple.com>
2447
2448         Reviewed by Ken.
2449
2450         - fixed 3390850 -- Shift_JIS in meta tag ignored because <img> tag in JavaScript comes first (vintagecomp.com)
2451
2452         * khtml/misc/decoder.cpp: (Decoder::decode): Don't let tags inside a script make us think we're in the body.
2453         Later we can enhance this even more.
2454
2455 2003-09-22  Darin Adler  <darin@apple.com>
2456
2457         Reviewed by Ken.
2458
2459         - fixed 3292723 -- onBlur() getting called twice on <input type=text>
2460
2461         * khtml/rendering/render_replaced.cpp: (RenderWidget::eventFilter):
2462         Call setFocusNode(0) instead of explicitly sending a blur event, otherwise
2463         setFocusNode will send a second blur event later.
2464
2465 2003-09-22  Darin Adler  <darin@apple.com>
2466
2467         - fixed 3391837 -- we list ISO-8859-8-E as visual ordering for Hebrew; it's "explicit ordering", not supported
2468
2469         * kwq/mac-encodings.txt: Removed ISO-8859-8-E.
2470         * kwq/KWQCharsetData.c: Regenerated.
2471
2472 2003-09-22  Darin Adler  <darin@apple.com>
2473
2474         * kwq/KWQTextEdit.mm: (QTextEdit::sizeWithColumnsAndRows): Made it compile.
2475
2476 2003-09-22  Darin Adler  <darin@apple.com>
2477
2478         Reviewed by Maciej.
2479
2480         - fixed 3306041 -- Airborne tracking number field too narrow, tracking doesn't work (textare col property)
2481
2482         * khtml/rendering/render_form.cpp: (RenderTextArea::calcMinMaxWidth): Call the QTextEdit
2483         to ask it what size, rather than trying to compute it. This is the same thing we do with
2484         other widgets, I just hadn't done textarea yet.
2485
2486         * kwq/KWQTextEdit.h: Added sizeWithColumnsAndRows function.
2487         * kwq/KWQTextEdit.mm: (QTextEdit::sizeWithColumnsAndRows): Added. Calls through to the
2488         KWQTextArea object.
2489
2490         * kwq/KWQTextArea.h: Added sizeWithColumns:rows: method.
2491         * kwq/KWQTextArea.mm:
2492         (-[KWQTextArea _createTextView]): Make consistent with other callers of the size mapping methods
2493         by using [self class] instead of NSScrollView, and getting hasHorizontalScroller and
2494         hasVerticalScroller from the view.
2495         (-[KWQTextArea setFrame:]): Make consistent with other callers of the size mapping methods
2496         by using [self class] instead of NSScrollView.
2497         (-[KWQTextArea sizeWithColumns:rows:]): Added. Starts by computing the width and height of the
2498         columns specified, using a canonical width of a "0" character. Then converts that to a container
2499         size by adding line fragment padding. Then converts that into the text view size by adding the
2500         text container inset. Then converts that into the scroll view size by calling frameSizeForContentSize:.
2501
2502 2003-09-22  Darin Adler  <darin@apple.com>
2503
2504         * WebCore.pbproj/project.pbxproj: Rename Mixed build style to OptimizedWithSymbols.
2505
2506 2003-09-22  Darin Adler  <darin@apple.com>
2507
2508         Reviewed by Ken.
2509
2510         - research determined we were using nothing defined in config.h, so I got rid of it
2511
2512         * Makefile.am: Removed rules to generate config.h.
2513         * config.h: Removed.
2514
2515         * WebCore.pbproj/project.pbxproj: Removed define of HAVE_CONFIG_H.
2516
2517         * WebCorePrefix.h: Removed include of <config.h>.
2518
2519         * ForwardingHeaders/config.h: Emptied this file out. Can't remove this because there are
2520         some includes of <config.h> without HAVE_CONFIG_H wrappers.
2521
2522 2003-09-21  Darin Adler  <darin@apple.com>
2523
2524         Reviewed by Dave.
2525
2526         - fixed 3106411 -- show title attribute for page elements in tooltip on mouseover (important for PeopleSoft)
2527
2528         * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Set the value of a new element dictionary
2529         key, WebCoreElementTitleKey. This gives the title for an element, walking up the DOM tree as necessary
2530         to find it. It's used for tool tips at the WebKit level.
2531         * kwq/WebCoreBridge.h: Added WebCoreElementTitleKey and WebCorePageCacheStateKey.
2532
2533         * WebCore.exp: Added all the constants from WebCoreBridge.h; these should be exported even though they
2534         are not being used at the moment because the "WebCore and WebKit use the same constant keys" hack we
2535         are doing at the WebKit level means we can just use the WebKit keys on the WebKit side.
2536         * WebCore-combined.exp: Regenerated.
2537
2538 2003-09-20  Darin Adler  <darin@apple.com>
2539
2540         Reviewed by Dave.
2541
2542         - fixed 3328481 -- selection in select element list box does not scroll into view when set programatically
2543
2544         * kwq/KWQListBox.mm: (QListBox::setSelected): Scroll newly-selected item into view.
2545
2546 2003-09-20  Darin Adler  <darin@apple.com>
2547
2548         Reviewed by Dave.
2549
2550         - fixed 3429384 -- REGRESSION (89-90): nil-deref in KHTMLPart::write() (cheshiremotorcyclesalvage.com)
2551
2552         * khtml/khtml_part.cpp: (KHTMLPart::write): Add a nil check.
2553
2554 2003-09-20  Darin Adler  <darin@apple.com>
2555
2556         Reviewed by Dave.
2557
2558         - more fixes for the W3C DOM tests
2559
2560         * khtml/dom/dom_doc.cpp: (Document::createAttributeNS): Check that the attribute name
2561         is valid and throw INVALID_CHARACTER_ERR if not.
2562
2563         * khtml/dom/dom_element.cpp:
2564         (Element::removeAttributeNode): Get the attribute name properly. The old code would always
2565         get a 0, so this function would always fail.
2566         (Element::setAttributeNS): Check that the attribute name is valid and throw
2567         INVALID_CHARACTER_ERR if not.
2568         (Element::setAttributeNodeNS): Remove redundant exception checks that are also done by
2569         setNamedItem in the implementation. I had to change the implementation of one, so I decided
2570         it was better not to have any duplication.
2571
2572         * khtml/xml/dom_docimpl.h: Added isValidName function.
2573         * khtml/xml/dom_docimpl.cpp:
2574         (DocumentImpl::createHTMLElement): Check that the attribute name is valid and throw
2575         INVALID_CHARACTER_ERR if not.
2576         (DocumentImpl::isValidName): Added. Used to check for valid names.
2577
2578         * khtml/xml/dom_elementimpl.cpp:
2579         (NamedAttrMapImpl::setNamedItem): Don't do the document check until after checking for
2580         the "replace self" case. Otherwise we raise a spurious "in use" exception.
2581         (NamedAttrMapImpl::addAttribute): Point the new attribute at the element.
2582
2583 2003-09-19  Maciej Stachowiak  <mjs@apple.com>
2584
2585         Reviewed by Darin.
2586
2587         Roll out old fix for 3410980 and do a new better fix.
2588
2589         * khtml/html/html_documentimpl.cpp:
2590         (HTMLDocumentImpl::close):
2591         * khtml/khtml_part.h:
2592         * kwq/KWQKHTMLPart.mm:
2593         * kwq/WebCoreBridge.h:
2594
2595 2003-09-19  Darin Adler  <darin@apple.com>
2596
2597         Reviewed by Dave.
2598
2599         - update layout tests for Dave's change
2600
2601         * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
2602         * layout-tests/fast/block/positioning/051-expected.txt:
2603         * layout-tests/fast/overflow/003-expected.txt:
2604
2605         - fixed 3426272 -- sites that use text-shadow cause leaks (QPainter::setShadow)
2606
2607         * kwq/KWQPainter.mm: (QPainter::setShadow): Release the color space and color.
2608
2609         - fixed some errors that caused failures in the W3C DOM suite
2610
2611         * khtml/ecma/kjs_binding.cpp:
2612         (DOMObject::get): Put "code" in the error object.
2613         (DOMObject::put): Put "code" in the error object.
2614         (DOMFunction::get): Put "code" in the error object.
2615
2616         * khtml/ecma/kjs_dom.cpp: (DOMCharacterDataProtoFunc::tryCall):
2617         Add checks for negative count values. Not clear whether this change is
2618         really great, but it helps us pass W3C DOM tests and clearly won't affect
2619         normal pages in any bad way.
2620
2621         * khtml/xml/dom_elementimpl.cpp:
2622         (AttrImpl::AttrImpl): Set m_specified to true. Since we never set up the
2623         attributes from the DTD anyway, this is fine for now. If we ever go crazy
2624         and implement that, then the bit field is sitting here waiting for us.
2625         (NamedAttrMapImpl::removeNamedItem): The comment from KHTML says they
2626         don't raise the not found exception because "the DOM 2 spec doesn't say
2627         you should". But the DOM Level 1 specification clearly does, and the W3C
2628         DOM Level 1 Core test requires it, so I'm putting it in.
2629
2630         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Typo; this was
2631         returning the wrong error code in the "wrong document" case.
2632
2633         * khtml/xml/dom_stringimpl.cpp:
2634         (DOMStringImpl::remove): Fix overflow case.
2635         (DOMStringImpl::substring): Fix overflow case.
2636         
2637 2003-09-19  David Hyatt  <hyatt@apple.com>
2638
2639         Fix for 3401409, fix negative z-index.  This code actually substantially
2640         reworks layers to be more efficient in both painting and event handling.
2641         It also fixes bugs with clipping as well as with negative z-indices.
2642         
2643         Reviewed by kocienda
2644
2645         * khtml/css/cssstyleselector.cpp:
2646         * khtml/rendering/render_block.cpp:
2647         * khtml/rendering/render_block.h:
2648         * khtml/rendering/render_box.cpp:
2649         (RenderBox::setStyle):
2650         (RenderBox::repaintRectangle):
2651         * khtml/rendering/render_box.h:
2652         * khtml/rendering/render_frames.cpp:
2653         (RenderFrameSet::nodeAtPoint):
2654         * khtml/rendering/render_frames.h:
2655         * khtml/rendering/render_image.cpp:
2656         (RenderImage::nodeAtPoint):
2657         * khtml/rendering/render_image.h:
2658         * khtml/rendering/render_inline.cpp:
2659         (RenderInline::nodeAtPoint):
2660         * khtml/rendering/render_inline.h:
2661         * khtml/rendering/render_layer.cpp:
2662         (RenderLayer::RenderLayer):
2663         (RenderLayer::~RenderLayer):
2664         (RenderLayer::updateLayerPosition):
2665         (RenderLayer::stackingContext):
2666         (RenderLayer::enclosingPositionedAncestor):
2667         (RenderLayer::transparentAncestor):
2668         (RenderLayer::addChild):
2669         (RenderLayer::removeChild):
2670         (RenderLayer::convertToLayerCoords):
2671         (RenderLayer::checkScrollbarsAfterLayout):
2672         (RenderLayer::paintScrollbars):
2673         (RenderLayer::paint):
2674         (setClip):
2675         (restoreClip):
2676         (RenderLayer::paintLayer):
2677         (RenderLayer::nodeAtPoint):
2678         (RenderLayer::nodeAtPointForLayer):
2679         (RenderLayer::calculateClipRects):
2680         (RenderLayer::calculateRects):
2681         (RenderLayer::intersectsDamageRect):
2682         (RenderLayer::containsPoint):
2683         (hoverAncestor):
2684         (commonAncestor):
2685         (RenderLayer::updateHoverActiveState):
2686         (sortByZOrder):
2687         (RenderLayer::dirtyZOrderLists):
2688         (RenderLayer::updateZOrderLists):
2689         (RenderLayer::collectLayers):
2690         * khtml/rendering/render_layer.h:
2691         * khtml/rendering/render_object.cpp:
2692         (RenderObject::setStyle):
2693         (RenderObject::document):
2694         (RenderObject::renderArena):
2695         (RenderObject::nodeAtPoint):
2696         * khtml/rendering/render_object.h:
2697         * khtml/rendering/render_text.cpp:
2698         (RenderText::nodeAtPoint):
2699         * khtml/rendering/render_text.h:
2700         * khtml/xml/dom_docimpl.cpp:
2701         (DocumentImpl::DocumentImpl):
2702         (DocumentImpl::~DocumentImpl):
2703         (DocumentImpl::recalcStyleSelector):
2704         (DocumentImpl::setHoverNode):
2705         * khtml/xml/dom_docimpl.h:
2706         * kwq/KWQKHTMLPart.mm:
2707         (KWQKHTMLPart::paint):
2708         (KWQKHTMLPart::paintSelectionOnly):
2709         (KWQKHTMLPart::adjustPageHeight):
2710         * kwq/KWQRect.h:
2711         * kwq/KWQRenderTreeDebug.cpp:
2712         (write):
2713         (writeLayers):
2714         (externalRepresentation):
2715
2716 2003-09-19  Darin Adler  <darin@apple.com>
2717
2718         Reviewed by Dave.
2719
2720         * layout-tests: Updated for my mini-controls change.
2721
2722 2003-09-19  Darin Adler  <darin@apple.com>
2723
2724         Reviewed by Dave.
2725
2726         - do the prep work for the mini controls feature; Dave will finish this
2727
2728         * khtml/rendering/render_form.cpp: (RenderFormElement::updateFromElement):
2729         Tell the widget about the font size. Our widgets use the font size to
2730         decide whether to use Aqua normal, small, or mini.
2731
2732         * kwq/KWQButton.h: Add setFont.
2733         * kwq/KWQButton.mm:
2734         (QButton::setFont): Set control size based on font.
2735         (KWQNSControlSizeForFont): Determine control size given a font. Dave is going
2736         to tweak this later.
2737
2738         * kwq/KWQCheckBox.h: Add dimensions function for metrics for each control size.
2739         * kwq/KWQCheckBox.mm:
2740         (QCheckBox::sizeHint): Use dimensions.
2741         (QCheckBox::frameGeometry): Use dimensions.
2742         (QCheckBox::setFrameGeometry): Use dimensions.
2743         (QCheckBox::baselinePosition): Use dimensions.
2744         (QCheckBox::dimensions): Added. Has newly tweaked values for all dimensions for
2745         all three control sizes.
2746
2747         * kwq/KWQComboBox.h: Add setFont and dimensions.
2748         * kwq/KWQComboBox.mm:
2749         (QComboBox::sizeHint): Use dimensions.
2750         (QComboBox::frameGeometry): Use dimensions.
2751         (QComboBox::setFrameGeometry): Use dimensions.
2752         (QComboBox::baselinePosition): Use dimensions.
2753         (QComboBox::setFont): Use dimensions.
2754         (QComboBox::dimensions): Added. Has newly tweaked values for all dimensions for
2755         all three control sizes.
2756
2757         * kwq/KWQFileButton.mm: (KWQFileButton::baselinePosition): Change to adapt to
2758         flipped version of file button NSControl.
2759
2760         * kwq/KWQPushButton.h: Add dimensions function for metrics for each control size.
2761         * kwq/KWQPushButton.mm:
2762         (QPushButton::sizeHint): Use dimensions.
2763         (QPushButton::frameGeometry): Use dimensions.
2764         (QPushButton::setFrameGeometry): Use dimensions.
2765         (QPushButton::baselinePosition): Use dimensions.
2766         (QPushButton::dimensions): Added. Has newly tweaked values for all dimensions for
2767         all three control sizes.
2768
2769         * kwq/KWQRadioButton.h: Add dimensions function for metrics for each control size.
2770         * kwq/KWQRadioButton.mm:
2771         (QRadioButton::sizeHint): Use dimensions.
2772         (QRadioButton::frameGeometry): Use dimensions.
2773         (QRadioButton::setFrameGeometry): Use dimensions.
2774         (QRadioButton::baselinePosition): Use dimensions.
2775         (QRadioButton::dimensions): Added. Has newly tweaked values for all dimensions for
2776         all three control sizes.
2777
2778 2003-09-19  Maciej Stachowiak  <mjs@apple.com>
2779
2780         Reviewed by Darin.
2781         
2782         - fixed 3410980 - FileMaker: going forward with an empty forward list makes a frame come out blank sometimes
2783         
2784         * khtml/html/html_documentimpl.cpp:
2785         (HTMLDocumentImpl::close): Remove redundant check removed.
2786         * khtml/khtml_part.h:
2787         * kwq/KWQKHTMLPart.h:
2788         * kwq/KWQKHTMLPart.mm:
2789         (KWQKHTMLPart::scheduleHistoryNavigation): Only call the base class
2790         method to actually schedule when it's possible to go back or forward
2791         that number of steps.
2792         * kwq/WebCoreBridge.h:
2793
2794 2003-09-17  John Sullivan  <sullivan@apple.com>
2795
2796         - WebCore part of fix for 3157018 -- Would like option to
2797         not print backgrounds   
2798
2799         Reviewed by Darin
2800
2801         * kwq/KWQKHTMLSettings.h:
2802         add _shouldPrintBackgrounds field and accessors
2803
2804         * kwq/WebCoreSettings.h:
2805         add shouldPrintBackgrounds field and accessors
2806         * kwq/WebCoreSettings.mm:
2807         (-[WebCoreSettings setShouldPrintBackgrounds:]):
2808         new method, passes value to KHTMLSettings
2809         (-[WebCoreSettings shouldPrintBackgrounds]):
2810         new method
2811
2812         * kwq/WebCoreBridge.mm:
2813         (-[WebCoreBridge styleSheetForPrinting]):
2814         new method, returns a style sheet that has backgrounds
2815         turned off if preference is set that way.
2816         (-[WebCoreBridge reapplyStylesForDeviceType:]):
2817         if printing, set the printStyleSheet to the one we
2818         created based on the preferences. (KHTML has always
2819         had support for a special printStyleSheet, but it was
2820         only being used in !APPLE_CHANGES code.)
2821
2822         * khtml/rendering/render_style.h:
2823         add shouldCorrectTextColor boolean field and accessors 
2824
2825         * khtml/xml/dom_docimpl.cpp:
2826         (DocumentImpl::recalcStyle):
2827         tell style to correct text colors if backgrounds aren't being printed
2828
2829         * khtml/rendering/render_text.cpp:
2830         (TextRun::paintSelection):
2831         added comment
2832         (simpleDifferenceBetweenColors):
2833         new function, computes a quick measure of difference
2834         between colors
2835         (correctedTextColor):
2836         if text and background colors are too similar, returns
2837         lightened or darkened text color
2838         (RenderText::paintObject):
2839         if style says to correct text colors, call correctedTextColor
2840
2841 2003-09-17  Darin Adler  <darin@apple.com>
2842
2843         Reviewed by Ken.
2844
2845         - fixed 3423404 -- REGRESSION: Japanese page appears blank due to unexpected kTECPartialCharErr
2846
2847         * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertOneChunkUsingTEC): In the case where we're already
2848         going from the small buffer back to the large one, treat kTECPartialCharErr the same as noErr.
2849         Otherwise we'll get confused and drop the contents of the big buffer.
2850         (KWQTextDecoder::convert): Improve the debugging code a bit (still turned off).
2851
2852 === WebCore-105 ===
2853
2854 2003-09-15  Ken as Darin  <darin@apple.com>
2855
2856         Reviewed by Darin and Don.
2857
2858         - fixed 3419957 -- REGRESSION: lines drawn across multiple columns at washingtonpost.com
2859
2860         * khtml/rendering/render_box.cpp: (RenderBox::calcWidth): Always use the width of the line
2861         rather than the width of the containing block for "flow around floats" blocks (<hr>).
2862         This undoes half of the change made to fix bug 3384609.
2863
2864 2003-09-15  Darin Adler  <darin@apple.com>
2865
2866         Reviewed by Ken and Don.
2867
2868         - fixed 3417604 -- REGRESSION: dragging scroll thumb causes textarea contents to vanish
2869
2870         * kwq/KWQTextArea.mm: (-[KWQTextArea initWithFrame:]): Deallocated cached graphics state for
2871         the text view as well as for the clip view.
2872
2873 2003-09-13  Darin Adler  <darin@apple.com>
2874
2875         Reviewed by Maciej.
2876
2877         - fixed 3420547 -- REGRESSION: repro crash in khtml::RenderBlock::findNextLineBreak (wisdomtips.com)
2878
2879         * khtml/rendering/render_block.cpp: (RenderBlock::addChildToFlow): Exclude BR elements when looking for
2880         an element to process first-letter style.
2881
2882 2003-09-13  Darin Adler  <darin@apple.com>
2883
2884         * layout-tests/fast/frames/empty-frame-src-expected.txt: Updated test results that changed
2885         due to the change in our handling of frame borders.
2886
2887 === WebCore-104 ===
2888
2889 2003-09-12  Richard Williamson   <rjw@apple.com>
2890
2891         Fixed 3420097.  Pass flag up to WebKit indicating that redirects are being cancelled during a pending load.
2892
2893         Reviewed by Darin.
2894
2895         * khtml/khtml_part.cpp:
2896         (KHTMLPart::cancelRedirection):
2897         * khtml/khtml_part.h:
2898         * khtml/khtmlpart_p.h:
2899         * kwq/KWQKHTMLPart.mm:
2900         (KWQKHTMLPart::provisionalLoadStarted):
2901         (KWQKHTMLPart::redirectionTimerStartedOrStopped):
2902         * kwq/WebCoreBridge.h:
2903
2904 === WebCore-103 ===
2905
2906 2003-09-12  Maciej Stachowiak  <mjs@apple.com>
2907
2908         Reviewed by Darin.
2909
2910         * khtml/css/html4.css: Use the same hardcoded default size for
2911         OBJECT and EMBED tags as for IFRAME.
2912
2913 2003-09-12  Darin Adler  <darin@apple.com>
2914
2915         Reviewed by Ken.
2916
2917         - fixed 3403223 -- <input type=file> with initial value causes exception, bad results afterwards, when submitted
2918
2919         * kwq/KWQFile.mm: (QFile::QFile): Don't pass an empty string to fileSystemRepresentation,
2920         because that will cause an exception.
2921
2922 === WebCore-101 ===
2923
2924 2003-09-11  Richard Williamson   <rjw@apple.com>
2925
2926         Fixed 3406671.  Added a private method for Mail to get selection
2927         rect.
2928
2929         Fixed 3417688.  Don't allow https page into page cache.
2930
2931         Reviewed by Darin.
2932
2933         * kwq/KWQFrame.h:
2934         * kwq/KWQFrame.mm:
2935         (QFrame::setFrameStyle):
2936         (QFrame::frameWidth):
2937         * kwq/KWQKHTMLPart.mm:
2938         (KWQKHTMLPart::canCachePage):
2939         * kwq/WebCoreBridge.h:
2940         * kwq/WebCoreBridge.mm:
2941         (-[WebCoreBridge selectionRect]):
2942         (-[WebCoreBridge visibleSelectionRect]):
2943         (-[WebCoreBridge selectionImage]):
2944         (-[WebCoreBridge adjustViewSize]):
2945
2946 === Safari-100 ===
2947
2948 2003-09-09  Darin Adler  <darin@apple.com>
2949
2950         Reviewed by Chris.
2951
2952         - fixed 3373654 -- REGRESSION: Yahoo chat applet reloads over and over due to "baseURL" param name conflict
2953
2954         After some research by the Java team, we discovered that there was no need to
2955         pass in baseURL at all This patch gets rid of that by only passingindividual specified
2956         arguments, rather than passing all the arguments, as applet parameters.
2957
2958         * khtml/rendering/render_applet.cpp: (RenderApplet::processArguments): Remove the
2959         call to KJavaApplet::processArguments, because we only want the individual arguments.
2960         * kwq/KWQKJavaAppletWidget.h: Implement setAppletClass, setAppletName, setArchives, and
2961         setCodeBase. Remove processArguments.
2962         * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::setParameter): Lowercase all the
2963         parameters as we put them in the dictionary, since this is the semantics required by Java.
2964
2965 === Safari-99 ===
2966
2967 2003-09-07  Darin Adler  <darin@apple.com>
2968
2969         Reviewed by Maciej.
2970
2971         - fixed 3411827 -- REGRESSION: text drawing after text-shadow does not respect smoothing style (asahi.com)
2972
2973         * kwq/KWQPainter.mm: (QPainter::clearShadow): Call CGContextSetShadowWithColor with a color of NULL,
2974         which actually clears the shadow, rather than CGContextSetShadow, which sets a black shadow (even
2975         if it is zero pixels in size).
2976
2977 === Safari-98 ===
2978
2979 2003-09-05  Ken Kocienda  <kocienda@apple.com>
2980
2981         Reviewed by Darin
2982
2983         Fix for this bug:
2984
2985         <rdar://problem/3226083>: REGRESSION (Panther): white box 
2986         overlaying select lists at nvidia.com drivers page
2987
2988         * kwq/KWQListBox.mm:
2989         (QListBox::QListBox): Re-add releaseGState fix that Darin
2990         added, but then removed. It turns out that we do need 
2991         this workaround in place to get proper drawing.
2992
2993         Fix for this bug:
2994
2995         <rdar://problem/3310943>: REGRESSION (Panther): textareas 
2996         in forms sometimes draw blank (bugreporter)
2997
2998         * kwq/KWQTextArea.mm:
2999         (-[KWQTextArea initWithFrame:]): Same fix as above.
3000
3001 2003-09-05  Maciej Stachowiak  <mjs@apple.com>
3002
3003         Reviewed by Darin.
3004
3005         - fixed - REGRESSION (85-92): Javascript on page isn't triggered by typed characters (onKeyUp)
3006
3007         (This actually also requires an AppKit fix to be a full fix.)
3008
3009         * kwq/KWQListBox.mm:
3010         (-[KWQTableView keyDown:]): Added. Send event through DOM.
3011         (-[KWQTableView keyUp:]): Likewise.
3012         (-[KWQTableView becomeFirstResponder]): Added. Report focus change
3013         to DOM.
3014         * kwq/KWQTextArea.mm:
3015         (-[KWQTextAreaTextView keyUp:]): Added. Send event through DOM.
3016         * kwq/KWQTextField.mm:
3017         (-[KWQTextField textView:shouldHandleEvent:]): Pass NSKeyUp events too
3018         (not going to work until we get an AppKit fix).
3019
3020 2003-09-04  John Sullivan  <sullivan@apple.com>
3021
3022         - fixed 3399880 -- Repro crash when filling out a form to
3023         download Macromedia software. I managed to check in this
3024         ChangeLog comment a few days ago without actually checking
3025         in the changed file, weird.
3026
3027         Reviewed by Chris
3028
3029         * kwq/WebCoreBridge.mm:
3030         (-[WebCoreBridge elementForView:]):
3031         check for nil widget before dereferencing
3032
3033 2003-09-04  David Hyatt  <hyatt@apple.com>
3034
3035         Fix for 3408630, leak of child frame parts caused by a missing deref when frames
3036         get detached from their parent frame list.
3037         
3038         Reviewed by mjs
3039
3040         * kwq/KWQKHTMLPart.mm:
3041         (KHTMLPart::frameDetached):
3042
3043 2003-09-04  Darin Adler  <darin@apple.com>
3044
3045         * layout-tests/apple-only/base/www.msn.com/index-expected.txt: Update for residual style fix.
3046         * layout-tests/fast/invalid/003-expected.txt: Update for residual style fix.
3047
3048 2003-09-04  Darin Adler  <darin@apple.com>
3049
3050         * kwq/KWQRenderTreeDebug.cpp: (write): Fix clip rectangle computation.
3051         * layout-tests: Update test results.
3052
3053 === Safari-97 ===
3054
3055 2003-09-03  Maciej Stachowiak  <mjs@apple.com>
3056
3057         Reviewed by Darin.
3058
3059         * khtml/khtml_part.cpp:
3060         (KHTMLPart::clear): Un-ifdef cleanup of frames, and add similar
3061         cleanup for objects. Replace delete with deref.
3062         * kwq/KWQKHTMLPart.mm:
3063         (KWQKHTMLPart::createPart): Add an extra ref to KHTMLParts since
3064         both the bridge and the parent part want to deref.
3065
3066 2003-09-03  David Hyatt  <hyatt@apple.com>
3067
3068         Fix for 3404398, leak in residual style code.  The code that built up the
3069         residualStyleStack was messed up and discarded tags.
3070         
3071         Reviewed by mjs
3072
3073         * khtml/html/htmlparser.cpp:
3074         (KHTMLParser::popBlock):
3075
3076 2003-09-02  Ken Kocienda  <kocienda@apple.com>
3077
3078         Reviewed by Darin
3079
3080         Fix for this bug:
3081
3082         <rdar://problem/3399169>: 4 leaks of DOMString objects (Mail)
3083
3084         Remove circular reference between AttributeImpl and AttrImpl objects.
3085         This was causing the leak.
3086
3087         * khtml/xml/dom_elementimpl.cpp:
3088         (AttributeImpl::allocateImpl):
3089
3090 2003-09-02  David Hyatt  <hyatt@apple.com>
3091
3092         Fix for 3359408, DirWS should not be used when collapsing/stripping spaces,
3093         since only ASCII spaces are supposed to be collapsed/stripped.
3094         
3095         Reviewed by mjs
3096
3097         * khtml/rendering/bidi.cpp:
3098
3099 2003-09-02  Darin Adler  <darin@apple.com>
3100
3101         Reviewed by John.
3102
3103         - fixed 3403388 -- decoder mishandles pages which fill the decoding buffer (mainly ISO-2022-JP)
3104
3105         * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUsingTEC): Keep decoding, passing in no additional bytes,
3106         until we get noErr, don't ever stop after a kTECOutputBufferFullStatus error.
3107
3108 2003-09-02  David Hyatt  <hyatt@apple.com>
3109
3110         Fix for 3404452, paint errors on mezzoblue.com's links list.  There was a simple
3111         math error in the invalidation rect computation.
3112         
3113         Reviewed by mjs
3114
3115         * khtml/rendering/render_flow.cpp:
3116         (RenderFlow::repaint):
3117         
3118 2003-09-01  John Sullivan  <sullivan@apple.com>
3119
3120         - WebCore part of fix for 3402489 -- REGRESSION (7B48-7B55): Some 
3121         printed web pages are too small (width is half a page)
3122
3123         This was a regression caused by the fix for 3378810.
3124
3125         Reviewed by Maciej
3126
3127         * kwq/WebCoreBridge.h:
3128         add adjustingViewSize flag to forceLayout and forceLayoutForPageWidth:
3129         * kwq/WebCoreBridge.mm:
3130         (-[WebCoreBridge forceLayoutAdjustingViewSize:]):
3131         respect new flag while we are set up for printing.
3132         (-[WebCoreBridge forceLayoutForPageWidth:adjustingViewSize:]):
3133         ditto
3134         (-[WebCoreBridge adjustFrames:]):
3135         pass NO for new flag here
3136
3137 2003-09-01  John Sullivan  <sullivan@apple.com>
3138
3139         * kwq/KWQPainter.mm:
3140         (QPainter::drawLine):
3141         Removed the ERROR that warns of the CG memory trashing bug, now
3142         that we are enough builds away from it that it is (almost?) never
3143         reported anymore.
3144
3145 === Safari-96 ===
3146
3147 2003-08-29  Maciej Stachowiak  <mjs@apple.com>
3148
3149         Reviewed by Ken.
3150
3151         - fixed 3397775 21 leaks from CSS parser running PLT
3152         
3153         * khtml/css/css_ruleimpl.cpp:
3154         (CSSMediaRuleImpl::~CSSMediaRuleImpl): Clear the parent for all contained
3155         rules.
3156         (CSSMediaRuleImpl::append): Call insertRule.
3157         (CSSMediaRuleImpl::insertRule): set parent of the rule to this media rule.
3158         (CSSRuleListImpl::append): Call insertRule to cover all the relevant
3159         additional handling, instead of adding straight to the list.
3160         * khtml/css/css_ruleimpl.h:
3161
3162 2003-08-29  John Sullivan  <sullivan@apple.com>
3163         
3164         - fixed 3399880 -- Repro crash when filling out a form to 
3165         download Macromedia software
3166
3167         Reviewed by Chris
3168
3169         * kwq/WebCoreBridge.mm:
3170         (-[WebCoreBridge elementForView:]):
3171         check for nil widget before dereferencing
3172
3173 2003-08-28  David Hyatt  <hyatt@apple.com>
3174
3175         Fix for 3381377, fix the calcBlockMinMaxWidth function to not use the
3176         renderobject's computed margins except when it has to.  This makes
3177         table cells with align=right not mess up and fixes margin problems
3178         in general with floated elements and table cells.
3179
3180         Since XUL boxes also use a similar function and since it had a similar
3181         error, vertical XUL boxes have been patched as well.
3182         
3183         Reviewed by gramps
3184
3185         * khtml/rendering/render_block.cpp:
3186         * khtml/rendering/render_flexbox.cpp:
3187
3188 2003-08-28  David Hyatt  <hyatt@apple.com>
3189
3190         Fix for 3398463, a regression caused by an unintended line movement.
3191         <br/> was no longer being treated just like <br> in HTML.
3192         
3193         Reviewed by gramps
3194
3195         * khtml/html/htmltokenizer.cpp:
3196         (HTMLTokenizer::parseTag):
3197
3198 === Safari-95 ===
3199
3200 2003-08-27  Richard Williamson   <rjw@apple.com>
3201
3202         Fixed 3359408.  DON'T treat unicode whitespace as whitespace when collapsing spaces.
3203
3204         Reviewed by David Hyatt.
3205
3206         * khtml/rendering/bidi.cpp:
3207         * khtml/rendering/render_text.cpp:
3208         (RenderText::trimmedMinMaxWidth):
3209         (RenderText::calcMinMaxWidth):
3210         (RenderText::containsOnlyWhitespace):
3211         * khtml/xml/dom_stringimpl.cpp:
3212
3213 2003-08-27  David Hyatt  <hyatt@apple.com>
3214
3215         Fix for 3396962, hang on quote.com.  Fieldsets with display:inline should be treated
3216         like inline-blocks. This matches WinIE's behavior.
3217         
3218         Reviewed by mjs
3219
3220         * khtml/rendering/render_form.cpp:
3221         (RenderFieldset::setStyle):
3222         * khtml/rendering/render_form.h:
3223
3224 2003-08-26  Darin Adler  <darin@apple.com>
3225
3226         Reviewed by Maciej.
3227
3228         - follow-on to fix for 3310943 -- REGRESSION (Panther): textareas in forms sometimes draw blank (bugreporter)
3229
3230         * kwq/KWQListBox.mm: (QListBox::QListBox): Remove call to releaseGState. This was here to
3231         work around a problem we thought was an AppKit bug, but it turns out it was caused by
3232         NSView hackery in WebKit. We now do the WebKit part in a way that does not create the problem.
3233
3234 2003-08-26  Darin Adler  <darin@apple.com>
3235
3236         Reviewed by Maciej.
3237
3238         - fixed 3031562 -- most forms don't work in certain configurations because of a bug in KWQVariant
3239
3240         * kwq/KWQVariant.mm: (QVariant::QVariant): Set the b element of the union, not the d element,
3241         in the constructor for bool.
3242
3243 2003-08-26  David Hyatt  <hyatt@apple.com>
3244
3245         Fix for 3395950, better support for self-collapsing blocks.  Make them obey
3246         clear properly and also change the definition of self-collapsing to match
3247         the CSS2.1 specification.
3248         
3249         Reviewed by gramps
3250
3251         * khtml/rendering/render_block.cpp:
3252         * khtml/rendering/render_block.h:
3253
3254 2003-08-26  David Hyatt  <hyatt@apple.com>
3255
3256         Fix for 3335175, www.calstone.com renders as blank.  The fix is to deliberately
3257         introduce an error into our HTML parsing code that causes us to honor self-closing
3258         XML-style <script/> tags.  This matches Mozilla and Opera behavior (both of them
3259         have this bug), but it does not match WinIE.
3260         
3261         Reviewed by mjs
3262
3263         * khtml/html/htmltokenizer.cpp:
3264
3265 2003-08-26  David Hyatt  <hyatt@apple.com>
3266
3267         Fix for 3286229, popup menu misplaced.  <form> needs to be allowed as a child of
3268         <h1>-<h6> tags.  All other browsers allow this.
3269         
3270         Reviewed by darin
3271
3272         * khtml/html/dtd.cpp:
3273
3274 2003-08-26  Darin Adler  <darin@apple.com>
3275
3276         Reviewed by Maciej.
3277
3278         - re-fixed 3366542 -- filename with non-ASCII name left out of Content-Disposition for <input type=file>
3279
3280         * khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData): Added missing # sign.
3281
3282 2003-08-26  David Hyatt  <hyatt@apple.com>
3283
3284         Fix for 3394107, make sure the display mutation code doesn't mutate objects with
3285         display: none set.
3286         
3287         Reviewed by darin
3288
3289         * khtml/css/cssstyleselector.cpp:
3290
3291 2003-08-22  David Hyatt  <hyatt@apple.com>
3292
3293         Fix for 3388363, copying a word in a list item copied too much.  The code that checked
3294         for the bullet would add in too much text sometimes.
3295         
3296         Reviewed by john
3297
3298         * kwq/KWQKHTMLPart.mm:
3299         (isTextFirstInListItem):
3300         (KWQKHTMLPart::attributedString):
3301
3302 2003-08-21  Darin Adler  <darin@apple.com>
3303
3304         * Makefile.am: Work around DLCFN issue to prevent constant churn of config.h.
3305         * config.h: Regenerated without DLCFN.
3306
3307 2003-08-21  Darin Adler  <darin@apple.com>
3308
3309         * khtml/khtmlview.h: Formatting tweak.
3310
3311 2003-08-21  Chris Blumenberg  <cblu@apple.com>
3312
3313         Fixed: <rdar://problem/3386673>: a particular fidelity.com "Log in" link does nothing because of cross-domain JavaScript rules
3314
3315         Reviewed by mjs.
3316
3317         * config.h:
3318         * khtml/ecma/kjs_window.cpp:
3319         (Window::get): allow other frames to get the location object
3320         (Window::isSafeScript): added JS logging
3321         (Location::get): don't allow other frames to access location attributes
3322         (LocationFunc::tryCall): don't allow other frames to call functions on the location object
3323
3324 2003-08-21  Richard Williamson   <rjw@apple.com>
3325         
3326         Fixed 3378810.  Avoid resizing frame from drawRect: when printing.  This will corrupt the graphics context.
3327
3328         Reviewed by Hyatt.
3329
3330         * khtml/khtmlview.cpp:
3331         (KHTMLView::adjustViewSize):
3332         * khtml/khtmlview.h:
3333         * khtml/rendering/render_canvas.cpp:
3334         (RenderCanvas::layout):
3335         * kwq/KWQScrollView.mm:
3336         (QScrollView::resizeContents):
3337         * kwq/WebCoreBridge.h:
3338         * kwq/WebCoreBridge.mm:
3339         (-[WebCoreBridge adjustViewSize]):
3340
3341 === Safari-94 ===
3342
3343 2003-08-21  David Hyatt  <hyatt@apple.com>
3344
3345         Fix for 3387302, floats weren't being allowed to be relatively positioned.  The
3346         fix is trivial.  Stop making floating/relpositiion setting an if/else and just make
3347         it two ifs.
3348         
3349         Reviewed by darin
3350
3351         * khtml/rendering/render_box.cpp:
3352         (RenderBox::setStyle):
3353
3354 2003-08-21  David Hyatt  <hyatt@apple.com>
3355
3356         Fix for 3384635, breakable unicode characters that were preceded by multiple spaces
3357         accidentally added in those spaces to their widths.
3358         
3359         Reviewed by rjw and gramps
3360
3361         * khtml/rendering/bidi.cpp:
3362
3363 2003-08-20  David Hyatt  <hyatt@apple.com>
3364
3365         Fix for 3384609.  Objects that want to dodge floats should fill the line width instead
3366         of the containing block width only if their widths are auto.  If widths are specified
3367         explicitly, then ccontaining block width should be honored.
3368         
3369         Reviewed by john
3370
3371         * khtml/rendering/render_box.cpp:
3372         (RenderBox::calcWidth):
3373         * khtml/rendering/render_table.cpp:
3374         (RenderTable::calcWidth):
3375
3376 2003-08-20  Richard Williamson   <rjw@apple.com>
3377
3378         UCFindTextBreak will report false if we have a sequence of 0xa0 0x20 (nbsp, sp), so we explicity check for that case.  Filed 3386852 to track this problem, meanwhile added a work-around.  This problem was revealed after adding the fix for 3242508.
3379
3380         Reviewed by Dave.
3381
3382         * khtml/rendering/break_lines.cpp:
3383
3384 2003-08-20  Darin Adler  <darin@apple.com>
3385
3386         Reviewed by John.
3387
3388         - fixed 3248069 -- Safari does not support ISO Latin 10 (ISO-8859-16, romanian) coding.
3389
3390         * kwq/mac-encodings.txt: Added ISO-8859-16, which maps to ISO Latin-10.
3391         * kwq/KWQCharsetData.c: Regenerated.
3392         * kwq/KWQCharsets.mm: Add definition of kCFStringEncodingISOLatin10, since this encoding
3393         is currently only in TextCommon.h, not in CFStringEncodingExt.h.
3394
3395 2003-08-20  Maciej Stachowiak  <mjs@apple.com>
3396
3397         Reviewed by Richard.
3398
3399         - fixed 3384963 - REGRESSION: assertion in copyPathRemovingDots, crash parsing URL in snippet editor
3400         
3401         * kwq/KWQKURL.mm:
3402         (copyPathRemovingDots): It's OK if the path is entirely empty.
3403
3404 2003-08-20  David Hyatt  <hyatt@apple.com>
3405
3406         Fix for 3385211, <td>s should ignore the float property in quirks mode.  This
3407         patch cleans up the adjustments of <td>s and <table>s and moves the code into
3408         the style selector (instead of cluttering up the rendering code).
3409
3410         Fix for 3385476, generated content not built correctly.  All generated content
3411         should be placed inside a containing object that actually gets the pseudo-style.
3412         
3413         Reviewed by rjw
3414
3415         * ChangeLog:
3416         * khtml/css/cssstyleselector.cpp:
3417         * khtml/css/cssstyleselector.h:
3418         * khtml/rendering/render_container.cpp:
3419         (RenderContainer::updatePseudoChild):
3420         * khtml/rendering/render_object.cpp:
3421         (RenderObject::createObject):
3422
3423 2003-08-20  Maciej Stachowiak  <mjs@apple.com>
3424
3425         Reviewed by Richard.
3426
3427         - fixed 3292036 - albertsons.com world leak of 2 WebDataSource and 2 WebHTMLRepresentation objects
3428         
3429         * kwq/KWQKHTMLPart.mm:
3430         (KWQKHTMLPart::canCachePage): Test for parentPart() even if there
3431         is no document.
3432
3433 2003-08-20  Richard Williamson   <rjw@apple.com>
3434
3435         Fixed 3242508.  Japanese (and other non latin1 scripts) line breaking incorrect when mixed with latin1.
3436
3437         Reviewed by Dave.
3438
3439         * khtml/rendering/break_lines.cpp:
3440
3441         Checkin fix for earlier bug that was already approved!
3442
3443         * kwq/KWQKHTMLPart.mm:
3444         (KWQKHTMLPart::attributedString):
3445
3446 2003-08-19  David Hyatt  <hyatt@apple.com>
3447
3448         Fixes for 3380766 and 3381867.  One is a table bug with amazon.com where colspans
3449         were losing percentage width values.  The other is a bug where floats aren't dirtying
3450         objects into which they intrude when doing layout.
3451         
3452         Reviewed by darin
3453
3454         * khtml/rendering/render_block.cpp:
3455         * khtml/rendering/table_layout.cpp:
3456         (AutoTableLayout::calcEffectiveWidth):
3457
3458 2003-08-19  Chris Blumenberg  <cblu@apple.com>
3459
3460         Fixed: <rdar://problem/3379336>: flash on front page of http://www.westportmotorsports.com is broken
3461
3462         Reviewed by darin.
3463
3464         * khtml/rendering/render_frames.cpp:
3465         (RenderPartObject::updateWidget): Ignore the PARAM tags and only use attributes inside the OBJECT tag when the EMBED tag is omitted.
3466
3467 2003-08-19  Darin Adler  <darin@apple.com>
3468
3469         Reviewed by Dave.
3470
3471         - fixed 3343681 -- clicking on a disabled submit button submits the form!
3472
3473         This turned out to be a problem with code in dispatchGenericEvent that sent
3474         DOMActivate events even when the form element was disabled.
3475
3476         * khtml/xml/dom_nodeimpl.h: Add virtual disabled() member function.
3477         * khtml/xml/dom_nodeimpl.cpp:
3478         (NodeImpl::dispatchGenericEvent): Don't send DOM activate events for disabled elements.
3479         (NodeImpl::handleLocalEvents): Don't send mouse events for disabled elements. But we do
3480         want those events to pass through the bubble and capture phases, just avoid triggering
3481         any listeners on this node itself.
3482         (NodeImpl::disabled): Added default implementation that returns false.
3483
3484         * khtml/html/html_formimpl.h: Removed the disabled() function's inline implementation
3485         since it's now virtual and it's not helpful to inline virtual functions.
3486         * khtml/html/html_formimpl.cpp:
3487         (HTMLGenericFormElementImpl::disabled): Moved this method into the .cpp file since it's
3488         now virtual and it's not helpful to inline virtual functions.
3489
3490 2003-08-18  Darin Adler  <darin@apple.com>
3491
3492         Reviewed by John.
3493
3494         - fixed 3380411 -- Unicode supplementary characters cut in half in text control with maxlength set
3495
3496         * kwq/KWQTextField.mm:
3497         (-[KWQTextField setMaximumLength:]): Enforce maximum length based on number of composed character
3498         sequences rather than on number of UTF-16 values. This helps with both surrogate pairs (the supplementary
3499         characters mentioned in the bug report) and composed character sequences.
3500         (-[KWQTextField setStringValue:]): Ditto.
3501         (-[KWQTextFieldFormatter isPartialStringValid:newEditingString:errorDescription:]): Ditto.
3502         (-[NSString _KWQ_numComposedCharacterSequences]): Added. Computes the length of a string in terms of
3503         number of composed character sequences.
3504         (-[NSString _KWQ_truncateToNumComposedCharacterSequences:]): Added. Truncates a string in terms of
3505         number of composed character sequences.
3506
3507 2003-08-18  Darin Adler  <darin@apple.com>
3508
3509         Reviewed by Maciej.
3510
3511         - fixed 3299893 -- oncontextmenu support
3512
3513         * kwq/WebCoreBridge.h: Added sendContextMenuEvent: method.
3514         * kwq/WebCoreBridge.mm: (-[WebCoreBridge sendContextMenuEvent:]): Added.
3515         Calls sendContextMenuEvent on the part.
3516
3517         * kwq/KWQKHTMLPart.h: Added sendContextMenuEvent member function.
3518         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::sendContextMenuEvent): Added. Sets up
3519         a suitable mouse event and calls dispatchMouseEvent for CONTEXTMENU_EVENT.
3520
3521         * khtml/ecma/kjs_dom.cpp: Added oncontextmenu to DOMNode's list of properties.
3522         (DOMNode::getValueProperty): Added case for OnContextMenu.
3523         (DOMNode::putValue): Added case for OnContextMenu.
3524         * khtml/ecma/kjs_dom.h: Added constant for OnContextMenu.
3525         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::parseAttribute):
3526         Added case for ATTR_ONCONTEXTMENU.
3527         * khtml/misc/htmlattrs.in: Added oncontextmenu.
3528         * khtml/xml/dom2_eventsimpl.cpp:
3529         (EventImpl::typeToId): Added case for CONTEXTMENU_EVENT.
3530         (EventImpl::idToType): Added case for CONTEXTMENU_EVENT.
3531         * khtml/xml/dom2_eventsimpl.h: Added CONTEXTMENU_EVENT.
3532
3533         * khtml/ecma/kjs_dom.lut.h: Regenerated.
3534         * khtml/misc/htmlattrs.c: Regenerated.
3535         * khtml/misc/htmlattrs.h: Regenerated.
3536
3537 2003-08-18  Darin Adler  <darin@apple.com>
3538
3539         Reviewed by Maciej.
3540
3541         - fixed 3381295 -- regular expression matches for text with UTF-16 surrogates will give incorrect results
3542
3543         * kwq/KWQRegExp.mm: (QRegExp::match): Removed local copy of convertCharacterOffsetsToUTF8ByteOffsets
3544         and its reverse. Instead use convertUTF16OffsetsToUTF8Offsets and its reverse, now available from
3545         <JavaScriptCore/ustring.h>.
3546
3547         - added test for the URI encoding and decoding functions in JavaScriptCore
3548
3549         * layout-tests/fast/js/global/encode-URI-test-expected.txt: Added.
3550         * layout-tests/fast/js/global/encode-URI-test.html: Added.
3551
3552 2003-08-15  Chris Blumenberg  <cblu@apple.com>
3553
3554         Fixed: <rdar://problem/3380418>: Ignore specified string encoding when constructing file, mailto and help URLs
3555
3556         Reviewed by mjs, darin.
3557
3558         * kwq/KWQKURL.mm:
3559         (KURL::KURL): store the URL string as UTF-8 when the URL is file, mailto and help.
3560
3561 2003-08-17  Darin Adler  <darin@apple.com>
3562
3563         Reviewed by Maciej.
3564
3565         - fixed 3366542 -- filename with non-ASCII name left out of Content-Disposition for <input type=file>
3566
3567         * khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData):
3568         Do the &-encoding thing on the filename. This is what Gecko does.
3569
3570 2003-08-14  Maciej Stachowiak  <mjs@apple.com>
3571
3572         Fixed by Darin, reviewed by me (and originally figured out by John).
3573
3574         - fixed 3375592 - New Yahoo Maps doesn't work right
3575         
3576         * kwq/KWQTextCodec.mm:
3577         (KWQTextDecoder::convertUTF16): Don't pass through null characters.
3578         (KWQTextDecoder::appendOmittingNullsAndBOMs): Ditto.
3579         (KWQTextDecoder::convertUsingTEC): Ditto.
3580
3581 === Safari-93 ===
3582
3583 2003-08-14  Vicki Murley  <vicki@apple.com>
3584
3585         Reviewed by John. 
3586
3587         * WebCore.pbproj/project.pbxproj: deleted WebCore.order from the project.
3588
3589 2003-08-14  Vicki Murley  <vicki@apple.com>
3590
3591         Reviewed by John. 
3592
3593         * WebCore.order: Removed. We now point to the WebCore order file in /AppleInternal/OrderFiles.
3594         * WebCore.pbproj/project.pbxproj: change sectorder flag to point to /AppleInternal/OrderFiles/WebCore.order
3595
3596 2003-08-14  Ken Kocienda  <kocienda@apple.com>
3597
3598         Reviewed by Darin
3599
3600         Fix for this bug:
3601
3602         <rdar://problem/3095893>: Image Capture: "Build web page" doesn't work with Japanese folder name.
3603
3604         * kwq/KWQKURL.mm:
3605         (KURL::getNSURL): Try UTF-8 first and fallback to ISO Latin-1 when creating an NSURL.
3606         This will handle the two-byte character in file name case mentioned in the bug.
3607
3608 2003-08-14  Darin Adler  <darin@apple.com>
3609
3610         Reviewed by Ken.
3611
3612         - fixed 3375270 -- writing to frame parent from a button press crashes in viewportMousePressEvent
3613         
3614         The fix turned out to be to ref the view around handling events in the view, since processing
3615         the event could cause the view and part to go away. Since the view refs the part, ref'ing just
3616         the view seems to work perfectly.
3617         
3618         * kwq/KWQKHTMLPart.mm: Fixed namespace access to use "using" instead of explicit namespaces.
3619         (KWQKHTMLPart::setView): Not-entirely-related cleanup. Use the "ref before deref" idiom here.
3620         (KWQKHTMLPart::sendResizeEvent): Ref the KHTMLView while sending the resize event.
3621         (KWQKHTMLPart::mouseDown): Ref the KHTMLView while sending the viewport mouse down event.
3622         (KWQKHTMLPart::mouseDragged): Ref the KHTMLView while sending the viewport mouse dragged event.
3623         (KWQKHTMLPart::mouseUp): Ref the KHTMLView while sending the viewport mouse up or double click event.
3624         (KWQKHTMLPart::mouseMoved): Ref the KHTMLView while sending the viewport mouse moved event.
3625
3626 2003-08-13  David Hyatt  <hyatt@apple.com>
3627
3628         Fix for 3372896, spaces left at ends of lines.  Patch the selection code
3629         to be smarter about detecting ends of lines and adding in spaces.
3630         
3631         Reviewed by gramps
3632
3633         * khtml/khtml_part.cpp:
3634         (KHTMLPart::selectedText):
3635         * kwq/KWQKHTMLPart.mm:
3636         (KWQKHTMLPart::attributedString):
3637
3638 2003-08-12  Maciej Stachowiak  <mjs@apple.com>
3639
3640         Reviewed by Ken Kocienda.
3641
3642         - fixed 3365242 - non-repro abort in HTMLTokenizer at ajc.com
3643         
3644         * khtml/khtml_part.cpp:
3645         (KHTMLPart::write): ref the part around actually processing the
3646         data, since a script could cause the part to go away.
3647
3648 2003-08-12  David Hyatt  <hyatt@apple.com>
3649
3650         Fix for 3262190, <li> bullets in mail were overly massive.  The bezier path the
3651         painter stroked was not setting the line width from QPen's width, so it ended up
3652         just using the current line width instead (which happened to be much larger in
3653         Mail).
3654         
3655         Reviewed by darin
3656
3657         * kwq/KWQPainter.mm:
3658         (QPainter::drawEllipse):
3659         (QPainter::drawArc):
3660         (QPainter::_drawPoints):
3661
3662 2003-08-12  John Sullivan  <sullivan@apple.com>
3663
3664         - fixed 3370614 -- REGRESSION (81-85): partial inline input from Japanese 
3665         input method can disappear
3666
3667         Reviewed by Hyatt
3668
3669         * khtml/rendering/render_form.cpp:
3670         (RenderLineEdit::updateFromElement):
3671         call w->text() before element()->value(), because w->text() has a side
3672         effect of updating element()->value() in the inline input case
3673         (RenderTextArea::updateFromElement):
3674         same for text areas
3675
3676 2003-08-12  David Hyatt  <hyatt@apple.com>
3677
3678         Fix for 3374566, list bullets don't display if list-style-type is none but a list-style-image
3679         is specified.  The spec says list-style-type: none does not apply to list-style-image,
3680         and this fixes Microsoft's list bullet on their security pages.
3681         
3682         Reviewed by john
3683
3684         * khtml/rendering/render_list.cpp:
3685         (RenderListItem::setStyle):
3686
3687 2003-08-12  Darin Adler  <darin@apple.com>
3688
3689         Reviewed by Ken.
3690
3691         - fixed 3226083 -- REGRESSION (Panther): white box overlaying select lists at nvidia.com drivers page
3692
3693         * kwq/KWQListBox.mm: (QListBox::QListBox): Call releaseGState on the clip view
3694         that we make for the list box. This prevents the incorrect graphics state caching
3695         that causes the problem, although it's not entirely clear why this is necessary.
3696         This may ultimately turn out to be an AppKit bug, and if so we can roll out this change
3697         when the AppKit itself is fixed.
3698
3699 2003-08-12  David Hyatt  <hyatt@apple.com>
3700
3701         Fix for 3373462, XML shows up as blank because the root is inline.  The fix is
3702         to just disallow inline roots.
3703         
3704         Reviewed by kocienda
3705
3706         * khtml/css/cssstyleselector.cpp:
3707
3708 2003-08-11  David Hyatt  <hyatt@apple.com>
3709
3710         Fix for 3349142, blocks inside inlines with generated content cause the generated
3711         content to get all screwed up, especially if you try to print.  This patch fixes
3712         generated content to be continuation-aware (and vice versa), so that the content
3713         behaves correctly when inlines get split.
3714         
3715         Reviewed by darin
3716
3717         * khtml/rendering/render_block.cpp:
3718         * khtml/rendering/render_container.cpp:
3719         (RenderContainer::updatePseudoChild):
3720         * khtml/rendering/render_container.h:
3721         * khtml/rendering/render_flow.cpp:
3722         (RenderFlow::addChild):
3723         * khtml/rendering/render_inline.cpp:
3724         (RenderInline::isInlineContinuation):
3725         (RenderInline::addChildToFlow):
3726         (RenderInline::cloneInline):
3727         (RenderInline::splitInlines):
3728         * khtml/rendering/render_inline.h:
3729         * khtml/rendering/render_object.cpp:
3730         (RenderObject::continuation):
3731         (RenderObject::isInlineContinuation):
3732         * khtml/rendering/render_object.h:
3733
3734 2003-08-11  Darin Adler  <darin@apple.com>
3735
3736         * kwq/KWQKHTMLPart.h: Fixed some small typo-ish strangenesses.
3737
3738 2003-08-08  David Hyatt  <hyatt@apple.com>
3739
3740         Fix for 3368672, don't allow frames and framesets to be positioned or relpositioned.
3741         
3742         Reviewed by darin
3743
3744         * ChangeLog:
3745         * khtml/rendering/render_box.cpp:
3746         (RenderBox::setStyle):
3747         * khtml/rendering/render_object.cpp:
3748         (RenderObject::requiresLayer):
3749         * khtml/rendering/render_object.h:
3750
3751 2003-08-07  David Hyatt  <hyatt@apple.com>
3752
3753         Fix for 3368463, assert/crash on libraries.uc.edu page.  A stylesheet was making 
3754         a <p> a table-column, which is totally nonsensical.  Since this isn't supported in
3755         WinIE, it just got ignored.  The fix I chose matches what Mozilla does, which is
3756         to not allow table-column renderobjects to have children.
3757
3758         Fix for 3364412, FM pro file that happens to use a <col> element crashes.  Make sure
3759         to patch bidiiterator to have a null check for this bizarre case.  Technically <col>
3760         should never have been a table-column, since it's not in the HTML namespace, but
3761         that fix will have to wait until we get @namespace support in CSS.
3762         
3763         Reviewed by john
3764
3765         * ChangeLog:
3766         * khtml/rendering/bidi.cpp
3767         * khtml/rendering/render_table.cpp:
3768         (RenderTableCol::canHaveChildren):
3769         * khtml/rendering/render_table.h:
3770
3771 2003-08-05  Dave Hyatt  <hyatt@apple.com>
3772
3773         Fix for 3370654.  Make sure the max width computation for blocks with inline children actually
3774         ignores non-pre text runs that consist entirely of whitespace.
3775         
3776         Reviewed by mjs
3777
3778         * khtml/rendering/render_block.cpp:
3779         * khtml/rendering/render_text.cpp:
3780         (RenderText::trimmedMinMaxWidth):
3781         * khtml/rendering/render_text.h:
3782
3783 2003-08-08  John Sullivan  <sullivan@apple.com>
3784
3785         - fixed 3362481 -- REGRESSION (89-90): clicking in a field causes 
3786         page to move; esp. bad if the field moves out from under the mouse
3787
3788         Reviewed by Darin
3789
3790         * kwq/KWQKHTMLPart.h:
3791         * kwq/KWQKHTMLPart.mm:
3792         (KWQKHTMLPart::currentEventIsMouseDownInWidget):
3793         new method
3794
3795         * kwq/KWQTextArea.mm:
3796         (-[KWQTextAreaTextView becomeFirstResponder]):
3797         only scroll to reveal if currentEventIsMouseDownInWidget is false
3798
3799         * kwq/KWQTextField.mm:
3800         (-[KWQTextField setHasFocus:]):
3801         ditto
3802
3803 === WebCore-92.1 ===
3804
3805 2003-08-07  Darin Adler  <darin@apple.com>
3806
3807         Reviewed by John Sullivan.
3808
3809         - fixed 3366234 -- repro crash in CSS parser: function that can't be parsed (www.bi-flugplatz-magdeburg.de)
3810
3811         * khtml/css/parser.y: Allocate a Function object for the "can't parse function" case, since
3812         the other code involved cannot handle 0 for the function.
3813         * khtml/css/parser.cpp: Regenerated.
3814
3815 === Safari-92 ===
3816
3817 2003-08-07  Ken Kocienda  <kocienda@apple.com>
3818
3819        Reviewed by Darin
3820
3821        Fix for this bug:
3822
3823        <rdar://problem/3367434>: newly-added KURL assertion failing reproducibly for JavaScript URL (www.thai.com)
3824
3825        The assertion is correct. The issue was in calling the function
3826        with bad input. Non-hierarchical URLs should not have their "path"
3827        elements submitted to a function that will replace dots.
3828
3829        The fix is to avoid calling this function with such non-hierarchical
3830        URLs.
3831
3832          * kwq/KWQKURL.mm:
3833          (KURL::parse)
3834
3835 2003-08-07  Ken Kocienda  <kocienda@apple.com>
3836
3837         Reviewed by Maciej
3838
3839         There was a bug in this code that caused a relative URL that was
3840         being resolved against an empty base URL to process incorrectly.
3841         The bug is that the resolution was being done twice. The first
3842         time was correct handling of this case, but then the code did
3843         not return at this point, and instead proceeded on through the
3844         code path that is used to handle resolution of a relative URL
3845         against a non-empty base. This double processing is clearly
3846         wrong, and we found this bug as the result of the recent addition 
3847         of an assertion in some related code.
3848
3849         * kwq/KWQKURL.mm:
3850         (KURL::KURL)
3851
3852 2003-08-06  Darin Adler  <darin@apple.com>
3853
3854         Reviewed by Richard.
3855
3856         - fixed 3347114 -- remove vestiges of posing, including init routine, from WebKit
3857
3858         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView keyDown:]): Remove check for old
3859         versions of AppKit that let the WebKit posing handle key down events.
3860         * kwq/KWQTextField.mm: Removed fieldEditorDidMouseDown: methods.
3861
3862         * WebCore.pbproj/project.pbxproj: Removed WebCoreFirstResponderChanges.h.
3863         * kwq/WebCoreFirstResponderChanges.h: Removed.
3864
3865 2003-08-06  Richard Williamson   <rjw@apple.com>
3866
3867         Fixed development build problem.  WebCore.exp needed a newline at EOF.
3868         
3869         * WebCore-combined.exp:
3870
3871 2003-08-06  Richard Williamson   <rjw@apple.com>
3872
3873         Fixed 3348630.  Pick up about 1% by moving implementation of _unicodeDirection to WebCore and inlining.
3874
3875         Reviewed by Ken.
3876
3877         * WebCore-combined.exp:
3878         * WebCore.exp:
3879         * WebCore.pbproj/project.pbxproj:
3880         * kwq/KWQString.h:
3881         * kwq/WebCoreUnicode.cpp:
3882         * kwq/WebCoreUnicode.h:
3883
3884 2003-08-06  John Sullivan  <sullivan@apple.com>
3885
3886         - fixed 3366587 -- Mail quits instantly (no crashlog) trying
3887         to reply to a particular message
3888
3889         Reviewed by Richard
3890
3891         * kwq/KWQKHTMLPart.mm:
3892         (KWQKHTMLPart::attributedString):
3893         Return nil immediately if startNode is nil.
3894
3895 2003-08-06  Maciej Stachowiak  <mjs@apple.com>
3896
3897         Reviewed by Chris Blumenberg.
3898
3899         - fixed 3366173 - crash in DOM::DomShared::ref loading www.berkheiser.net
3900         
3901         * khtml/ecma/kjs_html.cpp:
3902         (Image::putValue): Check for NULL before refing, because we set
3903         onLoadListener with a function that returns NULL if passed a value
3904         that's not a function.
3905
3906 2003-08-06  Maciej Stachowiak  <mjs@apple.com>
3907
3908         Reviewed by Darin and Dave.
3909
3910         - fixed 3364433 - repro crash in khtml::RenderBlock::nodeAtPoint
3911         
3912         * khtml/rendering/render_object.cpp:
3913         (RenderObject::removeFromObjectLists): When finding the right
3914         parent block to remove a float from, don't stop at floating or
3915         positioned elements. They could well have floats in their
3916         m_floatingObjects list due to overhang, and failing to remove them
3917         leads to crashes.
3918
3919 2003-08-05  Maciej Stachowiak  <mjs@apple.com>
3920
3921         Reviewed by John.
3922
3923         * kwq/KWQPainter.mm:
3924         (QPainter::drawLine): Print a warning in debug builds when drawing
3925         a dashed line. Also, revert accidental commenting of lines that
3926         set the dash style.
3927
3928 2003-08-04  Dave Hyatt  <hyatt@apple.com>
3929
3930         Fix for 3127909, copied text matched the document source instead of the
3931         rendered HTML.  This patch makes sure that the TextRuns are walked instead
3932         of just blindly pulling the text out of the DOM node.
3933         
3934         Reviewed by rjw
3935
3936         * khtml/khtml_part.cpp:
3937         (KHTMLPart::selectedText):
3938         * kwq/KWQKHTMLPart.mm:
3939         (KWQKHTMLPart::attributedString):
3940
3941 2003-08-05  Maciej Stachowiak  <mjs@apple.com>
3942
3943         Reviewed by Darin and Dave.
3944
3945         - fixed 3363557 - REGRESSION (90-91): float:left element inside position:absolute element positioned wrong
3946
3947         * khtml/rendering/render_block.cpp:
3948         (RenderBlock::calcInlineMinMaxWidth): Remove attempt to break line
3949         after flaot that follows a non-float. Removing this code fixes the
3950         regression and leaves pepboys and the meyerweb matrix theme
3951         working properly. Also, I could not find any evidence in the CSS2
3952         spec that what this code is trying to do is right.
3953
3954 2003-08-05  Ken Kocienda  <kocienda@apple.com>
3955
3956         Reviewed by John
3957
3958         Fix for this bug:
3959
3960         <rdar://problem/3364251>: Modify KURL to call improved NSURL creation API
3961
3962         * kwq/KWQKURL.mm:
3963         (KURL::getNSURL): Modify to use CFURLCreateAbsoluteURLWithBytes to create
3964         the NSURL.
3965
3966 2003-08-05  Ken Kocienda  <kocienda@apple.com>
3967
3968         Reviewed by Maciej
3969
3970         In KWQKURL.mm, we copy the contents of a URL path from a source buffer
3971         to a destination buffer. In the loop, we often access dst[-1]. It was
3972         not entirely clear that this did not underrun the buffer. Upon further
3973         inspection, it seems clear that it does not, but this small change
3974         makes this more clear, and adds an assertion that all is well with
3975         regard to indexing into the dst buffer.
3976
3977         * kwq/KWQKURL.mm:
3978         (copyPathRemovingDots)
3979
3980 2003-08-01  Richard Williamson   <rjw@apple.com>
3981
3982         Fixed 3095376.  Implemented correct selection behavior for rtl scripts.
3983         We still use our Arabic and Hebrew layout scheme.
3984
3985         Fixed 3360487.  Implemented selection of ATSU rendered code.
3986
3987         Fixed 3360242.  Return nil from _bodyBackgroundColor when no 
3988         background color specified.  This was requested by Doug D.
3989
3990         Reviewed by Maciej.
3991
3992         * khtml/rendering/font.cpp:
3993         (Font::drawHighlightForText):
3994         * khtml/rendering/font.h:
3995         * khtml/rendering/render_text.cpp:
3996         (TextRun::paintSelection):
3997         * kwq/KWQFontMetrics.mm:
3998         (QFontMetrics::checkSelectionPoint):
3999         * kwq/KWQKHTMLPart.mm:
4000         (KWQKHTMLPart::bodyBackgroundColor):
4001         * kwq/KWQPainter.h:
4002         * kwq/KWQPainter.mm:
4003         (QPainter::drawHighlightForText):
4004         * kwq/WebCoreTextRenderer.h:
4005
4006 2003-08-01  Maciej Stachowiak  <mjs@apple.com>
4007
4008         Reviewed by John.
4009
4010         - fixed 3265419 - homepage preview doesn't show Images with names longer than 17 chars
4011         
4012         * khtml/xml/dom_nodeimpl.cpp:
4013         (NodeImpl::recursive_toHTML):
4014
4015 2003-08-01  Maciej Stachowiak  <mjs@apple.com>
4016
4017         Reviewed by Darin.
4018
4019         - fixed 3339255 - REGRESSION (73-85): javascript failure at gia.apple.com
4020
4021         I fixed this by making sure to cancel any pending redirects before
4022         telling the bridge to load a URL. We don't want a race between
4023         getting back a response and the redirect timer.
4024
4025         * kwq/WebCoreBridge.h:
4026         * kwq/WebCoreBridge.mm:
4027         (-[WebCoreBridge provisionalLoadStarted]): New method - call equivalent part method.
4028         We count on the other side of the bridge to call this once it knows a load will
4029         really happen (not cancelled by policy, etc).
4030         * kwq/KWQKHTMLPart.h:
4031         * kwq/KWQKHTMLPart.mm:
4032         (KWQKHTMLPart::provisionalLoadStarted): cancel pending redirects.
4033
4034 === Safari-91 ===
4035
4036 2003-07-31  Dave Hyatt  <hyatt@apple.com>
4037
4038         Fix for 3347286, hang on pepboys.com.  Text-indent had numerous bugs that
4039         resulted in an infinite loop because some incorrect values were being compared.
4040         This patch changes floats to ignore text-indent when positioning themselves
4041         (as they should).
4042
4043         The maxwidth computation also didn't deal properly with text-indent, applying it
4044         multiple times instead of once, and also only applying it for text and not for
4045         inline replaced elements (images, form controls, etc.).
4046
4047         With these changes pepboys.com renders correctly.  This patch also conveniently fixes
4048         the last rendering error on meyerweb's Matrix stylesheet.
4049         
4050         Reviewed by darin
4051
4052         * khtml/rendering/render_block.cpp:
4053         * khtml/rendering/render_block.h:
4054
4055 2003-07-31  Richard Williamson   <rjw@apple.com>
4056
4057         Fixed 3359152.  SPI to get the background color for a frame.
4058
4059         Reviewed by hyatt.
4060
4061         * kwq/KWQKHTMLPart.h:
4062         * kwq/KWQKHTMLPart.mm:
4063         (KWQKHTMLPart::bodyBackgroundColor):
4064         * kwq/WebCoreBridge.h:
4065         * kwq/WebCoreBridge.mm:
4066         (-[WebCoreBridge bodyBackgroundColor]):
4067
4068 2003-07-31  Dave Hyatt  <hyatt@apple.com>
4069
4070         Fix for "The Matrix" stylesheet on meyerweb.com and for 26(!) of the
4071         layout tests.  Basically when laying out a line, you have a beginning, and end,
4072         and midpoints in between that tell you what whitespace to skip over.  It was
4073         possible to end up with the last midpoint being a start point that was past the
4074         end of the line, and in that case, we would sometimes not strip off the trailing
4075         space at the end of the line like we should.
4076
4077         This patch adds a simple function to check for this condition.  It strips off the
4078         out-of-bounds midpoint, and then shaves off the trailing space from the previous
4079         midpoint if it's necessary to do so.
4080
4081         Also fix the way spaces are counted so that we don't add in spaces for text that 
4082         is not part of any bidi runs.
4083         
4084         Reviewed by john
4085
4086         * khtml/rendering/bidi.cpp:
4087
4088 2003-07-30  Richard Williamson   <rjw@apple.com>
4089
4090         Preparation for 3095376.
4091
4092         Reviewed by Maciej.
4093
4094         * WebCore-combined.exp:
4095         * WebCore.exp:
4096         * khtml/rendering/font.cpp:
4097         (Font::checkSelectionPoint):
4098         * khtml/rendering/font.h:
4099         * khtml/rendering/render_text.cpp:
4100         (TextRun::checkSelectionPoint):
4101         * kwq/KWQFontMetrics.h:
4102         * kwq/KWQFontMetrics.mm:
4103         (QFontMetrics::width):
4104         (QFontMetrics::floatWidth):
4105         (QFontMetrics::floatCharacterWidths):
4106         (QFontMetrics::checkSelectionPoint):
4107         * kwq/KWQPainter.mm:
4108         (QPainter::drawText):
4109         * kwq/WebCoreTextRenderer.h:
4110         * kwq/WebCoreTextRendererFactory.m:
4111         (WebCoreInitializeTextRun):
4112         (WebCoreInitializeEmptyTextStyle):
4113
4114 2003-07-30  Dave Hyatt  <hyatt@apple.com>
4115
4116         Fix for 3274144, floats in Help Viewer overlapped when they shouldn't have.
4117         lineWidth was overflowing (and positionNewFloats was also sometimes not called
4118         when it should have been).
4119         
4120         Reviewed by darin
4121
4122         * khtml/rendering/bidi.cpp:
4123         * khtml/rendering/render_block.cpp:
4124
4125 2003-07-30  Dave Hyatt  <hyatt@apple.com>
4126
4127         Add support for setting the text-shadow's color.  This uses a new CG API,
4128         so updating to a fairly recent Panther is required.
4129         
4130         Reviewed by rjw
4131
4132         * khtml/css/cssparser.cpp:
4133         (CSSParser::parseShadow):
4134         * kwq/KWQPainter.mm:
4135         (QPainter::setShadow):
4136
4137 2003-07-30  John Sullivan  <sullivan@apple.com>
4138
4139         - fixed 3346460 -- images > area (2048x2048) are compressed vertically 
4140         when displayed as src of img tag
4141
4142         Reviewed by Darin
4143
4144         * khtml/rendering/render_image.cpp:
4145         (RenderImage::layout):
4146         Just comment out the code that imposes a maximum image size (incorrectly);
4147         maybe KDE folks want to make this work, but we don't need to try to
4148         prevent large images.
4149
4150 2003-07-30  John Sullivan  <sullivan@apple.com>
4151
4152         - WebCore part of fix for 3284525 -- AutoFill fills in 
4153         only e-mail address field of New Account form on Apple Store Japan
4154
4155         There were two problems: the regex library being used by
4156         KWQRegExp.mm didn't handle unicode at all, and the way we
4157         were using word boundaries in our regular expressions didn't
4158         work with Japanese.
4159
4160         Reviewed by Darin
4161
4162         * kwq/KWQKHTMLPart.mm:
4163         (regExpForLabels):
4164         Redid the way word boundaries are used; the old way didn't
4165         work with PCRE, and also didn't work with Japanese. 
4166
4167         * kwq/KWQRegExp.h:
4168         removed treatStartAsStartOfInput parameter to match() that Trey had added; 
4169         it was being used incorrectly and was not necessary.
4170
4171         * kwq/KWQRegExp.mm:
4172         (compareStringOffsets), (createSortedOffsetsArray),
4173         (convertCharacterOffsetsToUTF8ByteOffsets),
4174         (convertUTF8ByteOffsetsToCharacterOffsets):
4175         Code copied from JavaScriptCore/regexp.cpp to convert between
4176         byte and character offsets. Darin preferred that I copy these
4177         methods rather than make them public in JavaScriptCore/regexp.h.
4178         (QRegExp::KWQRegExpPrivate::compile):
4179         converted from regex.h style to pcre.h style 
4180         (QRegExp::KWQRegExpPrivate::~KWQRegExpPrivate):
4181         ditto
4182         (QRegExp::match):
4183         ditto
4184         (QRegExp::search):
4185         removed parameter to match()
4186         (QRegExp::searchRev):
4187         ditto
4188
4189         * kwq/KWQString.mm:
4190         (QString::replace):
4191         removed parameter to match()
4192
4193 2003-07-30  Richard Williamson   <rjw@apple.com>
4194
4195         Fixed 3349598.  Deal gracefully with <li> items that
4196         are not in a <ol> or <ul>, instead of crashing!
4197
4198         Reviewed by Ken.
4199
4200         * kwq/KWQKHTMLPart.mm:
4201         (listParent):
4202         (KWQKHTMLPart::attributedString):
4203
4204 2003-07-29  Richard Williamson   <rjw@apple.com>
4205
4206         Use the new KURL getNSURL() method to create an NSURL.
4207
4208         Reviewed by darin.
4209
4210         * kwq/KWQKHTMLPart.mm:
4211         (KWQKHTMLPart::attributedString):
4212
4213 2003-07-29  Darin Adler  <darin@apple.com>
4214
4215         Reviewed by Dave.
4216
4217         - fixed 3311756 -- REGRESSION (76-77): radio buttons in different forms act as the same set
4218         by rolling out old fix for 3158411 -- radio button groups are supposed to be per-form
4219         The real bug at flyglobespan.com is what's fixed below.
4220
4221         * khtml/html/html_formimpl.h:
4222         * khtml/html/html_formimpl.cpp:
4223         (HTMLFormElementImpl::radioClicked):
4224         (HTMLInputElementImpl::~HTMLInputElementImpl):
4225         (HTMLInputElementImpl::setType):
4226         (HTMLInputElementImpl::parseAttribute):
4227         (HTMLInputElementImpl::attach):
4228         (HTMLInputElementImpl::reset):
4229         (HTMLInputElementImpl::setChecked):
4230         (HTMLInputElementImpl::isEditable):
4231         * khtml/xml/dom_docimpl.cpp:
4232         * khtml/xml/dom_docimpl.h:
4233
4234         - fixed 3158411 -- re-opened form is one form in other browsers, multiple forms in Safari
4235         (flyglobespan.com)
4236
4237         * khtml/html/htmlparser.cpp: (KHTMLParser::getElement): Don't open a form if we encounter
4238         a form element inside another form.
4239
4240 2003-07-29  John Sullivan  <sullivan@apple.com>
4241
4242         - fixed 3346707 -- AutoFill does not fill in email address on 
4243         Apple Store new account page
4244
4245         Reviewed by Darin
4246
4247         * kwq/KWQRegExp.h:
4248         * kwq/KWQRegExp.mm:
4249         (QRegExp::searchRev):
4250         This method (that Trey had added) used a placeholder 2nd parameter
4251         that was always -1 and should have been ignored. But it was
4252         being passed into QRegExp::match as the starting index, which
4253         happened to work in many cases, but not if the byte of memory
4254         before the string happened to be a null character. Fixed by
4255         eliminating the placeholder parameter entirely.
4256
4257 2003-07-28  Maciej Stachowiak  <mjs@apple.com>
4258
4259         Reviewed by Richard.
4260
4261         - fixed 3343050 - nil-deref in saveInterpreterBuiltins running Sherlock via MallocDebug in Panther7B20
4262         - fixed 3343942 - Safari crashes when clicking on link w/ JavaScript turned off
4263         
4264         * kwq/KWQKHTMLPart.mm:
4265         (KWQKHTMLPart::saveInterpreterBuiltins): Don't attempt to save
4266         when JavaScript is off.
4267         (KWQKHTMLPart::restoreInterpreterBuiltins): Don't attempt to restore
4268         when JavaScript is off.
4269         (KWQKHTMLPart::saveWindowProperties): Remove ERROR, since that
4270         case is normal when JS is off.
4271         (KWQKHTMLPart::saveLocationProperties): Remove ERROR, since that
4272         case is normal when JS is off.
4273         (KWQKHTMLPart::restoreWindowProperties): Remove ERROR, since that
4274         case is normal when JS is off.
4275         (KWQKHTMLPart::restoreLocationProperties): Remove ERROR, since that
4276         case is normal when JS is off.
4277
4278 2003-07-28  Dave Hyatt  <hyatt@apple.com>
4279
4280         Fix build bustage on my buggy panther compiler.
4281         
4282         Reviewed by darin
4283
4284         * kwq/KWQLineEdit.mm:
4285         (QLineEdit::~QLineEdit):
4286
4287 2003-07-28  Dave Hyatt  <hyatt@apple.com>
4288
4289         Fix for 3343250, XML didn't know how to make implicit tbodies when starting new elements,
4290         nor did it know to skip implicit elements when popping its element stack.
4291         
4292         Reviewed by darin
4293
4294         * khtml/xml/xml_tokenizer.cpp:
4295         (XMLHandler::startElement):
4296         (XMLHandler::endElement):
4297
4298 2003-07-25  Dave Hyatt  <hyatt@apple.com>
4299
4300         Rename box and inline-box to -khtml-box and -khtml-inline-box.
4301         
4302         Reviewed by john
4303
4304         * khtml/css/cssparser.cpp:
4305         (CSSParser::parseValue):
4306         * khtml/css/cssvalues.c:
4307         (hash_val):
4308         (findValue):
4309         * khtml/css/cssvalues.h:
4310         * khtml/css/cssvalues.in:
4311
4312 2003-07-25  Dave Hyatt  <hyatt@apple.com>
4313
4314         Fix for 3343529, inline blocks crashing Safari.  There were lots of problems with
4315         inlne-blocks.  This code gets basic inline-blocks working properly (with no crashes).
4316
4317         Several functions have been patched to take an isRootLineBox parameter.  This is used
4318         to tell whether you're supposed to examine the root line box for a block or the block
4319         itself.  In the case of baselinePosition and lineHeight, it indicates whether the caller
4320         wants to measure the outside or inside of the box.  
4321
4322         The outside of an inline-block is like a replaced element (e.g., an image), but the 
4323         inside is like a block, e.g., you want measurements for
4324         the line height and baseline position of a root line box for that block.
4325
4326         Similarly, createInlineBox has been patched in order to know whether you're making a
4327         root inline box *inside* the inline-block or an inline box that *encompasses* the
4328         inline-block element (like you'd do for an image).
4329
4330         A number of places had isInline() calls and needed to be patched to also check
4331         isInlineBlockOrInlineTable().  How to treat the inline-block again basically depends
4332         on whether the caller is looking at the outside of the block (in which case you're like
4333         an inline replaced element) or the inside of the block (in which case you're just like
4334         a block).
4335         
4336         Reviewed by darin
4337
4338         * ChangeLog:
4339         * khtml/rendering/bidi.cpp:
4340         * khtml/rendering/render_block.cpp:
4341         * khtml/rendering/render_block.h:
4342         * khtml/rendering/render_box.cpp:
4343         (RenderBox::calcWidth):
4344         (RenderBox::calcHeight):
4345         * khtml/rendering/render_flow.cpp:
4346         (RenderFlow::createInlineBox):
4347         * khtml/rendering/render_flow.h:
4348         * khtml/rendering/render_form.cpp:
4349         (RenderFormElement::baselinePosition):
4350         (RenderButton::baselinePosition):
4351         (RenderSubmitButton::baselinePosition):
4352         (RenderSelect::baselinePosition):
4353         * khtml/rendering/render_form.h:
4354         * khtml/rendering/render_line.cpp:
4355         (InlineFlowBox::verticallyAlignBoxes):
4356         (InlineFlowBox::computeLogicalBoxHeights):
4357         * khtml/rendering/render_list.cpp:
4358         (RenderListMarker::lineHeight):
4359         (RenderListMarker::baselinePosition):
4360         * khtml/rendering/render_list.h:
4361         * khtml/rendering/render_object.cpp:
4362         (RenderObject::sizesToMaxWidth):
4363         (RenderObject::getVerticalPosition):
4364         (RenderObject::lineHeight):
4365         (RenderObject::baselinePosition):
4366         (RenderObject::createInlineBox):
4367         * khtml/rendering/render_object.h:
4368         * khtml/rendering/render_replaced.cpp:
4369         (RenderReplaced::lineHeight):
4370         (RenderReplaced::baselinePosition):
4371         * khtml/rendering/render_replaced.h:
4372         * khtml/rendering/render_table.cpp:
4373         * khtml/rendering/render_table.h:
4374         * khtml/rendering/render_text.cpp:
4375         (RenderText::lineHeight):
4376         (RenderText::baselinePosition):
4377         (RenderText::createInlineBox):
4378         * khtml/rendering/render_text.h:
4379
4380 2003-07-25  Dave Hyatt  <hyatt@apple.com>
4381
4382         Fix for 3343527, crash when attempting to access rules in the CSS OM.
4383         Our KWQListImpl doesn't null check accesses, so anything out
4384         of bounds would cause a crash.
4385         
4386         Reviewed by mjs
4387
4388         * kwq/KWQListImpl.mm:
4389         (KWQListImpl::at):
4390
4391 2003-07-25  Maciej Stachowiak  <mjs@apple.com>
4392
4393         Reviewed by Dave.
4394
4395          - fixed 3332460 - nil-deref in khtml::RenderWidget::eventFilter with onchange handler
4396
4397         * khtml/rendering/render_form.cpp:
4398         (RenderTextArea::handleFocusOut): Check if we still have an
4399         element. It could have gone away while handling an event that
4400         replaced some or all of the document, and if we're gonna be
4401         destroyed soon then there's no point doing this work anyway.
4402
4403 2003-07-25  Maciej Stachowiak  <mjs@apple.com>
4404
4405         Reviewed by Dave.
4406
4407         - fixed 3332460 - nil-deref in khtml::RenderWidget::eventFilter with onchange handler
4408         
4409         * khtml/rendering/render_replaced.cpp:
4410         (RenderWidget::eventFilter): We want to ref element() across this call, but it could get
4411         unset, so store it in a local variable.
4412         * kwq/KWQLineEdit.h:
4413         * kwq/KWQLineEdit.mm:
4414         (QLineEdit::~QLineEdit): invalidate our KWQTextField.
4415         * kwq/KWQTextField.h:
4416         * kwq/KWQTextField.mm:
4417         (-[KWQTextField invalidate]): Set widget to NULL.
4418         (-[KWQTextField action:]): Do nothing if widget is NULL.
4419         (-[KWQTextField controlTextDidBeginEditing:]): Likewise.
4420         (-[KWQTextField controlTextDidEndEditing:]): Likewise.
4421         (-[KWQTextField controlTextDidChange:]): Likewise.
4422         (-[KWQTextField control:textShouldBeginEditing:]): Likewise.
4423         (-[KWQTextField control:textShouldEndEditing:]): Likewise.
4424         (-[KWQTextField control:didFailToFormatString:errorDescription:]): Likewise.
4425         (-[KWQTextField control:didFailToValidatePartialString:errorDescription:]): Likewise.
4426         (-[KWQTextField control:isValidObject:]): Likewise.
4427         (-[KWQTextField control:textView:doCommandBySelector:]): Likewise.
4428         (-[KWQTextField stringValue]): Likewise.
4429         (-[KWQTextField setStringValue:]): Likewise.
4430         (-[KWQTextField setFont:]): Likewise.
4431         (-[KWQTextField nextKeyView]): Likewise.
4432         (-[KWQTextField previousKeyView]): Likewise.
4433         (-[KWQTextField nextValidKeyView]): Likewise.
4434         (-[KWQTextField previousValidKeyView]): Likewise.
4435         (-[KWQTextField fieldEditorDidMouseDown:]): Likewise.
4436         (-[KWQTextField textView:shouldHandleEvent:]): Likewise.
4437         (-[KWQTextField textView:didHandleEvent:]): Likewise.
4438         (-[KWQTextField setHasFocus:]): Likewise.
4439
4440 2003-07-24  John Sullivan  <sullivan@apple.com>
4441
4442         - fixed 3332622 -- Safari Abbreviates Attribute Names in EMBED tags
4443
4444         Reviewed by Richard
4445
4446         * khtml/html/htmltokenizer.h:
4447         bumped fixed max length of attributes from 14 to 1024.
4448         Theoretically they could be any arbitrary length, but it's
4449         more risk than it's worth to rewrite the code that uses the
4450         fixed-size buffer that is based on this value.
4451
4452 2003-07-24  Dave Hyatt  <hyatt@apple.com>
4453
4454         Change all uses of "konq-" in CSS to "khtml-".  
4455
4456         Also rename the CSS3 properties that have either buggy or 
4457         incomplete implementations to "-khtml-property" for forward
4458         compatibility (so that people don't have to worry about a buggy
4459         Safari if/when they use the official property names).
4460         
4461         Reviewed by john
4462
4463         * khtml/css/cssparser.cpp:
4464         (CSSParser::parseRule):
4465         (CSSParser::parseValue):
4466         (CSSParser::parseDeclaration):
4467         (CSSParser::parseFontFamily):
4468         (CSSParser::parseShadow):
4469         * khtml/css/cssproperties.c:
4470         (hash_prop):
4471         (findProp):
4472         * khtml/css/cssproperties.h:
4473         * khtml/css/cssproperties.in:
4474         * khtml/css/cssstyleselector.cpp:
4475         * khtml/css/cssvalues.c:
4476         (hash_val):
4477         (findValue):
4478         * khtml/css/cssvalues.h:
4479         * khtml/css/cssvalues.in:
4480         * khtml/css/html4.css:
4481         * khtml/css/parser.cpp:
4482         * khtml/css/parser.h:
4483         * khtml/css/parser.y:
4484         * khtml/css/quirks.css:
4485         * khtml/css/tokenizer.cpp:
4486         * khtml/css/tokenizer.flex:
4487         * khtml/html/html_blockimpl.cpp:
4488         (HTMLDivElementImpl::parseAttribute):
4489         (HTMLParagraphElementImpl::parseAttribute):
4490         * khtml/html/html_elementimpl.cpp:
4491         (HTMLElementImpl::addHTMLAlignment):
4492         * khtml/html/html_inlineimpl.cpp:
4493         (HTMLFontElementImpl::parseAttribute):
4494         * khtml/html/html_tableimpl.cpp:
4495         (HTMLTablePartElementImpl::parseAttribute):
4496         (HTMLTableCellElementImpl::parseAttribute):
4497         * khtml/rendering/bidi.cpp:
4498         * khtml/rendering/render_block.cpp:
4499         * khtml/rendering/render_box.cpp:
4500         (RenderBox::calcHorizontalMargins):
4501         * khtml/rendering/render_flexbox.cpp:
4502         * khtml/rendering/render_style.h:
4503         * khtml/rendering/render_table.cpp:
4504         (RenderTableCell::setStyle):
4505
4506 === Safari-90 ===
4507
4508 2003-07-23  Dave Hyatt  <hyatt@apple.com>
4509
4510         Fix opacity to respect clipping.
4511         
4512         Reviewed by rjw
4513
4514         * khtml/rendering/render_layer.cpp:
4515         (RenderLayer::paint):
4516
4517 2003-07-23  Darin Adler  <darin@apple.com>
4518
4519         Reviewed by John.
4520
4521         - fixed 2/3 of 3279864 -- remove class_poseAs calls from WebKit (will also remove init routine)
4522
4523         * kwq/KWQTextArea.h: Add drawing state variable so we can tell the difference
4524         between calls to draw the insertion point inside and calls to draw outside the
4525         redraw machinery.
4526         * kwq/KWQTextArea.mm:
4527         (-[KWQTextArea displayRectIgnoringOpacity:]): Added. Set drawing flag while in here.
4528         This is the method used by KWQWidget to draw.
4529         (-[KWQTextArea textView:shouldDrawInsertionPointInRect:color:turnedOn:]): Added.
4530         Calls setNeedsDisplay (the NSView version, not the NSTextView override) instead
4531         of immediately drawing when asked to draw outside the normal redraw machinery.
4532         (-[KWQTextAreaTextView keyDown:]): Call interceptKeyEvent before handling each
4533         key down event.
4534         * kwq/KWQTextField.h: Add drawing state variable so we can tell the difference
4535         between calls to draw the insertion point inside and calls to draw outside the
4536         redraw machinery.
4537         * kwq/KWQTextField.mm:
4538         (-[KWQTextField displayRectIgnoringOpacity:]): Added. Set drawing flag while in here.
4539         This is the method used by KWQWidget to draw.
4540         (-[KWQTextField textView:shouldDrawInsertionPointInRect:color:turnedOn:]): Added.
4541         Calls setNeedsDisplay (the NSView version, not the NSTextView override) instead
4542         of immediately drawing when asked to draw outside the normal redraw machinery.
4543         (-[KWQTextField textView:shouldHandleEvent:]): Call interceptKeyEvent before
4544         handling each key down event.
4545         (-[KWQTextField textView:didHandleEvent:]): Call fieldEditorDidMouseDown: after
4546         handling each mouse down event.
4547
4548         * kwq/KWQWidget.mm: (QWidget::paint): Add comment about dependency on
4549         displayRectIgnoringOpacity: use in KWQTextArea and KWQTextField.
4550
4551         * kwq/WebCoreFirstResponderChanges.h: Added a comment about obsolescence.
4552
4553         - Xcode wanted to change this, because it now knows JavaScriptCore is a framework
4554
4555         * WebCore.pbproj/project.pbxproj: Munged by Xcode.
4556
4557 2003-07-23  Dave Hyatt  <hyatt@apple.com>
4558
4559         Fix for 3340885, invalid colors were being mapped to transparentColor,
4560         thus causing invisible text!
4561         
4562         Reviewed by kocienda
4563
4564         * khtml/css/cssparser.cpp:
4565         (CSSParser::parseColorFromValue):
4566
4567 2003-07-23  Richard Williamson   <rjw@apple.com>
4568
4569         Fixed for 3259840.  Use ATSU for scripts we don't handle internally,
4570         i.e.:  Syriac, Thaana, Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar, Hangul Jamo, Khmer, Mongolian
4571
4572         Also fixed issues with our rendering of Arabic.
4573
4574         Changed the internal API to take WebCoreTextRun and WebCoreTextStyle
4575         parameters instead of scads on individual parameters.  Much cleaner.
4576
4577         Reviewed by Maciej.
4578
4579         * WebCore-combined.exp:
4580         * WebCore.exp:
4581         * kwq/KWQFontMetrics.mm:
4582         (QFontMetrics::width):
4583         (QFontMetrics::floatWidth):
4584         (QFontMetrics::floatCharacterWidths):
4585         * kwq/KWQPainter.mm:
4586         (QPainter::drawText):
4587         * kwq/WebCoreTextRenderer.h:
4588         * kwq/WebCoreTextRendererFactory.m:
4589         (WebCoreMakeTextRun):
4590         (WebCoreMakeEmptyTextStyle):
4591
4592 2003-07-23  Dave Hyatt  <hyatt@apple.com>
4593
4594         Clean up the mess left by a couple of previous checkins.  I had
4595         patched computeLength and computeLengthFloat to take a CSSStyleSelector,
4596         but then I came up with a simpler solution that didn't require that
4597         the selector be passed in as an argument.  I forgot, however, to revert
4598         the functions back to their original forms.  This patch does that.
4599         
4600         Reviewed by john
4601
4602         * khtml/css/css_valueimpl.cpp:
4603         (CSSPrimitiveValueImpl::computeLength):
4604         (CSSPrimitiveValueImpl::computeLengthFloat):
4605         * khtml/css/css_valueimpl.h:
4606         * khtml/css/cssstyleselector.cpp:
4607
4608 2003-07-23  Dave Hyatt  <hyatt@apple.com>
4609
4610         Temporary hack to ensure that the layout tests will not all
4611         be failures if/when the layout tests regression gets fixed.
4612         Will remove once we can run the tests.
4613         
4614         Reviewed by ken
4615
4616         * khtml/rendering/render_block.cpp:
4617
4618 2003-07-22  Dave Hyatt  <hyatt@apple.com>
4619
4620         Allow HTML and BODY to be any display type.  This patch primarily eliminates the
4621         RenderBody class and makes the code that deals with background propagation smart
4622         enough to locate the correct renderers for the HTML and BODY elements (by crossing
4623         back into the DOM tree).
4624         
4625         Reviewed by darin
4626
4627         * ForwardingHeaders/rendering/render_body.h: Removed.
4628         * WebCore.pbproj/project.pbxproj:
4629         * khtml/html/html_baseimpl.cpp:
4630         (HTMLBodyElementImpl::insertedIntoDocument):
4631         * khtml/html/html_baseimpl.h:
4632         * khtml/rendering/render_body.cpp: Removed.
4633         * khtml/rendering/render_body.h: Removed.
4634         * khtml/rendering/render_box.cpp:
4635         (RenderBox::setStyle):
4636         (RenderBox::paintRootBoxDecorations):
4637         (RenderBox::paintBoxDecorations):
4638         (RenderBox::repaint):
4639         * khtml/rendering/render_inline.cpp:
4640         (RenderInline::paintObject):
4641         * khtml/rendering/render_inline.h:
4642         * khtml/rendering/render_object.cpp:
4643         (RenderObject::isBody):
4644         * khtml/rendering/render_object.h:
4645         * khtml/xml/dom_elementimpl.cpp:
4646         (ElementImpl::createRenderer):
4647
4648 2003-07-22  Darin Adler  <darin@apple.com>
4649
4650         Reviewed by Maciej.
4651
4652         - fixed 3108604 -- add Shift JIS X0213 and HK-SCS to the Text Encoding menu
4653
4654         * kwq/mac-encodings.txt: Added "Shift_JIS_X0213-2000". Changed all non-HKSCS
4655         Big5 encodings to use the DOS variant of Big5 as requested by Peter Edberg,
4656         but left Big5-HKSCS alone.
4657         * kwq/KWQCharsets.mm: Added kCFStringEncodingBig5_DOSVariant constant.
4658         * kwq/KWQCharsetData.c: Regenerated.
4659
4660         - fixed 3100151 -- subframes without explicit charset settings should inherit from parent, not use default
4661
4662         * khtml/khtml_part.cpp: (KHTMLPart::write): Get the default encoding from the parent
4663         part, if there is one.
4664
4665 2003-07-22  Dave Hyatt  <hyatt@apple.com>
4666
4667         Fix for 3293898, list bullets in ordered lists with an inside list
4668         position were rendering as though they had a width of 0.  This was
4669         a bug in KWQFontMetrics, which needed to handle the case where a
4670         length of -1 was passed in to the width method (in which case
4671         you should use the length of the whole string).
4672         
4673         Reviewed by john
4674
4675         * kwq/KWQFontMetrics.mm:
4676         (QFontMetrics::width):
4677
4678 2003-07-22  Dave Hyatt  <hyatt@apple.com>
4679
4680         Fix for mozilla.org front page.  This patch re-architects 
4681         align="left" and align="right" (for rtl and ltr directionality
4682         respectively).  The attributes are mapped to custom text-align
4683         values, konq-left and konq-right, just as was done with the
4684         center/middle attributes for alignment.
4685
4686         A number of "hack" style rules have been dropped from html4.css
4687         and replaced with this C++ code that now works in the general
4688         case for any children of align="left/right" divs and tds.
4689
4690         In addition, absmiddle support has been added for <td>s.
4691
4692         For RTL blocks, there is also a regression fix (this was probably
4693         the #1 culprit for mangled placement of blocks in Hebrew Web
4694         pages).  The old code was doing byzantine math that happened to
4695         work out.  When I tried to simplify it before 1.0, I missed a spot
4696         and basically broke margin handling on RTL blocks completely.
4697         
4698         Reviewed by mjs
4699
4700         * khtml/css/cssparser.cpp:
4701         (CSSParser::parseValue):
4702         * khtml/css/cssvalues.c:
4703         (hash_val):
4704         (findValue):
4705         * khtml/css/cssvalues.h:
4706         * khtml/css/cssvalues.in:
4707         * khtml/css/html4.css:
4708         * khtml/html/html_blockimpl.cpp:
4709         (HTMLDivElementImpl::parseAttribute):
4710         (HTMLParagraphElementImpl::parseAttribute):
4711         * khtml/html/html_tableimpl.cpp:
4712         (HTMLTablePartElementImpl::parseAttribute):
4713         * khtml/rendering/bidi.cpp:
4714         * khtml/rendering/render_block.cpp:
4715         * khtml/rendering/render_box.cpp:
4716         (RenderBox::calcHorizontalMargins):
4717         * khtml/rendering/render_style.h:
4718
4719 2003-07-21  Dave Hyatt  <hyatt@apple.com>
4720
4721         Fix for 3333557, crash on www.dremedia.com.  markDescendants in RenderBlock
4722         was not passing in its argument in the recursive step, so the float wasn't
4723         getting properly cleared out of everyone's lists.
4724         
4725         Reviewed by darin
4726
4727         * khtml/rendering/render_block.cpp:
4728
4729 2003-07-21  Dave Hyatt  <hyatt@apple.com>
4730
4731         Fix for 3182596, percentage height tables with cells that specify
4732         tiny percentage heights used that height even if it was smaller
4733         than the cell's minimum required height.
4734         
4735         Reviewed by darin
4736
4737         * khtml/rendering/render_table.cpp:
4738         (RenderTableSection::layoutRows):
4739
4740 2003-07-21  Darin Adler  <darin@apple.com>
4741
4742         Reviewed by Dave.
4743
4744         - fixed 3316867 -- tabbing to textarea below visible part of page doesn't scroll down
4745
4746         * kwq/KWQTextArea.mm: (-[KWQTextAreaTextView becomeFirstResponder]): Added call to
4747         _KWQ_scrollFrameToVisible to match the one in KWQTextField.
4748
4749 2003-07-21  Dave Hyatt  <hyatt@apple.com>
4750
4751         Fix removeAttributeNode.  This is David Faure's patch.
4752         
4753         Reviewed by me
4754
4755         * khtml/xml/dom_elementimpl.cpp:
4756         (NamedAttrMapImpl::removeAttribute):
4757
4758 2003-07-21  Dave Hyatt  <hyatt@apple.com>
4759
4760         Checking in David Faure's patch that fixes getElementsByTagName(*).
4761         
4762         Reviewed by me
4763
4764         * khtml/xml/dom_nodeimpl.cpp:
4765         (NodeBaseImpl::getElementsByTagNameNS):
4766         (TagNodeListImpl::nodeMatches):
4767
4768 2003-07-18  Dave Hyatt  <hyatt@apple.com>
4769
4770         Enable domain() and setDomain() to work for all documents (XML
4771         as well as HTML).
4772
4773         Implement onload for frames.
4774         
4775         Reviewed by mjs
4776
4777         * khtml/ecma/kjs_window.cpp:
4778         (Window::isSafeScript):
4779         (WindowFunc::tryCall):
4780         * khtml/html/html_baseimpl.cpp:
4781         (HTMLFrameElementImpl::parseAttribute):
4782         (HTMLIFrameElementImpl::parseAttribute):
4783         * khtml/html/html_documentimpl.cpp:
4784         * khtml/html/html_documentimpl.h:
4785         * khtml/khtml_part.cpp:
4786         (KHTMLPart::checkEmitLoadEvent):
4787         * khtml/xml/dom_docimpl.cpp:
4788         (DocumentImpl::domain):
4789         (DocumentImpl::setDomain):
4790         * khtml/xml/dom_docimpl.h:
4791         * khtml/xml/dom_nodeimpl.cpp:
4792         (NodeImpl::dispatchWindowEvent):
4793
4794 2003-07-18  Dave Hyatt  <hyatt@apple.com>
4795
4796         Fix for 3334082, XML documents can access HTML/XML docs in other
4797         domains.  The basic bug is that we made a change right before
4798         1.0 to allow a parent document to access a child frame's document
4799         if the child frame had no document.  What we didn't notice was
4800         that the ptr was obtained from the part by asking for an HTML
4801         document.  For XML documents that failed the cast, we got back
4802         null as well, which means that for non-HTML XML documents we
4803         always return true from isSafeScript.
4804
4805         This patch makes sure our addition uses the raw xmlDoc pointer,
4806         so that there are no mistakes, and it restores the code that
4807         denies access when you aren't an HTML document.
4808
4809         (It is a separate bug that we just disallow cross-frame
4810         communication in XML documents right now that I'll file as
4811         a follow-up to this one.)
4812         
4813         Reviewed by darin, rjw, mjs
4814
4815         * khtml/ecma/kjs_window.cpp:
4816         (Window::isSafeScript):
4817
4818 2003-07-15  Dave Hyatt  <hyatt@apple.com>
4819
4820         Fix for 3300362, crash on myuhc.com.  The residual style code
4821         was messing up and inserting nodes in the wrong place (and also
4822         updating the current member variable when it wasn't supposed to).
4823
4824         Fix for 3331793, nil deref because (astoundingly) someone was
4825         using text-shadow and exposed a bug with the color handling
4826         of the shadow.
4827         
4828         Reviewed by darin
4829
4830         * khtml/html/htmlparser.cpp:
4831         * khtml/html/htmlparser.h
4832         (KHTMLParser::reopenResidualStyleTags):
4833         (KHTMLParser::popBlock):
4834
4835 2003-07-17  Maciej Stachowiak  <mjs@apple.com>
4836
4837         Reviewed by John.
4838
4839         - fixed 3283076 - crash when doing 2nd query on the eBay channel (Sherlock) -- JavaScript locking issue?
4840
4841         I added a bit of minimal extra locking to WebCore to make sure
4842         multithreaded apps that use WebKit on the main thread but do
4843         JavaScript on other threads as well continue to work nicely.
4844
4845         * khtml/ecma/kjs_proxy.cpp:
4846         (KJSProxyImpl::initScript): Lock interpreter around possible allocations or collections.
4847         * khtml/ecma/kjs_window.cpp:
4848         (Window::clear): Lock interpreter around possible allocations or collections.
4849
4850 2003-07-17  Ken Kocienda  <kocienda@apple.com>
4851
4852         Reviewed by John
4853
4854         * kwq/KWQKHTMLPart.mm:
4855         (KWQKHTMLPart::createPart): Now uses NSURL instead of NSString
4856         (KWQKHTMLPart::redirectionTimerStartedOrStopped): Ditto
4857         (KWQKHTMLPart::userAgent): Ditto
4858         * kwq/KWQKHTMLPartBrowserExtension.mm:
4859         (KHTMLPartBrowserExtension::setIconURL): Ditto
4860         (KHTMLPartBrowserExtension::setTypedIconURL): Ditto
4861         * kwq/KWQKJavaAppletWidget.mm:
4862         (KJavaAppletWidget::showApplet): Ditto
4863         * kwq/KWQLoader.mm:
4864         (KWQServeRequest): Ditto
4865         (KWQCheckCacheObjectStatus): Ditto
4866         * kwq/WebCoreBridge.h: Changed quite a number of methods to use NSURL 
4867         instead of NSString
4868         * kwq/WebCoreBridge.mm:
4869         (-[WebCoreBridge didNotOpenURL:]): Now uses NSURL instead of NSString
4870         (-[WebCoreBridge scrollToAnchorWithURL:]): Ditto
4871         (-[WebCoreBridge URL]): Ditto
4872
4873 2003-07-17  Ken Kocienda  <kocienda@apple.com>
4874
4875         Reviewed by Darin
4876
4877         * kwq/KWQKHTMLPart.h: _submittedFormURL is now a KURL, not a QString
4878         * kwq/KWQKHTMLPart.mm:
4879         (KWQKHTMLPart::openURL): Now uses NSURL in API instead of NSString
4880         (KWQKHTMLPart::openURLRequest): Ditto
4881         (KWQKHTMLPart::didNotOpenURL): Ditto
4882         (KWQKHTMLPart::submitForm): Ditto. Plus update _submittedFormURL usages.
4883         (KWQKHTMLPart::urlSelected): Ditto
4884         (KWQKHTMLPart::setView): Ditto
4885         * kwq/KWQKHTMLPartBrowserExtension.mm:
4886         (KHTMLPartBrowserExtension::createNewWindow): Now uses NSURL in API instead of NSString
4887         * kwq/KWQKURL.h: Added constructor that takes an NSURL
4888         * kwq/KWQKURL.mm:
4889         (KURL::KURL): Ditto.
4890         * kwq/WebCoreBridge.h: Updated bridge APIs to use NSURL instead of NSString
4891         in several places.
4892         * kwq/WebCoreBridge.mm:
4893         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]): Ditto
4894
4895 2003-07-16  Darin Adler  <darin@apple.com>
4896
4897         Reviewed by John.
4898
4899         - cure problem where we keep competing to check in config.h with/without HAVE_FOUNDATION_SOURCSE
4900
4901         * Makefile.am: Remove the HAVE_FOUNDATION_SOURCES line.
4902         * config.h: Check in without that line.
4903
4904 2003-07-16  Vicki Murley  <vicki@apple.com>
4905
4906         Reviewed by kocienda. 
4907
4908         * kwq/KWQKHTMLPart.mm:
4909         (KWQKHTMLPart::attributedString): set linkStartLocation to zero to fix deployment build 
4910
4911 2003-07-15  Ken Kocienda  <kocienda@apple.com>
4912
4913         Reviewed by Richard
4914         
4915         * kwq/KWQKURL.h:
4916         * kwq/KWQKURL.mm:
4917         (StringHasCaseInsensitivePrefix): Helper method for the new functions below
4918         (StringByAddingPercentEscapes): Ditto
4919         (URLStringByAddingPercentEscapes): Ditto
4920         (KURL::getNSURL): Added convenience function to get an NSURL from a KURL
4921         (KURL::getNSData): Added convenience function to get an NSData from a KURL
4922
4923 2003-07-15  Richard Williamson   <rjw@apple.com>
4924
4925         Fixed 3315951:  Add support for <OL>, <UL> in attributed string conversion.
4926         Fixed 3315952:  Add support for <IMG> in attributed string conversion.
4927         Fixed 3315953:  Added support for <A> in attributed string conversion.  
4928
4929         Reviewed by John (and earlier by Darin).
4930
4931         * khtml/rendering/render_list.h:
4932         * kwq/KWQKHTMLPart.mm:
4933         (fileWrapperForElement):
4934         (listParent):
4935         (inList):
4936         (KWQKHTMLPart::attributedString):
4937
4938 2003-07-14  Dave Hyatt  <hyatt@apple.com>
4939
4940         Fix a problem where ems used for non-font values like width
4941         and line-height would not zoom. (r=darin)
4942
4943         The rest is r=rjw.
4944         
4945         An implementation of the CSS2 text-shadow property. 
4946
4947         It uses a CoreGraphics API for drawing shadows 
4948         (via a custom API on QPainter) to paint the shadows.
4949
4950         At the moment there are two limitations in CG's API.  The first
4951         is that the shadow color cannot be set.  This will be fixed for
4952         Panther, and the code passes the color through in preparation
4953         for this fix.
4954
4955         The second limitation is that CG only supports one shadow effect
4956         and not multiple shadow effects.  The parsing code on the CSS
4957         side is set up to go ahead and parse all of the shadow effects,
4958         but the code that makes use of shadows will simply look at the
4959         first one for now.  CG will not support multiple shadow effects
4960         in the Panther time frame, so it will be a while before this
4961         is revisited.
4962
4963         This patch also fixes a slew of bugs with colors in KHTML.  When
4964         we took the CSS parser and all of its associated code from Lars,
4965         that code was using QRgb values that assumed RGBA (like the current
4966         Qt toolkit uses).  The code even made use of an "invalid color"
4967         that wasn't really invalid (kind of like the z-index hack we refused
4968         to take, i.e., unlikely but not invalid).
4969
4970         Our KWQColor implementation has been rewritten in this patch to
4971         work the way the current Qt toolkit expects.  That is, the top
4972         eight bits actually do contain an alpha channel, and you can obtain
4973         the alpha component using the qAlpha method and build a quadruple
4974         using the qRgba method.
4975
4976         This patch adds support for rgba quadruples to CSS, so you can now
4977         say, e.g.,color: rgba(255,0,0,0.5); in CSS.
4978         
4979         * khtml/css/css_valueimpl.cpp:
4980         (ShadowValueImpl::~ShadowValueImpl):
4981         * khtml/css/css_valueimpl.h:
4982         * khtml/css/cssparser.cpp:
4983         (CSSParser::parseValue):
4984         (parseColor):
4985         (CSSParser::parseColor):
4986         (CSSParser::parseColorFromValue):
4987         (CSSParser::parseShadow):
4988         * khtml/css/cssparser.h:
4989         * khtml/css/cssstyleselector.cpp:
4990         * khtml/misc/helper.h:
4991         * khtml/rendering/render_line.cpp:
4992         (InlineFlowBox::paintDecorations):
4993         * khtml/rendering/render_style.cpp:
4994         (StyleVisualData::StyleVisualData):
4995         (opacity):
4996         (flexibleBox):
4997         (StyleCSS3NonInheritedData::operator==):
4998         (textShadow):
4999         (StyleCSS3InheritedData):
5000         (StyleCSS3InheritedData::operator==):
5001         (StyleCSS3InheritedData::shadowDataEquivalent):
5002         (RenderStyle::RenderStyle):
5003         (RenderStyle::inheritFrom):
5004         (RenderStyle::operator==):
5005         (RenderStyle::inheritedNotEqual):
5006         (RenderStyle::diff):
5007         (ContentData::clearContent):
5008         (RenderStyle::setTextShadow):
5009         (ShadowData::operator==):
5010         * khtml/rendering/render_style.h:
5011         * khtml/rendering/render_text.cpp:
5012         (RenderText::paintObject):
5013         * khtml/xml/dom_nodeimpl.cpp:
5014         (NodeImpl::diff):
5015         * kwq/KWQColor.h:
5016         * kwq/KWQColor.mm:
5017         (qRgb):
5018         (qRgba):
5019         (qAlpha):
5020         (QColor::QColor):
5021         (QColor::setNamedColor):
5022         (QColor::getNSColor):
5023         * kwq/KWQNamespace.h:
5024         * kwq/KWQPainter.h:
5025         * kwq/KWQPainter.mm:
5026         (QPainter::drawRect):
5027         (QPainter::drawLine):
5028         (QPainter::_fillRect):
5029         (QPainter::fillRect):
5030         (QPainter::setShadow):
5031         (QPainter::clearShadow):
5032
5033 2003-07-14  Darin Adler  <darin@apple.com>
5034
5035         Reviewed by Maciej.
5036
5037         - fixed 3244447 -- add KOI8-U charset support
5038         - fixed 3327152 -- unicodeFFFE and unicodeFEFF are handled backwards by WebCore
5039         - fixed 3327157 -- x-mac-ukrainian should be mapped to MacCyrillic
5040         - fixed 3327160 -- shift-jis, shift_jis, x-sjis should be mapped to the DOS variant of Shift JIS
5041         - fixed 3327162 -- most Simplified Chinese encoding choices should be mapped to the DOS variant of EUC-CN
5042         - fixed 3327166 -- use DOS variant of EUC_KR
5043
5044         * kwq/KWQCharsets.mm: Added some defines so we could use encodings that don't
5045         have any kCFStringEncoding constant in a header file.
5046         * kwq/mac-encodings.txt: Change table entries in accordance with the above bug reports.
5047         * kwq/KWQCharsetData.c: Regenerated.
5048
5049         - other changes, inspired by investigation of various bugs
5050
5051         * kwq/KWQButton.mm: (-[KWQButton sendConsumedMouseUpIfNeeded]): Make robust against cases where
5052         sending the consumed mouse up event destroys the QButton.
5053
5054         * khtml/html/htmlparser.cpp:
5055         (KHTMLParser::reopenResidualStyleTags): Rearrange code slightly for clarity, added comment.
5056         (KHTMLParser::freeBlock): Removed unnecessary line of code.
5057
5058 2003-07-14  Dave Hyatt  <hyatt@apple.com>
5059
5060         Fix for 3294626, no scrollbar on ESPN.  Fix lowestPosition to
5061         always crawl into all children.
5062         
5063         Reviewed by darin
5064
5065         * khtml/rendering/render_flow.cpp:
5066         (RenderFlow::lowestPosition):
5067         (RenderFlow::rightmostPosition):
5068
5069 2003-07-11  Darin Adler  <darin@apple.com>
5070
5071         Reviewed by Maciej.
5072
5073         - fixed 3132021 -- certain Japanese characters are misrendered because of incorrect partial-character handling
5074
5075         We didn't have code to handle kTECPartialCharErr.
5076
5077         * kwq/KWQTextCodec.mm:
5078         (KWQTextDecoder::createTECConverter): Added. Broken out from convertUsingTEC.
5079         (KWQTextDecoder::appendOmittingBOMs): Added. Broken out from convertUsingTEC.
5080         (KWQTextDecoder::convertOneChunkUsingTEC): Added. Broken out from convertUsingTEC.
5081         This also has much of the partially-decoded character handling.
5082         (KWQTextDecoder::convertUsingTEC): Simplified by breaking into functions, and added
5083         handling to use the same buffer we use for the other decoders to hold partially-decoded
5084         characters.
5085         (KWQTextDecoder::convert): Add a partial-character handling test mode where the decoder
5086         is passed only a single byte at a time; controlled by an #if.
5087
5088 2003-07-11  Dave Hyatt  <hyatt@apple.com>
5089
5090         Fix for 3187101, before/after content not dynamic.  This patch
5091         compares the ContentData of the old style and the new style and
5092         if they are different, it blows away and recreates the render
5093         objects for the generated content.  Otherwise it will dynamically
5094         update the styles of the generated content render objects (which
5095         should fix the printer/screen bug for rjw).
5096
5097         Note that createObject had an extra call to setStyle, which was
5098         causing most objects to set the same style context on themselves
5099         twice.  This was exposed as I was fixing the above problem.
5100         
5101         Reviewed by darin
5102
5103         * ChangeLog:
5104         * khtml/rendering/render_container.cpp:
5105         (RenderContainer::updatePseudoChild):
5106         * khtml/rendering/render_object.cpp:
5107         (RenderObject::createObject):
5108         * khtml/rendering/render_style.cpp:
5109         (RenderStyle::contentDataEquivalent):
5110         * khtml/rendering/render_style.h:
5111
5112 2003-07-11  Dave Hyatt  <hyatt@apple.com>
5113
5114         Fix pseudostyles to inherit from the element's style that they are
5115         specified for.  This is incorrect both for ::first-line and
5116         ::first-letter, but it is at least right for ::before and ::after.
5117
5118         Fix iframes and objects and embeds so that they will render borders
5119         when borders are specified (as well as background images).
5120
5121         Patch iframes so that they correctly let the parent document's
5122         background show through when the Web page inside the iframe has
5123         no specified background.  Also patched iframes to understand not
5124         to blit in this case and to not blit when opacity has been specified
5125         on the iframe.
5126         
5127         Reviewed by darin
5128
5129         * khtml/css/cssstyleselector.cpp:
5130         * khtml/khtmlview.h:
5131         * khtml/rendering/render_box.cpp:
5132         (RenderBox::paintRootBoxDecorations):
5133         * khtml/rendering/render_canvas.cpp:
5134         * khtml/rendering/render_form.cpp:
5135         (RenderFormElement::setStyle):
5136         * khtml/rendering/render_replaced.cpp:
5137         (RenderReplaced::calcMinMaxWidth):
5138         (RenderWidget::setStyle):
5139         (RenderWidget::paintObject):
5140         * kwq/KWQKHTMLPart.mm:
5141         (KWQKHTMLPart::paint):
5142
5143 2003-07-11  Darin Adler  <darin@apple.com>
5144
5145         Reviewed by Ken.
5146
5147         - roll in change from KHTML to remove user and password from referrer
5148
5149         * khtml/khtml_part.cpp: (KHTMLPart::begin): Call setUser(""), setPass(""),
5150         and setRef(""), then also set the referrer to "" if the protocol does not
5151         start with http.
5152
5153         * kwq/WebCoreBridge.mm: (-[WebCoreBridge referrer]): Remove check to exclude
5154         file URL referrers because KHTMLPart now excludes all non-http referrers.
5155
5156         * kwq/KWQKURL.h: Add setUser and setPass functions. Also sort by order within
5157         the URL so it's clear no methods are omitted.
5158         * kwq/KWQKURL.mm:
5159         (KURL::setUser): Added. Adds or removes the username, adding or removing
5160         delimiters as needed. For now only the remove part is compiled in.
5161         (KURL::setPass): Added. Adds or removes a password, adding or removing
5162         delimiters as needed. For now only the remove part is compiled in.
5163
5164         * kwq/KWQString.h: Add QSTRING_NULL macro to allow us to work around the fact
5165         that there is no global QString::null object in KWQ without having to do a
5166         relatively ineffecient conversion from a non-constant char * of 0 each time.
5167         We can use this anywhere QString::null appears and perhaps get some small code
5168         savings or performance boost.
5169
5170         - small cleanup
5171
5172         * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Remove unneeded checks that
5173         repeat optimizations I already put in QString.
5174
5175 2003-07-11  Darin Adler  <darin@apple.com>
5176
5177         Reviewed by Dave.
5178
5179         - added a function Dave needs for various work he's doing that goes
5180           from a document to the corresponding element in the parent document
5181
5182         * khtml/xml/dom_docimpl.h: Add ownerElement member function.
5183         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::ownerElement):
5184         Added. Gets to the parent part and finds the right element.
5185
5186 2003-07-11  Dave Hyatt  <hyatt@apple.com>
5187
5188         An initial implementation of the CSS opacity property.  Seems
5189         to work perfectly except for native widgetry (NSViews).  Images,
5190         text, borders, and underlines are all properly blended.
5191         
5192         Reviewed by rjw
5193
5194         * config.h:
5195         * khtml/css/cssparser.cpp:
5196         (CSSParser::parseValue):
5197         * khtml/css/cssproperties.c:
5198         (hash_prop):
5199         (findProp):
5200         * khtml/css/cssproperties.h:
5201         * khtml/css/cssproperties.in:
5202         * khtml/css/cssstyleselector.cpp:
5203         * khtml/rendering/render_block.h:
5204         * khtml/rendering/render_box.cpp:
5205         (RenderBox::setStyle):
5206         (RenderBox::adjustZIndex):
5207         * khtml/rendering/render_box.h:
5208         * khtml/rendering/render_inline.h:
5209         * khtml/rendering/render_layer.cpp:
5210         (RenderLayer::transparentAncestor):
5211         (RenderLayer::isTransparent):
5212         (commonTransparentAncestor):
5213         (RenderLayer::updateTransparentState):
5214         (RenderLayer::beginTransparencyLayers):
5215         (RenderLayer::endTransparencyLayers):
5216         (RenderLayer::paint):
5217         * khtml/rendering/render_layer.h:
5218         * khtml/rendering/render_object.h:
5219         * khtml/rendering/render_style.cpp:
5220         (StyleVisualData::StyleVisualData):
5221         (RenderStyle::diff):
5222         * khtml/rendering/render_style.h:
5223         * kwq/KWQPainter.h:
5224         * kwq/KWQPainter.mm:
5225         (QPainter::beginTransparencyLayer):
5226         (QPainter::endTransparencyLayer):
5227
5228 2003-07-11  Darin Adler  <darin@apple.com>
5229
5230         Reviewed by Chris.
5231
5232         - fixed 3305391 -- repro crash in QPixmap::QPixmap after click in SVG using Adobe SVG plugin
5233
5234         * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Remove code that tried to determine
5235         if something is an image by looking at the node type. Instead look at the object in the render
5236         tree and ask it if it's an image. Also use logic that exactly matches what RenderImage uses.
5237
5238         * kwq/KWQDOMNode.h: Remove unused isImage function.
5239         * kwq/KWQDOMNode.cpp: Ditto.
5240
5241 2003-07-11  Darin Adler  <darin@apple.com>
5242
5243         Reviewed by Ken.
5244
5245         - fixed 3300220 -- repro crash in closeURL when choosing from popup menus on www.drivewire.com
5246
5247         * khtml/xml/dom_nodeimpl.cpp:
5248         (NodeImpl::dispatchGenericEvent): Removed unused local variable. Since we update all documents,
5249         there was no longer any need to keep that pointer around, but we still had this obsolete code.
5250         This had nothing to do with the bug, just a related cleanup.
5251         (NodeImpl::dispatchWindowEvent): Add check for nil. We ref the document pointer, but we don't
5252         ref the document itself. So we do need to check for the case where the document went away.
5253
5254 2003-07-10  Darin Adler  <darin@apple.com>
5255
5256         Reviewed by Maciej.
5257
5258         - fixed 3217731 -- after going back to a page, forms are submitted with the wrong encoding (back/forward cache)
5259
5260         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::openURLFromPageCache): Put decoder from document into the part.
5261
5262 === Safari-89 ===
5263
5264 2003-07-10  Maciej Stachowiak  <mjs@apple.com>
5265
5266         Reviewed by Darin.
5267
5268         - fixed 3302021 - v74 and v85 hang with http://e-www.motorola.com/
5269         - fixed a bug with saving and restoring location object properties
5270         
5271         * kwq/KWQKHTMLPart.h:
5272         * kwq/KWQKHTMLPart.mm:
5273         (KWQKHTMLPart::saveLocationProperties): Save the location object's properties, not
5274         the window's (!)
5275         (KWQKHTMLPart::saveInterpreterBuiltins): New function to save builtin properties of
5276         the interpeter.
5277         (KWQKHTMLPart::restoreInterpreterBuiltins): Similarly to restore them.
5278         (KWQKHTMLPart::openURLFromPageCache): Restore interpreter builtins too.
5279         * kwq/KWQPageState.h:
5280         * kwq/KWQPageState.mm:
5281         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:interpreterBuiltins:]): Handle interpreter builtins.
5282         (-[KWQPageState invalidate]): Likewise.
5283         (-[KWQPageState dealloc]): Likewise.
5284         (-[KWQPageState interpreterBuiltins]): New method.
5285         * kwq/WebCoreBridge.mm:
5286         (-[WebCoreBridge saveDocumentToPageCache]): Handle interpeter builtins.
5287
5288 2003-07-10  Darin Adler  <darin@apple.com>
5289
5290         Reviewed by Chris.
5291
5292         * config.h: Check in newly generated version which has changed due to changes
5293         in configure.in.
5294
5295 2003-07-10  Darin Adler  <darin@apple.com>
5296
5297         Reviewed by Chris.
5298
5299         - fixed 3317693 -- REGRESSION: many web pages are rendering with wrong layout (columns in HelpViewer, etc.)
5300
5301         This is a workaround for the code generation bug in gcc that causes this problem with
5302         gcc 3.3 in optimized builds. We can remove it once both we and B&I are using a newer
5303         gcc with the fix. The bug number for the gcc problem is 3321716.
5304
5305         * khtml/rendering/render_box.cpp:
5306         (workAroundBug3321716): Added. A function that does nothing and takes an integer parameter.
5307         (RenderBox::setStyle): Add a couple of calls to workAroundBug3321716 in the right places.
5308
5309 2003-07-09  Richard Williamson   <rjw@apple.com>
5310
5311         Fixed 3141257.  Animate multiple copies of the same
5312         image on the same page.
5313
5314         Reviewed by hyatt.
5315
5316         * khtml/rendering/render_replaced.cpp:
5317         (RenderReplaced::paint):
5318         * kwq/KWQPixmap.mm:
5319         (QPixmap::operator=):
5320         * kwq/WebCoreImageRenderer.h:
5321
5322 2003-07-08  Darin Adler  <darin@apple.com>
5323
5324         Reviewed by John.
5325
5326         - removed Jaguar-specific code
5327
5328         * kwq/KWQComboBox.mm: Remove fudge factor used to move text down and work
5329         around problem where pop-up menu text draws too high, bug 3030474.
5330
5331         * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUsingTEC): Remove hack used
5332         to work around the lack of TECSetBasicOptions in Jaguar, bug 3201405.
5333
5334         * config.h: The people with Foundation source trees slug it out with the people
5335         without Foundation trees, as one line of this file changes back and forth.
5336
5337 2003-07-08  Dave Hyatt  <hyatt@apple.com>
5338
5339         Make sure that the contents width and height of the view are
5340         used as the root height and width when a view exists.  This
5341         ensures that the root element background properly tiles over 
5342         the entire height of the document.  (This used to be ensured
5343         by growing the height of the <html> element, but that violates
5344         the CSS2 spec.)
5345
5346         This fixes bugs 3317809, 3299789, and 3318066.
5347         
5348         Reviewed by john
5349
5350         * khtml/rendering/render_box.cpp:
5351         (RenderBox::paintRootBoxDecorations):
5352
5353 2003-07-08  Chris Blumenberg  <cblu@apple.com>
5354
5355         * WebCore.pbproj/project.pbxproj: Xcode-ified
5356         * khtml/html/htmltokenizer.cpp:
5357         (HTMLTokenizer::parseTag): fulfilled promise to Darin that I would add a comment about using tolower() instead of | 0x20
5358
5359 2003-07-08  Chris Blumenberg  <cblu@apple.com>
5360
5361         Fixed: <rdar://problem/3272398>: Safari strips/modifies underscores in EMBED tags
5362
5363         Reviewed by darin.
5364
5365         * khtml/html/htmltokenizer.cpp:
5366         (HTMLTokenizer::parseTag): use tolower() to lowercase a char, don't use | 0x20 because that will cause chars like '_' to turn into junk
5367
5368 2003-07-08  Dave Hyatt  <hyatt@apple.com>
5369
5370         Implementation of inline-block and a prototype of the XUL
5371         box model.
5372
5373         Fix for min-font size issues that prevented us from having
5374         a min font size.  The primary fix is to store the original
5375         specified CSS size as a separate value (distinct from the
5376         computed rendering size).  This allows that size to be computed
5377         without the application of integer rounding or zoom factors
5378         or minimum font size corrections.
5379
5380         Fix for table crasher, bug #3296552.
5381
5382         Reviewed by john (table crasher, inline-block, XUL box model) and
5383         darin (font size fixes).
5384
5385         * WebCore.pbproj/project.pbxproj:
5386         * khtml/css/css_valueimpl.cpp:
5387         (CSSPrimitiveValueImpl::computeLength):
5388         (CSSPrimitiveValueImpl::computeLengthFloat):
5389         * khtml/css/css_valueimpl.h:
5390         * khtml/css/cssparser.cpp:
5391         (CSSParser::parseValue):
5392         * khtml/css/cssproperties.c:
5393         (hash_prop):
5394         (findProp):
5395         * khtml/css/cssproperties.h:
5396         * khtml/css/cssproperties.in:
5397         * khtml/css/cssstyleselector.cpp:
5398         * khtml/css/cssstyleselector.h:
5399         * khtml/css/cssvalues.c:
5400         (hash_val):
5401         (findValue):
5402         * khtml/css/cssvalues.h:
5403         * khtml/css/cssvalues.in:
5404         * khtml/khtml_part.cpp:
5405         (KHTMLPart::setZoomFactor):
5406         * khtml/khtmlview.cpp:
5407         (KHTMLView::print):
5408         * khtml/rendering/bidi.cpp:
5409         * khtml/rendering/font.cpp:
5410         (Font::update):
5411         * khtml/rendering/font.h:
5412         * khtml/rendering/render_block.cpp:
5413         * khtml/rendering/render_block.h:
5414         * khtml/rendering/render_box.cpp:
5415         (RenderBox::setStyle):
5416         (RenderBox::contentHeight):
5417         (RenderBox::containingBlockWidth):
5418         (RenderBox::calcWidth):
5419         (RenderBox::calcHeight):
5420         * khtml/rendering/render_container.cpp:
5421         (RenderContainer::addChild):
5422         * khtml/rendering/render_flexbox.cpp: Added.
5423         * khtml/rendering/render_flexbox.h: Added.
5424         * khtml/rendering/render_object.cpp:
5425         (RenderObject::createObject):
5426         (RenderObject::sizesToMaxWidth):
5427         (RenderObject::handleDynamicFloatPositionChange):
5428         * khtml/rendering/render_object.h:
5429         * khtml/rendering/render_replaced.cpp:
5430         (RenderReplaced::paint):
5431         * khtml/rendering/render_style.cpp:
5432         (StyleFlexibleBoxData::StyleFlexibleBoxData):
5433         (StyleFlexibleBoxData::operator==):
5434         (RenderStyle::RenderStyle):
5435         (RenderStyle::operator==):
5436         (RenderStyle::diff):
5437         * khtml/rendering/render_style.h:
5438         * khtml/rendering/table_layout.cpp:
5439         (FixedTableLayout::calcWidthArray):
5440         * khtml/xml/dom_docimpl.cpp:
5441         (DocumentImpl::recalcStyle):
5442         (DocumentImpl::attach):
5443
5444 2003-07-07  Maciej Stachowiak  <mjs@apple.com>
5445
5446         Reviewed by John.
5447
5448         - fixed 3295916 - b/c JavaScriptCore and WebCore are installing in wrong location, private headers are public
5449
5450         * WebCore.pbproj/project.pbxproj: Install in WebKit.framework/Versions/A/Frameworks.
5451
5452 === Safari-88 ===
5453
5454 2003-07-03  John Sullivan  <sullivan@apple.com>
5455
5456         - fixed 3167770 -- visited and unvisited link colors are too 
5457         close in default stylesheet
5458         - fixed 3315344 -- default active link color should be red as
5459         in other browsers
5460
5461         Reviewed by Hyatt
5462
5463         * khtml/css/html4.css:
5464         Changed a:link and a:visited colors to match Mozilla
5465         (a slightly lighter blue for link, and a purpley shade instead
5466         of navy for visited). Also changed a:link:active and 
5467         a:visited:active to be red instead of black.
5468
5469 2003-07-03  Darin Adler  <darin@apple.com>
5470
5471         Reviewed by Ken.
5472
5473         * khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::parseAttribute):
5474         Remove livepage.apple.com hack since the site has been changed.
5475
5476 2003-07-02  Darin Adler  <darin@apple.com>
5477
5478         Rolled out accidentally-checked-in changes.
5479
5480         * kwq/KWQCharsetData.c:
5481         * kwq/KWQCharsets.mm:
5482         * kwq/KWQTextArea.mm:
5483         * kwq/mac-encodings.txt:
5484         * kwq/make-charset-table.pl:
5485
5486 2003-07-02  Darin Adler  <darin@apple.com>
5487
5488         Reviewed by Ken.
5489
5490         - fixed 3299715 -- unrepro nil-deref in KHTMLPart::xmlDocImpl handling timer
5491
5492         * khtml/khtmlview.cpp: (KHTMLView::timerEvent): Add check for nil.
5493
5494         - fixed clean builds
5495
5496         * Makefile.am: Delete the config-timestamp.
5497
5498         - added some other nil checks (perhaps inspired by some other bug reports, I can't remember)
5499
5500         * khtml/html/html_inlineimpl.cpp: (HTMLAnchorElementImpl::defaultEventHandler):
5501         Added a check for nil document or nil view.
5502         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::dispatchEvent): ref/deref view for safety.
5503
5504 2003-07-02  Ken Kocienda  <kocienda@apple.com>
5505
5506         Reviewed by David
5507
5508         Fix some more build problems with warnings being issued
5509         when casting and calling methods.
5510
5511         * kwq/KWQScrollView.mm:
5512         (QScrollView::addChild):
5513         (QScrollView::resizeContents):
5514         (QScrollView::repaintContents):
5515
5516 2003-07-01  Ken Kocienda  <kocienda@apple.com>
5517
5518         Reviewed by Darin
5519
5520         A host of changes to work around a compiler bug which issues
5521         warnings when making objective-c method calls on objects that have 
5522         been typecast for the purpose of the call.
5523
5524         * WebCore.pbproj/project.pbxproj:
5525         * kwq/KWQFileButton.mm:
5526         (KWQFileButton::setFilename):
5527         (KWQFileButton::sizeForCharacterWidth):
5528         (KWQFileButton::frameGeometry):
5529         (KWQFileButton::setFrameGeometry):
5530         (KWQFileButton::baselinePosition):
5531         (KWQFileButton::filenameChanged):
5532         * kwq/KWQKHTMLPart.mm:
5533         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
5534         * kwq/KWQLineEdit.mm:
5535         (QLineEdit::setAlignment):
5536         * kwq/KWQListBox.mm:
5537         (QListBox::~QListBox):
5538         (QListBox::clear):
5539         (QListBox::setSelectionMode):
5540         (QListBox::insertItem):
5541         (QListBox::endBatchInsert):
5542         (QListBox::setSelected):
5543         (QListBox::isSelected):
5544         (QListBox::sizeForNumberOfLines):
5545         * kwq/KWQTextEdit.mm:
5546         (QTextEdit::setAlignment):
5547         * kwq/WebCoreBridge.mm:
5548         (-[WebCoreBridge elementForView:]):
5549         (-[WebCoreBridge setSelectionFrom:startOffset:to:endOffset:]):
5550         (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]):
5551         * kwq/WebCoreDOMDocument.mm:
5552         (+[WebCoreDOMDocumentType documentTypeWithImpl:DOM::]):
5553         (+[WebCoreDOMImplementation implementionatWithImpl:DOM::]):
5554         (+[WebCoreDOMDocument documentWithImpl:DOM::]):
5555         (-[WebCoreDOMDocument importNode::]):
5556         * kwq/WebCoreDOMNode.mm:
5557         (+[WebCoreDOMNode nodeWithImpl:DOM::]):
5558         (-[WebCoreDOMNode insert:before:]):
5559         (-[WebCoreDOMNode replace:child:]):
5560         (-[WebCoreDOMNode removeChild:]):
5561         (+[WebCoreDOMNodeList nodeListWithImpl:DOM::]):
5562         (+[WebCoreDOMNamedNodeMap namedNodeMapWithImpl:DOM::]):
5563         (-[WebCoreDOMNamedNodeMap setNamedItem:]):
5564         (+[WebCoreDOMAttr attrWithImpl:DOM::]):
5565         (+[WebCoreDOMDocumentFragment documentFragmentWithImpl:DOM::]):
5566         (+[WebCoreDOMElement elementWithImpl:DOM::]):
5567         (+[WebCoreDOMEntityReference entityReferenceWithImpl:DOM::]):
5568         (+[WebCoreDOMCharacterData commentWithImpl:DOM::]):
5569         (+[WebCoreDOMComment commentWithImpl:DOM::]):
5570         (+[WebCoreDOMText textWithImpl:DOM::]):
5571         (+[WebCoreDOMCDATASection CDATASectionWithImpl:DOM::]):
5572         (+[WebCoreDOMProcessingInstruction processingInstructionWithImpl:DOM::]):
5573
5574 2003-06-30  Chris Blumenberg  <cblu@apple.com>
5575
5576         Fixed: <rdar://problem/3310066>: All images use wrong map if page has image map of name ""
5577
5578         Reviewed by dave.
5579
5580         * config.h:
5581         * khtml/html/html_documentimpl.cpp:
5582         (HTMLDocumentImpl::getMap): return 0 if getMap is called with a NULL string instead of treating it like an empty string
5583
5584 2003-06-30  John Sullivan  <sullivan@apple.com>
5585
5586         - fixed gcc3.3 incompatibility
5587
5588         Reviewed by Darin
5589
5590         * kwq/KWQComboBox.mm:
5591         (QComboBox::updateCurrentItem):
5592         cast result of getView() in a local variable to work around
5593         compiler bug where casting in a method call doesn't work (all other
5594         callers of getView() in this file were already using a local
5595         variable)
5596
5597 2003-06-26  Chris Blumenberg  <cblu@apple.com>
5598
5599         More changes to make WebKit and WebCore compile with gcc 3.3.
5600
5601         Reviewed by darin.
5602
5603         * kwq/WebCoreBridge.h:
5604
5605 2003-06-26  Chris Blumenberg  <cblu@apple.com>
5606
5607         Made WebCore compile with gcc 3.3.
5608
5609         Reviewed by darin.
5610
5611         * config.h:
5612         * kwq/KWQLineEdit.mm:
5613         (QLineEdit::selectAll):
5614         (QLineEdit::setEdited):
5615         * kwq/KWQString.h:
5616         * kwq/KWQString.mm:
5617
5618 === Safari-85.1 ===
5619
5620 2003-06-15  Vicki Murley  <vicki@apple.com>
5621
5622         Reviewed by darin.
5623
5624         * WebCore.pbproj/project.pbxproj: remove SECTORDER_FLAGS variable, so that we don't use order file for our Panther submission
5625
5626 === Safari-85 ===
5627
5628 2003-06-14  Chris Blumenberg  <cblu@apple.com>
5629
5630         Fixed: <rdar://problem/3293367>: REGRESSION (83-84): nil-deref in addMetaData loading page in pop-up at live365.com
5631
5632         Reviewed by darin.
5633
5634         * kwq/WebCoreBridge.mm:
5635         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]): only call addMetaData if didOpenURL
5636
5637 2003-06-13  Darin Adler  <darin@apple.com>
5638
5639         Reviewed by Don.
5640
5641         - fixed 3293031 -- REGRESSION (83-84): extra entry in history when going to page that redirects (live365.com)
5642
5643         * khtml/khtmlpart_p.h: Initialize m_executingJavaScriptFormAction to false.
5644         We had left it uninitialized when we fixed 3289047.
5645
5646 2003-06-13  David Hyatt  <hyatt@apple.com>
5647
5648         Fix for 3292630, misrendered page because of bad doctype.  Add
5649         this bad doctype to our list of quirky doctypes to fix the
5650         problem, since the screwed up strict mode rendering is actually
5651         correct.
5652         
5653         Reviewed by john
5654
5655         * khtml/html/doctypes.cpp:
5656         (findDoctypeEntry):
5657         * khtml/html/doctypes.gperf:
5658
5659 2003-06-13  Richard Williamson  <rjw@apple.com>
5660
5661         Fixed 3282087.  Don't use our <pre> optimizations
5662         if text contains non-ascii, and consequently may
5663         result in font substitution.
5664
5665         Reviewed by Darin.
5666
5667         * khtml/rendering/render_text.cpp:
5668         (RenderText::RenderText):
5669         (RenderText::allAscii):
5670         (RenderText::shouldUseMonospaceCache):
5671         * khtml/rendering/render_text.h:
5672
5673 2003-06-13  Richard Williamson  <rjw@apple.com>
5674
5675         Fixed 3291537.
5676         Reviewed by John.
5677
5678         * kwq/KWQObject.mm:
5679         (QObject::killTimer):
5680         Only remove the timer is it hasn't fired (and is therefore valid).
5681         It is NOT permissible to reference a timer's userInfo if it is invalid.
5682
5683 === Safari-84 ===
5684
5685 2003-06-12  David Hyatt  <hyatt@apple.com>
5686
5687         Fix for 3289113, body.scrollTop doesn't return the right
5688         value.  Fix scrollLeft and scrollTop for body tags to just
5689         use the view's offset.  This matches WinIE behavior.
5690         
5691         Reviewed by john
5692
5693         * khtml/ecma/kjs_html.cpp:
5694         (KJS::HTMLElement::getValueProperty):
5695         (KJS::HTMLElement::putValue):
5696         * khtml/ecma/kjs_html.h:
5697         * khtml/ecma/kjs_html.lut.h:
5698
5699 2003-06-12  Darin Adler  <darin@apple.com>
5700
5701         Reviewed by John.
5702
5703         - fixed 3289405 -- repro crash in KWQPopUpButtonCell at umax.de
5704
5705         * kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
5706         Use the bridge that we got earlier in the function to find the right part. This is
5707         simpler, and more reliable. The old way would run into trouble if the widget or
5708         any of the other objects in the chain got destroyed during the event handling.
5709
5710 2003-06-12  Darin Adler  <darin@apple.com>
5711
5712         Fixed by Richard, reviewed by me.
5713
5714         - fixed 3289047 -- REGRESSION: can't go back after using form at attwireless.com
5715
5716         * khtml/khtmlpart_p.h: Add an "executing JavaScript form action" flag.
5717         * kwq/WebCoreBridge.h: Add an "executing JavaScript form action" flag parameter to
5718         the reportClientRedirectToURL method.
5719
5720         * khtml/khtml_part.cpp: (KHTMLPart::submitForm): In the JavaScript case, set a
5721         flag to say we are executing a JavaScript form action.
5722         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::redirectionTimerStartedOrStopped): Pass the
5723         isJavaScriptFormAction state over the bridge.
5724
5725 2003-06-11  David Hyatt  <hyatt@apple.com>
5726
5727         Fix for 3288875, :after/:before content not getting destroyed
5728         after printing on alistapart.com.  Make the update method for
5729         pseudos smart enough to destroy generated content when it is
5730         no longer needed.
5731         
5732         Reviewed by darin
5733
5734         * khtml/rendering/render_block.cpp:
5735         (RenderBlock::setStyle);
5736         * khtml/rendering/render_container.cpp:
5737         (RenderContainer::updatePseudoChild):
5738         * khtml/rendering/render_container.h:
5739         * khtml/rendering/render_inline.cpp:
5740         (RenderInline::setStyle):
5741
5742 2003-06-11  David Hyatt  <hyatt@apple.com>
5743
5744         Fix for 3288035, the wrong value was being filled in for
5745         textfields.  Fixed a bug in QString's assignment operator
5746         that made empty strings become null strings upon assignment.
5747         Also ensured that the form control never sets the value to
5748         null but always uses empty instead.
5749         
5750         Reviewed by john
5751
5752         * khtml/rendering/render_form.cpp:
5753         (RenderLineEdit::slotTextChanged):
5754         * kwq/KWQString.mm:
5755         (QString::setLatin1):
5756
5757 2003-06-10  David Hyatt  <hyatt@apple.com>
5758
5759         Fix for 3287870, the <embed hidden=true> feature didn't work.
5760         hidden should turn the embed into a plugin with a width and
5761         height of 0.
5762         
5763         Reviewed by gramps
5764
5765         * khtml/html/html_objectimpl.cpp:
5766         (HTMLEmbedElementImpl::HTMLEmbedElementImpl):
5767         (HTMLEmbedElementImpl::attach):
5768         
5769 2003-06-10  Darin Adler  <darin@apple.com>
5770
5771         Reviewed by John.
5772
5773         - fixed 3285820 -- REGRESSION: iframe set up with innerHTML shows up empty (discovered at www.kbs.co.kr)
5774
5775         * kwq/KWQKHTMLPart.mm: (KHTMLPart::frameDetached): Remove the frame from the parent's
5776         m_frames list so it's not accidentally reused, since our naming scheme gives frames in
5777         the same place in the scheme of things the same name.
5778
5779 2003-06-10  David Hyatt  <hyatt@apple.com>
5780
5781         Fix for 3270813, crash in the code for the CSS content property.
5782         When copying a DOMString, I missed a required ref.
5783         
5784         Reviewed by darin
5785
5786         * khtml/rendering/render_style.cpp:
5787         (RenderStyle::setContent):
5788
5789 2003-06-10  Darin Adler  <darin@apple.com>
5790
5791         Reviewed by John.
5792
5793         - fixed 3285120 -- crash in CSSParser::parseColor (originally seen with Panther Mail while indexing)
5794
5795         * khtml/css/parser.y: Moved DIMEN rule out of unary_term, needed because a term production
5796         assumes that the values that come out of unary_term are all fValue, not string.
5797         * khtml/css/parser.cpp: Regenerated.
5798
5799 2003-06-10  Vicki Murley  <vicki@apple.com>
5800
5801         Reviewed by john.
5802
5803         * WebCore.order: new order file for 1.0
5804
5805 2003-06-10  Darin Adler  <darin@apple.com>
5806
5807         Reviewed by Don.
5808
5809         - fixed 3286343 -- REGRESSION: crashing on pages with text area elements
5810
5811         * khtml/rendering/render_form.cpp: (RenderTextArea::detach):
5812         Do cleanup in detach rather than in destructor.
5813         * khtml/rendering/render_form.h: Remove destructor, add detach.
5814
5815 2003-06-09  Richard Williamson  <rjw@apple.com>
5816
5817         Fixed 3281761.
5818         This was a real doozie.  It boiled down to a frame
5819         attempting to access a siblings window object when that
5820         frame wasn't loaded and didn't have a document.
5821
5822         Reviewed by Dave.
5823
5824         * khtml/ecma/kjs_window.cpp:
5825         (Window::get):
5826         (Window::isSafeScript):
5827         (FrameArray::get):
5828         Made the isSafeScript more tolerant.  Always allow JS to execute
5829         if the active domain is nil (local).  Also allow JS to execute
5830         if the target part has no document yet.
5831
5832         * khtml/khtml_part.cpp:
5833         (KHTMLPart::init):
5834         (KHTMLPart::openURL):
5835         (KHTMLPart::jScript):
5836         (KHTMLPart::scheduleRedirection):
5837         (KHTMLPart::findFrame):
5838         Flag redirects during load so we can later avoid
5839         cancelling the redirect when the document would otherwise
5840         normally load.
5841
5842         * khtml/khtmlpart_p.h:
5843         * kwq/WebCoreBridge.mm:
5844         (-[WebCoreBridge addData:]):
5845         Document may now be nil.  Replace assert with conditional check.
5846
5847 2003-06-09  John Sullivan  <sullivan@apple.com>
5848
5849         - finished fixing crash in 3275675 -- REGRESSION: crash when replacing <div> which contains iframe (at www.kbs.co.kr)
5850
5851         Reviewed by Darin
5852
5853         * khtml/rendering/render_replaced.cpp:
5854         (RenderWidget::resizeWidget):
5855         check for nil element() before ref/deref'ing
5856
5857 2003-06-09  Darin Adler  <darin@apple.com>
5858
5859         Reviewed by John.
5860
5861         - first step in fixing 3275675 -- REGRESSION: crash when replacing <div> which contains iframe (at www.kbs.co.kr)
5862
5863         * khtml/rendering/render_object.h: Made m_node protected, so RenderWidget can zero it out.
5864         * khtml/rendering/render_replaced.cpp: (RenderWidget::detach): Set m_node to 0 here.
5865         RenderWidget does this strange thing of staying around after the DOM node is gone, but we need
5866         to get rid of the dangling pointer to the DOM node.
5867
5868         * khtml/rendering/render_frames.cpp:
5869         (RenderFrame::slotViewCleared): Do nothing if element() is 0, since we are on our way out anyway.
5870         (RenderPartObject::slotViewCleared): Ditto.
5871
5872 2003-06-09  John Sullivan  <sullivan@apple.com>
5873
5874         - fixed 3284312 -- repro nil-deref in 
5875         khtml::RenderTable::cellAbove at pi.nersc.gov
5876
5877         Reviewed by Darin
5878
5879         * khtml/rendering/render_table.cpp:
5880         (RenderTable::cellAbove):
5881         When the section had 0 rows, we were trying to index the -1st
5882         row. Fixed by falling into the "didn't find anything" case when
5883         the row we're going to look in is < 0.
5884
5885 2003-06-09  Darin Adler  <darin@apple.com>
5886
5887         Reviewed by John.
5888
5889         - fixed 3277733 -- REGRESSION: \ in JavaScript mishandled when encoding is Japanese (istweb.apple.com)
5890         
5891         This is the third time I've fixed handling of backslash and yen sign. Each time I fixed part
5892         of the problem but either didn't fix the whole thing or caused a regression. This time I did
5893         more experiments with other browsers, and I came to the conclusion that all other browsers keep
5894         the backslash character internally unchanged, and only change to the yen sign when displaying
5895         rather than decoding to the Unicode "yen sign" character. This makes the backslash character
5896         different from any other, and requires special code, but it's the only way to match the other
5897         browsers' behavior. This seems to work great; I retested all the backslash/yen bugs from the
5898         past to make sure I didn't cause new regressions. The only loose end is the DOM API. It's not
5899         clear whether the DOM API should return the strings with backslashes or with yen signs, but
5900         we can probably ship 1.0 without getting that 100% right.
5901
5902         * kwq/KWQTextCodec.h: Added backslashAsCurrencySymbol() member function.
5903         * kwq/KWQTextCodec.mm:
5904         (QTextCodec::fromUnicode): Removed the old workaround for tilde problems, which is not needed
5905         now that we are back to using "force ASCII" mode, so tildes are always tildes. Updated the comment
5906         about the backslash hack to better reflect the new situation and change it to use the new
5907         backslashAsCurrencySymbol() member function.
5908         (QTextCodec::backslashAsCurrencySymbol): Added. Returns the yen sign for the encodings where
5909         it's appropriate. Later might do the same thing with the won sign for Korean, depending on what
5910         we discover as we research bug 3221037 (Korean currency symbol should replace backslash).
5911         (KWQTextDecoder::convertUsingTEC): Add back the call to TECSetBasicOptions since we once-again
5912         want to use force-ASCII mode; we turn backslashes into yen signs at a higher level now; internally
5913         they are kept as backslashes.
5914
5915         * khtml/xml/dom_docimpl.h: Made setDecoder no longer be inline, and added a decoder member
5916         function so callers could get the decoder (they need it to figure out what to do with
5917         backslashes).
5918         * khtml/xml/dom_docimpl.cpp:
5919         (DocumentImpl::setDecoder): Made this no longer be an inline. Also made sure it derefs the
5920         existing decoder. This probably does not happen in practice, but the old version would leak
5921         if it was ever called twice on the same document.
5922
5923         * kwq/KWQString.mm: (QString::replace): Made sure that the case of replacing a character
5924         with the same character has an early out, since that's now the common case with this
5925         "map backslash to currency character if needed" feature.
5926
5927         * khtml/xml/dom_stringimpl.h: Made capitalize() const and added a new replace() member function.
5928         * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::replace): Implemented this new function
5929         that replaces one character with another. Returns the existing string if there is no replacing
5930         to do, otherwise makes a new one.
5931
5932         * khtml/rendering/render_object.h: Added backslashAsCurrencySymbol() member function.
5933         * khtml/rendering/render_object.cpp: (RenderObject::backslashAsCurrencySymbol): Added.
5934         Helper function so render objects have an easier time digging for the "do I need to turn
5935         the backslashes into currency symbols" flag.
5936
5937         * kwq/KWQKHTMLPart.h: Added backslashAsCurrencySymbol() member function.
5938         * kwq/KWQKHTMLPart.mm:
5939         (KWQKHTMLPart::setTitle): Convert title to use yen sign.
5940         (KWQKHTMLPart::setStatusBarText): Convert status bar text to use yen sign.
5941         (KWQKHTMLPart::runJavaScriptAlert): Convert message text to use yen sign.
5942         (KWQKHTMLPart::runJavaScriptConfirm): Convert message text to use yen sign.
5943         (KWQKHTMLPart::runJavaScriptPrompt): Convert message text and default value to use yen sign,
5944         convert result back from yen sign to backslash.
5945         (KWQKHTMLPart::attributedString): Convert pieces of text to use yen sign when building up
5946         the attributed text.
5947         (KWQKHTMLPart::backslashAsCurrencySymbol): Added.
5948         Helper function so render objects have an easier time digging for the "do I need to turn
5949         the backslashes into currency symbols" flag.
5950
5951         * kwq/WebCoreBridge.mm:
5952         (-[WebCoreBridge selectedString]): Convert text to use yen sign before returning to WebKit.
5953         (-[WebCoreBridge elementAtPoint:]): Convert title and alt strings to use yen sign before
5954         returning them to WebKit.
5955
5956         * khtml/rendering/render_form.cpp:
5957         (RenderSubmitButton::rawText): Convert button label to use yen sign.
5958         (RenderLineEdit::updateFromElement): Convert text for line edit to use yen sign.
5959         (RenderLineEdit::slotTextChanged): Convert yen sign to backslash on the way in from line edit.
5960         (RenderSelect::updateFromElement): Convert text for select items to use yen sign.
5961         (RenderTextArea::updateFromElement): Convert text for text areas to use yen sign.
5962         (RenderTextArea::text): Convert yen sign to backslash on the way in from text area.
5963         * khtml/rendering/render_image.cpp:
5964         (RenderImage::paintObject): Convert alt text to use yen sign before drawing it.
5965         * khtml/rendering/render_text.cpp:
5966         (RenderText::RenderText): Convert text to use yen sign before drawing it.
5967         (RenderText::setText): Ditto.
5968
5969         - fix a problem that was bugging the shit out of me where we kept rebuilding config.h
5970
5971         * Makefile.am: Use the config-timestamp file to decide when to remake config.h so
5972         we don't end up making it over and over again. Also don't bother to grep out NO_LICENSE
5973         any more since that's long gone.
5974         * .cvsignore: Ignore the config-timestamp file.
5975
5976 === Safari-83 ===
5977
5978 2003-06-09  Darin Adler  <darin@apple.com>
5979
5980         Reviewed by Dave.
5981
5982         - fixed 3280538 -- JavaScript infinite loop loading frame b/c scrollHeight is always zero (easons.ie)
5983
5984         * khtml/xml/dom_docimpl.h: Added updateLayout method.
5985         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::updateLayout): Added. Code moved here
5986         from KJS::Window::updateLayout so it can be shared. Named this updateLayout() to match
5987         the name from KJS::Window.
5988
5989         * khtml/ecma/kjs_window.cpp: (Window::updateLayout): Call updateLayout()
5990         instead of updateRendering(); the extra logic here was moved into updateLayout().
5991         * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty): Ditto.
5992
5993         * khtml/ecma/kjs_html.cpp: (KJS::HTMLElement::getValueProperty): Call updateLayout()
5994         on the document before computing the BodyScrollHeight or BodyScrollWidth, much as
5995         we already do in kjs_dom.cpp for ScrollHeight and ScrollWidth and other properties.
5996
5997 2003-06-05  David Hyatt  <hyatt@apple.com>
5998
5999         Fix for crash on an XHTML frameset page.  It was assuming
6000         that all docs were HTML. The bug # is 3277973.
6001         
6002         Reviewed by john
6003
6004         * kwq/KWQKHTMLPart.mm:
6005         (KWQKHTMLPart::updatePolicyBaseURL):
6006         (KWQKHTMLPart::setPolicyBaseURL):
6007
6008 2003-06-05  David Hyatt  <hyatt@apple.com>
6009
6010         Fix for 3281030, stylesheets can't be enabled properly via
6011         script.  Test case from Dirk.  The fix is to make the setting
6012         of the state happen independently of the attribute setting.
6013         
6014         Reviewed by john
6015
6016         * khtml/dom/html_head.cpp:
6017         (HTMLLinkElement::setDisabled):
6018         * khtml/html/html_headimpl.cpp:
6019         (HTMLLinkElementImpl::setDisabledState):
6020         (HTMLLinkElementImpl::parseAttribute):
6021         * khtml/html/html_headimpl.h:
6022
6023 2003-06-05  Chris Blumenberg  <cblu@apple.com>
6024
6025         Fixed: <rdar://problem/3268751>: REGRESSION: crash in KWQValueListImpl selecting connection speed at news.com
6026
6027         Reviewed by darin.
6028
6029         * kwq/KWQButton.mm:
6030         (QButton::clicked): Don't call clicked if the button was destroyed inside of sendConsumedMouseUpIfNeeded.
6031
6032 2003-06-05  Darin Adler  <darin@apple.com>
6033
6034         Reviewed by John.
6035
6036         - fixed 3279206 -- REGRESSION: new page does not load after selecting item from list and hitting 'Go' button
6037
6038         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::encoding): Use value() in a couple of places
6039         that were still directly using m_value.
6040
6041 2003-06-05  Darin Adler  <darin@apple.com>
6042
6043         Reviewed by John.
6044
6045         - fixed 3278079 -- REGRESSION: UTF-8 page claiming to be UTF-16 in XML header gives garbage characters
6046
6047         * khtml/misc/decoder.cpp: (Decoder::setEncoding): Add EncodingFromXMLHeader as one of the
6048         types where we know the encoding is an 8-bit one. The reason this is a regression is that we
6049         used to ignore the encoding in the XML header altogether.
6050
6051 2003-06-04  John Sullivan  <sullivan@apple.com>
6052
6053         - fixed 3279957 -- REGRESSION: assertion failure at launch in 
6054         Decoder::~Decoder() importing bookmarks
6055
6056         Richard actually wrote this fix.
6057         Reviewed by me, Darin
6058
6059         * kwq/WebCoreEncodings.mm:
6060         (+[WebCoreEncodings decodeData:]):
6061         don't use stack-based decoder; use new instead. 
6062
6063 2003-06-04  David Hyatt  <hyatt@apple.com>
6064
6065         Fix for 3273300, leaks in cssyyparse.  Function forgot to delete
6066         its args value list when destroyed.
6067         
6068         Reviewed by gramps
6069
6070         * khtml/css/cssparser.h:
6071
6072 2003-06-03  David Hyatt  <hyatt@apple.com>
6073
6074         Fix for 3259647, crash when printing a table page.  This is fixed
6075         on the KDE KHTML trunk.  The loop shouldn't be broken out of
6076         when you have column elements so that all sections can recalc
6077         their cell grids as needed.
6078         
6079         Reviewed by kocienda
6080
6081         * khtml/rendering/render_table.cpp:
6082         (RenderTable::recalcSections):
6083
6084 === Safari-82 ===
6085
6086 2003-06-03  Richard Williamson   <rjw@apple.com>
6087
6088         Fixed 3275565.  Ref count the decoder.
6089
6090         Reviewed by Ken.
6091
6092         * khtml/khtml_part.cpp:
6093         (KHTMLPart::clear):
6094         * khtml/misc/decoder.cpp:
6095         (Decoder::Decoder):
6096         (Decoder::~Decoder):
6097         * khtml/misc/decoder.h:
6098         * khtml/xml/dom_docimpl.cpp:
6099         (DocumentImpl::~DocumentImpl):
6100         * khtml/xml/dom_docimpl.h:
6101         
6102
6103 2003-06-02  David Hyatt  <hyatt@apple.com>
6104
6105         Fix for 3276099.  value() was wrong for radio buttons.  Needed
6106         to get it from the attribute since I was no longer caching
6107         anything in m_value.
6108         
6109         Reviewed by kocienda
6110
6111         * khtml/html/html_formimpl.cpp:
6112         (HTMLInputElementImpl::value):
6113
6114 2003-06-02  Ken Kocienda  <kocienda@apple.com>
6115
6116         Code written by darin
6117         Reviewed by me
6118
6119         Fix for this bug:
6120
6121         <rdar://problem/3272162>: repro crash in khtml::CachedImage::checkNotify() on particular page
6122
6123         * khtml/ecma/kjs_html.cpp:
6124         (Image::putValue): ref onLoadListener when setting a value to onLoad
6125         (Image::~Image): deref onLoadListener when destructing the image.
6126
6127 2003-06-02  David Hyatt  <hyatt@apple.com>
6128
6129         Fix for 3263679, color: # doesn't parse.  Fix is to add an
6130         error-handling case for # by itself to parser.y.
6131         
6132         Reviewed by gramps/ken
6133
6134         * khtml/css/parser.cpp:
6135         * khtml/css/parser.y:
6136
6137 === Safari-81 ===
6138
6139 2003-06-02  Darin Adler  <darin@apple.com>
6140
6141         Reviewed by Ken.
6142
6143         - fixed 3256787 -- HOMEPAGE:\000 characters being added by Safarin in Form submission,
6144         causing an exception in property list parsing
6145
6146         * kwq/KWQTextCodec.mm: (QTextCodec::fromUnicode): Encode \ as 5C instead of 815F
6147         when encoding Shift-JIS. This should make the Apple Store work again. The only thing
6148         we lose is the ability to send an actual Shift-JIS backslash (815F), but I think that
6149         is almost never needed. In other browsers you can't even type a backslash in Shift-JIS.
6150
6151 2003-06-02  Ken Kocienda  <kocienda@apple.com>
6152
6153         * config.h:
6154
6155 2003-06-02  David Hyatt  <hyatt@apple.com>
6156
6157         Fix for 3275136.  Make sure that when the checked attribute
6158         is set dynamically (something we were ignoring before my previous
6159         patch) that we also properly update the radio button array in
6160         the document.
6161         
6162         Reviewed by gramps
6163
6164         * khtml/html/html_formimpl.cpp:
6165         (HTMLInputElementImpl::parseAttribute):
6166         (HTMLInputElementImpl::attach):
6167         (HTMLInputElementImpl::reset):
6168
6169 2003-05-30  Maciej Stachowiak  <mjs@apple.com>
6170
6171         Reviewed by Chris.
6172
6173         - fixed 3169067 - PEOPLESOFT: left frame missing; frame RenderRoot height and width are both zero
6174
6175         * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor): Update layout before scrolling.
6176
6177 2003-05-30  Maciej Stachowiak  <mjs@apple.com>
6178
6179         Reviewed by Ken.
6180
6181         - fixed 3273544 - REGRESSION: Page disappears at http://www.urban-advantage.com/
6182         
6183         * khtml/xml/dom_docimpl.cpp:
6184         (DocumentImpl::getElementById): Return null when the ID is the
6185         empty string. Otherwise we'll return the first element in the
6186         document, usually the top-level HTML element, which is wrong and
6187         does not match other browsers.
6188
6189 2003-05-30  Richard Williamson  <rjw@apple.com>
6190
6191         As part of some cleanup when fixing 3272516 changed use of
6192         @"" for cache keys to NSString declarations.
6193
6194         Reviewed by Ken.
6195
6196         * kwq/WebCoreBridge.mm:
6197         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
6198
6199 2003-05-30  David Hyatt  <hyatt@apple.com>
6200
6201         Fix for 3269129 and 3269220.  setAttribute('value') didn't work
6202         for inputs.  Basically defaultValue and defaultChecked have never
6203         worked.  This patch fixes the problem by making sure that for both
6204         value and checked you have a two-tier system where you look first
6205         for the value as altered by the control (or by setting the DOM
6206         property) and if that isn't set then you look at the default value.
6207
6208         This allows setAttribute (which changes the *default*) to work in
6209         the cases where the control has not overridden the default 
6210         with a different value.
6211         
6212         * khtml/html/html_formimpl.cpp:
6213         (HTMLInputElementImpl::HTMLInputElementImpl):
6214         (HTMLInputElementImpl::state):
6215         (HTMLInputElementImpl::parseAttribute):
6216         (HTMLInputElementImpl::attach):
6217         (HTMLInputElementImpl::reset):
6218         (HTMLInputElementImpl::setChecked):
6219         (HTMLInputElementImpl::value):
6220         (HTMLInputElementImpl::setValue):
6221         (HTMLInputElementImpl::isCheckedRadioButtonForDocument):
6222         * khtml/html/html_formimpl.h:
6223         * khtml/rendering/render_form.cpp:
6224         (RenderLineEdit::RenderLineEdit):
6225         (RenderLineEdit::calcMinMaxWidth):
6226         (RenderLineEdit::updateFromElement):
6227         (RenderLineEdit::slotTextChanged):
6228         * khtml/rendering/render_form.h:
6229
6230 2003-05-30  Darin Adler  <darin@apple.com>
6231
6232         Reviewed by John.
6233
6234         - added "sjis" as a synonym for "Shift_JIS"; this might fix 3235161,
6235         HOMEPAGE: Publishing page with Japanese characters w/ Safari generates an error,
6236         but I am currently unable to test the fix.
6237
6238         * kwq/mac-encodings.txt: Added sjis to the Shift_JIS line.
6239         * kwq/KWQCharsetData.c: Regenerated.
6240
6241 2003-05-29  David Hyatt  <hyatt@apple.com>
6242
6243         Fix for 3263156, stack overflow at www.liceo.edu.mx.  This
6244         site nests about 500 bold tags, only closes some of them, 
6245         and then opens 500 more, etc.
6246
6247         The fix for this problem is to stop honoring tags in the parser
6248         after you see 20 identical tags.  We do this only for fontstyle HTML
6249         tags.
6250         
6251         Reviewed by john/darin
6252
6253         * khtml/html/htmlparser.cpp:
6254         (KHTMLParser::getElement):
6255         (KHTMLParser::allowNestedRedundantTag):
6256         * khtml/html/htmlparser.h:
6257
6258 2003-05-30  John Sullivan  <sullivan@apple.com>
6259
6260         Reviewed by Chris
6261
6262         * khtml/rendering/break_lines.cpp:
6263         Removed #ifdef/#else for which the two sides were identical
6264         that I noticed in passing.
6265
6266 2003-05-29  Maciej Stachowiak  <mjs@apple.com>
6267
6268         Reviewed by Richard.
6269
6270         - fixed 3270373 - MALLORY: repro crash in +[KWQObjectTimerTarget stopDeferringTimers] while changing folder
6271
6272         * kwq/KWQObject.mm:
6273         (QObject::killTimer): Remove the timer from the deferred list too - clients expect that a timer
6274         will never be delivered after the object was killed.
6275         (QObject::killTimers): Use killTimer on each timer for this object instead of trying
6276         to be tricky. 
6277         (-[KWQObjectTimerTarget timerFired]): Don't add a timer to the deferred list more than once,
6278         because there's no benefit in ganging up multiple firings while deferred, and it makes other
6279         things simpler.
6280         (+[KWQObjectTimerTarget stopDeferringTimers]): Make sure to remove the timer before firing it, 
6281         since it may also cancel itself, and we don't want to remove an extra timer in that case.
6282
6283 2003-05-29  Richard Williamson   <rjw@apple.com>
6284
6285         Support for the 'estimatedProgress' method on
6286         WebView.  Added bridge access to the number of pending or still
6287         loading requests (from KHTML's perspective).  This is used to
6288         more accurately guess at the total remaining bytes to load.
6289
6290         Reviewed by Chris.
6291
6292         * kwq/KWQLoader.h:
6293         * kwq/KWQLoader.mm:
6294         (KWQServeRequest):
6295         (KWQNumberOfPendingOrLoadingRequests):
6296         * kwq/WebCoreBridge.h:
6297         * kwq/WebCoreBridge.mm:
6298         (-[WebCoreBridge numPendingOrLoadingRequests]):
6299
6300 2003-05-29  Ken Kocienda  <kocienda@apple.com>
6301
6302         Reviewed by Maciej
6303
6304         Fix for this bug:
6305
6306         <rdar://problem/3271697>: Search fails at travel site
6307
6308         * khtml/html/html_formimpl.cpp:
6309         (HTMLFormElementImpl::parseAttribute): Allow form method to be set
6310         to GET from javascript.
6311
6312 2003-05-29  John Sullivan  <sullivan@apple.com>
6313
6314         - fixed MIME type leaks that were most of 3272566 
6315         (several leaks after visiting amazon.com and emptying cache)
6316
6317         Reviewed by Darin
6318
6319         * kwq/KWQPixmap.mm:
6320         (QPixmap::QPixmap):
6321         (QPixmap::operator=):
6322         fixed two leaks of MIME string
6323
6324 2003-05-29  Darin Adler  <darin@apple.com>
6325
6326         Reviewed by John.
6327
6328         - fixed 3269564 -- dynamically-created forms look right, but don't post values when submitted
6329
6330         * khtml/html/html_formimpl.h: Remove useless virtual setParent function.
6331         Since the inherited setParent is not virtual, it does no good to make the subclass
6332         override it with a virtual function.
6333         * khtml/html/html_formimpl.cpp: Remove useless virtual setParent.
6334         (HTMLGenericFormElementImpl::attach): Add code here, cribbed from setParent, to add
6335         a new form element to the form it's in.
6336         (HTMLButtonElementImpl::attach): A copy of the code is also needed here.
6337
6338         * WebCore.pbproj/project.pbxproj: Let Project Builder be Project Builder.
6339
6340 2003-05-28  Maciej Stachowiak  <mjs@apple.com>
6341
6342         Reviewed by Darin.
6343
6344         - fixed 3263157 - REGRESSION: tabbing into a secure password field shows contents
6345
6346         * kwq/KWQTextField.mm:
6347         (-[KWQSecureTextField textDidEndEditing:]): Make sure to restore bullet mode if we
6348         accidentally lose it.
6349
6350 2003-05-27  Maciej Stachowiak  <mjs@apple.com>
6351
6352         Rolled in fix from Safari-80~1-branch
6353
6354     2003-05-27  Maciej Stachowiak  <mjs@apple.com>
6355
6356         Reviewed by Darin.
6357
6358         * WebKit.pbproj/project.pbxproj: Removed no longer needed and harmful flag.
6359         
6360 2003-05-25  David Hyatt  <hyatt@apple.com>
6361
6362         Fix for 3268589, static position miscomputed when the positioned object is the last item in its enclosing block and when its previous sibling is a text run that ends in a space.  In this case we need to clear our trailingSpaceObject so that we don't mist
6363 akenly ignore the positioned object when building up bidi runs.
6364
6365         Fix for 3260053, table-layout of inherit not supported.  This
6366         caused a crash.  The fix is to just add in the support for the inherit
6367         value to the style selector.
6368         
6369         Reviewed by john
6370
6371         * khtml/rendering/bidi.cpp:
6372         * khtml/css/cssstyleselector.cpp
6373         
6374 2003-05-26  John Sullivan  <sullivan@apple.com>
6375
6376         - fixed 3262849 -- jump to nil in KWQKHTMLPart::searchForLabelsAboveCell 
6377         at techbargains.com
6378
6379         Reviewed by Dave
6380
6381         * kwq/KWQKHTMLPart.mm:
6382         (KWQKHTMLPart::searchForLabelsAboveCell):
6383         check for nil result of cellAboveRenderer->element()
6384
6385 2003-05-23  David Hyatt  <hyatt@apple.com>
6386
6387         Fix for 3229799, images missing on geocities page.  Residual style
6388         needs to understand when you reopen tags at a malformed table 
6389         content boundary and make sure the newly-reopened tags also know
6390         they are malformed table content so that they get cleaned up
6391         properly.
6392         
6393         Reviewed by darin
6394
6395         * khtml/html/htmlparser.cpp:
6396         (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
6397         (KHTMLParser::reopenResidualStyleTags):
6398         (KHTMLParser::popBlock):
6399         * khtml/html/htmlparser.h:
6400
6401 2003-05-22  David Hyatt  <hyatt@apple.com>
6402
6403         Fix for 3248176, failed assertion on blizzard's world of warcraft
6404         page.  They dynamically changed the position of an element from
6405         absolute to relative, and this element was inside an inline.
6406         The setStyle() code has to be smart enough to split the inline
6407         flow when the element is no longer absolute positioned.
6408
6409         This patch makes a splitFlow occur like it should and it also
6410         cleans up anonymous block creation with a new helper function
6411         on RenderObject, createAnonymousBlock.
6412         
6413         Reviewed by darin
6414
6415         * khtml/rendering/render_block.cpp:
6416         * khtml/rendering/render_inline.cpp:
6417         (RenderInline::splitFlow):
6418         * khtml/rendering/render_object.cpp:
6419         (RenderObject::createAnonymousBlock):
6420         (RenderObject::handleDynamicFloatPositionChange):
6421         (RenderObject::setStyle):
6422         * khtml/rendering/render_object.h:
6423
6424 2003-05-22  David Hyatt  <hyatt@apple.com>
6425
6426         Fix for 3259947.  Can't add clippings on iht.com.  The fix is
6427         to make sure all DOM properties that relate to attributes return ""
6428         and not "null" when the attribute isn't present or when the 
6429         DOMString is null.
6430
6431         Also patching the code for text-indent to make sure that floats
6432         don't improperly consume text-indent.  This fixes two of the issues
6433         on diveintomark.
6434         
6435         Reviewed by mjs
6436
6437         * khtml/ecma/kjs_html.cpp:
6438         (KJS::HTMLDocument::tryGet):
6439         (KJS::HTMLElement::getValueProperty):
6440
6441 2003-05-22  David Hyatt  <hyatt@apple.com>
6442
6443         Make sure the overflow clip rect clips out the scrollbars
6444         so that child layers aren't able to draw on top of the
6445         scrollbars.
6446
6447         Also fix scrollbars so that they are painted before the
6448         overflow clip rect is applied (just as backgrounds and borders
6449         are).
6450
6451         These two fixes make the divtest example from Yahoo (sent by Mark
6452         Malone) work.
6453         
6454         Reviewed by john
6455
6456         * khtml/rendering/render_box.cpp:
6457         (RenderBox::getOverflowClipRect):
6458         * khtml/rendering/render_layer.cpp:
6459         (RenderLayer::paint):
6460
6461 2003-05-22  Darin Adler  <darin@apple.com>
6462
6463         Reviewed by John.
6464
6465         - fixed 3216039 -- calls to m_redirectionTimer.stop() do not always clear m_scheduledRedirection
6466
6467         * khtml/khtml_part.h: Added cancelRedirection().
6468         * khtml/khtml_part.cpp:
6469         (KHTMLPart::~KHTMLPart): Call cancelRedirection() instead of m_redirectionTimer.stop().
6470         (KHTMLPart::restoreURL): Ditto.
6471         (KHTMLPart::openURL): Ditto.
6472         (KHTMLPart::closeURL): Ditto.
6473         (KHTMLPart::cancelRedirection): Added. Sets m_scheduledRedirection to noRedirectionScheduled
6474         and calls m_redirectionTimer.stop(), but is also safe to call after d is set to 0.
6475         (KHTMLPart::restoreState): Call cancelRedirection() instead of m_redirectionTimer.stop().
6476
6477         * kwq/KWQKHTMLPart.mm:
6478         (KWQKHTMLPart::openURLFromPageCache): Call cancelRedirection() instead of m_redirectionTimer.stop().
6479         (KWQKHTMLPart::scrollToAnchor): Call cancelRedirection() instead of m_redirectionTimer.stop()
6480         (and setting m_scheduledRedirection).
6481
6482 2003-05-21  David Hyatt  <hyatt@apple.com>
6483
6484         This patch deals with the main cause of regressions from
6485         the minimum font size removal.  Because we stored font sizes
6486         as integers, we ended up flooring font sizes, and when percentages
6487         were nested, the magnitude of error increased dramatically.
6488
6489         This patch changes FontDef to store a float size instead of an
6490         integer size.  The style system thus always computes a precise
6491         floating point value for a font, with no error introduced and
6492         only once it has that final computed value does it round to the
6493         nearest pixel for the QFont.
6494
6495         This fixes 3265628, www.anandtech.com.
6496         
6497         Reviewed by rjw
6498
6499         * khtml/css/css_valueimpl.cpp:
6500         (CSSPrimitiveValueImpl::computeLengthFloat):
6501         * khtml/css/cssstyleselector.cpp:
6502         * khtml/rendering/font.cpp:
6503         (Font::update):
6504         * khtml/rendering/font.h:
6505         * khtml/xml/dom_docimpl.cpp:
6506         (DocumentImpl::recalcStyle):
6507
6508 2003-05-21  David Hyatt  <hyatt@apple.com>
6509
6510         Fix for 3257990, attributes in HTML should always be case-insensitive
6511         when matching CSS attribute selectors.  Instead of relying on 
6512         the strict mode check, I patched the code to use an isXMLDoc
6513         bool instead.
6514
6515         Also fixing a problem where <pre>s are mistakenly justifying their
6516         text when text-align: justify is set.
6517         
6518         Reviewed by kocienda
6519
6520         * ChangeLog:
6521         * khtml/css/cssstyleselector.cpp:
6522         * khtml/css/cssstyleselector.h:
6523         * khtml/rendering/bidi.cpp:
6524
6525 2003-05-21  Vicki Murley  <vicki@apple.com>
6526
6527         Reviewed by john 
6528         - fixed 3234553: Safari and its frameworks should link using order files
6529
6530         * WebCore.order: Added.
6531         * WebCore.pbproj/project.pbxproj: set SECTORDER_FLAGS = -sectorder __TEXT __text WebCore.order
6532
6533 2003-05-20  David Hyatt  <hyatt@apple.com>
6534
6535         An implementation of fieldset and legend.  This is based off
6536         some KHTML trunk code, but only loosely.  I had to rewrite
6537         most of it in order to make fieldsets work properly with
6538         padding and in order to match the fieldset style of other
6539         browsers more closely.
6540
6541         This code also fixes HTML4 buttons so that they don't fill the
6542         width of containing blocks.  This has been a long-standing
6543         bug.  Since legends behave the same way as buttons and floats,
6544         I made a new helper function, sizesToMaxWidth(), to denote an
6545         element that just uses its max intrinsic width when sizing
6546         instead of filling a containing block.
6547
6548         This patch also fixes z-index so it properly only applies to the 
6549         root and to positioned/relpositioned elements.  
6550         
6551         Reviewed by darin
6552
6553         * ChangeLog:
6554         * ForwardingHeaders/rendering/render_block.h: Added.
6555         * khtml/css/html4.css:
6556         * khtml/html/html_formimpl.cpp:
6557         (HTMLFieldSetElementImpl::HTMLFieldSetElementImpl):
6558         (HTMLFieldSetElementImpl::attach):
6559         (HTMLFieldSetElementImpl::createRenderer):
6560         (HTMLLegendElementImpl::HTMLLegendElementImpl):
6561         (HTMLLegendElementImpl::id):
6562         (HTMLLegendElementImpl::attach):
6563         (HTMLLegendElementImpl::createRenderer):
6564         * khtml/html/html_formimpl.h:
6565         * khtml/rendering/render_block.cpp:
6566         * khtml/rendering/render_block.h:
6567         * khtml/rendering/render_box.cpp:
6568         (RenderBox::setStyle):
6569         (RenderBox::calcWidthUsing):
6570         * khtml/rendering/render_canvas.cpp:
6571         * khtml/rendering/render_form.cpp:
6572         (RenderFieldset::RenderFieldset):
6573         (RenderFieldset::layoutLegend):
6574         (RenderFieldset::findLegend):
6575         (RenderFieldset::paintBoxDecorations):
6576         (RenderFieldset::paintBorderMinusLegend):
6577         (RenderLegend::RenderLegend):
6578         * khtml/rendering/render_form.h:
6579         * khtml/rendering/render_object.cpp:
6580         (RenderObject::sizesToMaxWidth):
6581         * khtml/rendering/render_object.h:
6582
6583 2003-05-19  David Hyatt  <hyatt@apple.com>
6584
6585         Fix for 3262890, logical font sizes (e.g., large) cannot be applied
6586         to monospace tags like <pre> and <tt>.  The fix adds a notion of
6587         the current logicalSize in effect for a given FontDef so that
6588         shifts in family as you go down the style tree result in an
6589         auto-correction of the size.
6590
6591         Note that with the addition of this cached logicalSize property,
6592         it will be possible to eliminate the two separate logical size
6593         tables and implement the monospace table as a "zoom factor" applied
6594         to the normal table (an idea long ago suggested by darin).
6595         
6596         Reviewed by darin
6597
6598         * ChangeLog:
6599         * khtml/css/cssstyleselector.cpp:
6600         * khtml/rendering/font.h:
6601
6602 === Safari-80 ===
6603
6604 2003-05-19  Maciej Stachowiak  <mjs@apple.com>
6605
6606         - fixed 3261096 - Make WebKit an umbrella framework
6607
6608         * WebCore.pbproj/project.pbxproj: In a B&I build, compile as a
6609         sub-umbrella of WebKit.
6610
6611 2003-05-19  Ken Kocienda  <kocienda@apple.com>
6612
6613         Reviewed by Darin
6614         
6615         Fixed build problem with declaring MIMEType as a category
6616         on NSObject. This method needs to be typed to return NSString.
6617
6618         * kwq/KWQLoader.mm
6619
6620 2003-05-16  Maciej Stachowiak  <mjs@apple.com>
6621
6622         Reviewed by Richard.
6623
6624         - fixed 3260940 - REGRESSION: reproducible crash freeing page cache item
6625         - fixed 3241041 - REGRESSION: repro world leak of 1 JavaScript interpreter
6626
6627         The fix for these problems and probably other page cache wackiness
6628         was to use a refcounting scheme for KHTMLView instead of counting
6629         on the previous tricky ownership rules.
6630         
6631         * khtml/khtmlview.cpp:
6632         (KHTMLView::KHTMLView): Initialize _refCount to 1.
6633         (KHTMLView::~KHTMLView): Assert that _refCount is 0, to make sure no one is deleting
6634         views explicitly.
6635         * khtml/khtmlview.h:
6636         * khtml/rendering/render_frames.cpp:
6637         (RenderPart::~RenderPart): If our view is a KHTMLView, deref it.
6638         (RenderPart::setWidget): If the view is a KHTMLView, tell the superclass not to
6639         delete it and ref it.
6640         * khtml/rendering/render_frames.h:
6641         * khtml/rendering/render_replaced.cpp:
6642         (RenderWidget::RenderWidget): Initizlize m_deleteWidget to false.
6643         (RenderWidget::~RenderWidget): Only delete widget if we're supposed to.
6644         (RenderWidget::setQWidget): Add extra delegeWidget argument that says whether
6645         to delete this widget when done - defaults to true.
6646         * khtml/rendering/render_replaced.h:
6647         * kwq/KWQKHTMLPart.h:
6648         * kwq/KWQKHTMLPart.mm:
6649         (KWQKHTMLPart::KWQKHTMLPart): Removed _ownsView boolean -- we'll always hang on
6650         to a ref to it now.
6651         (KWQKHTMLPart::~KWQKHTMLPart): Deref the view always instead of deleting it sometimes.
6652         (KWQKHTMLPart::setView): deref the old view if not null. ref the new view if not null.
6653         Drop tricky ownership rules.
6654         (KWQKHTMLPart::openURLFromPageCache): Remove no longer applicable comment about the
6655         importance of when setView is called.
6656         * kwq/KWQPageState.mm:
6657         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]): ref the
6658         document's view.
6659         (-[KWQPageState invalidate]): deref the document's view.
6660         (-[KWQPageState dealloc]): deref the document's view instead of deleting it.
6661         * kwq/WebCoreBridge.mm:
6662         (-[WebCoreBridge createKHTMLViewWithNSView:marginWidth:marginHeight:]): No more need
6663         to pass weOwnIt argument to setView. Also, deref the view after passing it to the
6664         KWQKHTMLView -- we own the initial ref since we allocated it.
6665         (-[WebCoreBridge removeFromFrame]): No more need to pass weOwnIt argument to setView.
6666         (-[WebCoreBridge installInFrame:]): Ditto.
6667
6668 2003-05-16  Maciej Stachowiak  <mjs@apple.com>
6669
6670         Reviewed by Ken.
6671
6672         - fixed 3256997 - reproducible world leak (of 1 JavaScript interpreter) using google images 
6673
6674         This turned out to be a page cache bug, and nothing to do with
6675         JavaScript. The part and view were also leaked.
6676         
6677         * kwq/KWQKHTMLPart.mm:
6678         (KWQKHTMLPart::openURLFromPageCache): Make sure to reset the view
6679         before resetting the document, so that when we check if the
6680         document is in the page cache to determine if we can delete the
6681         old view, we'll be checking the old document instead of the new
6682         one.
6683
6684 2003-05-15  Maciej Stachowiak  <mjs@apple.com>
6685
6686         Reviewed by Richard.
6687
6688         - fixed 3168588 - Can't click on links at Nike site (Image onload handler problem)
6689
6690         The fix was to implement the onload property for Image objects
6691         (which are entirely different from <img> HTML elements).
6692
6693         * khtml/ecma/kjs_html.cpp:
6694         (Image::getValueProperty): Implement access to onload attribte.
6695         (Image::tryPut): Use putValue cause we're gonna use the hashtable now.
6696         (Image::putValue): Moved guts of tryPut here. Implement setting of
6697         onload attribute.
6698         (Image::notifyFinished): Fire onload event if there is a listener.
6699         (Image::Image): initialize onload listener to null.
6700         * khtml/ecma/kjs_html.h:
6701         * khtml/ecma/kjs_html.lut.h: Regenerated.
6702
6703 === Safari-79 ===
6704
6705 2003-05-14  David Hyatt  <hyatt@apple.com>
6706
6707         Fix for 3248193.  Floats with layers paint twice.  The fix
6708         is to make sure floats are not painted during the float phase
6709         if they also have a layer.
6710         
6711         Reviewed by john
6712         
6713         * khtml/rendering/render_block.cpp:
6714
6715 2003-05-14  David Hyatt  <hyatt@apple.com>
6716
6717         Fix for 3258389, min-width should take precedence over max-width.
6718         I just had an "else" that shouldn't have been there, so that
6719         min-width would get checked even if max-width was also checked.
6720         
6721         Reviewed by kocienda
6722
6723         * khtml/rendering/render_box.cpp:
6724         (RenderBox::calcWidth):
6725
6726 2003-05-14  Maciej Stachowiak  <mjs@apple.com>
6727
6728         Reviewed by Don.
6729
6730         - fixed 3257307 - REGRESSION: crash using onFocus="this.blur()"
6731         
6732         * kwq/KWQTextField.mm:
6733
6734         (-[KWQTextField setHasFocus:]): Don't call
6735         KWQKHTMLPart::setDocumentFocus(widget) to start with, it might
6736         invoke a handler which could call blur(), and we don't want to do
6737         the selection handling after that; futhermore, it will get called
6738         anyway when we deliver the FocusIn event to the event
6739         filter. Also, sometimes unfocusing in the middle of a focus can
6740         leave us and AppKit in an inconsistent state; correct this. A
6741         comment explains the details.
6742
6743 2003-05-13  Maciej Stachowiak  <mjs@apple.com>
6744
6745         Reviewed by John.
6746
6747         - fixed 3240129 - REGRESSION: www.ezprints.com navigation buttons don't show up (window.addEventListener)
6748
6749         The problem here was that event handlers set using
6750         window.addEventListener were set as regular event handlers on the
6751         document object instead of as window event handlers - and the load
6752         event does not fire properly that way. 
6753
6754         The fix was to add support for both HTML and non-HTML window event
6755         handlers. The old window event methods supported only "HTML"
6756         handlers, but were not named as such.
6757
6758         * khtml/ecma/kjs_window.cpp:
6759         (Window::setListener): Use setHTMLWindowEventListener.
6760         (Window::getListener): Use getHTMLWindowEventListener.
6761         (WindowFunc::tryCall): use addWindowEventListener and removeWindowEventListener
6762         on the DocumentImpl instead of addEventListener and removeEventListener on the
6763         Document.
6764         * khtml/html/html_baseimpl.cpp:
6765         (HTMLBodyElementImpl::parseAttribute): Use setHTMLWindowEventListener
6766         instead of the old setWindowEventListener.
6767         * khtml/xml/dom_docimpl.cpp:
6768         (DocumentImpl::defaultEventHandler): Don't stop after the first
6769         window event handler - keep going, since there might now be more
6770         than one for the same event.
6771         (DocumentImpl::setHTMLWindowEventListener): Renamed from setWindowEventListener.
6772         (DocumentImpl::getHTMLWindowEventListener): Renamed from getWindowEventListener.
6773         (DocumentImpl::removeHTMLWindowEventListener): Renamed from removeWindowEventListener.
6774         (DocumentImpl::addWindowEventListener): Implemented - support adding non-HTML window
6775         event listeners, which, unlike html listeners, are nto exclusive - there may be more
6776         than one.
6777         (DocumentImpl::removeWindowEventListener): Implemented.
6778         (DocumentImpl::hasWindowEventListener): Check if a window has any handler at all
6779         for a prticular event.
6780         * khtml/xml/dom_docimpl.h:
6781         * khtml/xml/dom_nodeimpl.cpp:
6782         (NodeImpl::addEventListener): Add ref/deref pair to protect against last ref of listener
6783         going away on remove. Correct comment about the removal.
6784         * kwq/KWQKHTMLPart.mm:
6785         (KWQKHTMLPart::canCachePage): Check for an UNLOAD event handler
6786         using hasWindowEventListener instead of getHTMLWindowEventListener, to
6787         check for even addListener-style unload handlers.
6788
6789 2003-05-13  David Hyatt  <hyatt@apple.com>
6790
6791         Fix for 3222607.  divs that specify a fixed width should have
6792         their minwidths increased to that width.  This is an issue
6793         on diveintomark's list as well as a blocker for Benoit.
6794         
6795         Reviewed by gramps
6796
6797         * khtml/rendering/render_block.cpp:
6798
6799 2003-05-13  David Hyatt  <hyatt@apple.com>
6800
6801         Fix for 3256376, absolute positioned content that had to be
6802         scrolled into view would not respond to events.  This is a 
6803         regression caused by fixing the size of the HTML element.
6804
6805         I stopped all of the updating of layer widths/heights in
6806         setLayouted and in setWidth/Height of RenderBox and special-cased
6807         the sizing of the RenderCanvas layer so that it always encloses
6808         all content.
6809
6810         This patch also contains a fix for 3211915, left/top positions
6811         not computed properly when auto or static.  The patch adds
6812         staticX/Y member variables to RenderBox that holds the cached
6813         values that can then be used by positioned elements to determine
6814         their correct positions in the flow.  RenderStyles also now
6815         remember both the original display of an element as well as
6816         the mutated display (e.g., when an inline becomes a block
6817         because of absolute positioning).
6818         
6819         Reviewed by darin (canvas fix) and kocienda (left/top fix)
6820
6821         * khtml/css/cssstyleselector.cpp:
6822         * khtml/rendering/bidi.cpp:
6823         * khtml/rendering/render_block.cpp:
6824         * khtml/rendering/render_box.cpp:
6825         (RenderBox::RenderBox):
6826         (RenderBox::position):
6827         (RenderBox::setStaticX):
6828         (RenderBox::setStaticY):
6829         (RenderBox::calcAbsoluteHorizontal):
6830         (RenderBox::calcAbsoluteVertical):
6831         * khtml/rendering/render_box.h:
6832         * khtml/rendering/render_canvas.cpp:
6833         * khtml/rendering/render_flow.cpp:
6834         (RenderFlow::createInlineBox):
6835         * khtml/rendering/render_flow.h:
6836         * khtml/rendering/render_layer.cpp:
6837         (RenderLayer::updateLayerPosition):
6838         * khtml/rendering/render_line.cpp:
6839         (InlineFlowBox::placeBoxesHorizontally):
6840         (InlineFlowBox::adjustMaxAscentAndDescent):
6841         (InlineFlowBox::computeLogicalBoxHeights):
6842         (InlineFlowBox::placeBoxesVertically):
6843         (InlineFlowBox::shrinkBoxesWithNoTextChildren):
6844         * khtml/rendering/render_object.cpp:
6845         (RenderObject::hasStaticX):
6846         (RenderObject::hasStaticY):
6847         (RenderObject::setNeedsLayout):
6848         (RenderObject::createInlineBox):
6849         * khtml/rendering/render_object.h:
6850         * khtml/rendering/render_style.cpp:
6851         (RenderStyle::diff):
6852         * khtml/rendering/render_style.h:
6853         * khtml/rendering/render_text.cpp:
6854         (RenderText::createInlineBox):
6855         * khtml/rendering/render_text.h:
6856
6857 2003-05-13  Richard Williamson   <rjw@apple.com>
6858
6859         Fixed 3014661.  We now display (a lame Lemay) image
6860         when an image fails to load.  We also display the 
6861         alt text if it fits within the image container
6862         above the missing image icon.  Alt text is also
6863         now shown if image loading is disabled.
6864
6865         Reviewed by John.
6866
6867         * khtml/misc/loader.cpp:
6868         (CachedImage::data):
6869         (Cache::init):
6870         * khtml/rendering/render_image.cpp:
6871         (RenderImage::paintObject):
6872         (RenderImage::reload):
6873         * kwq/KWQPixmap.h:
6874         * kwq/KWQPixmap.mm:
6875         (KWQLoadPixmap):
6876         (QPixmap::QPixmap):
6877         (QPixmap::isNull):
6878         * kwq/WebCoreImageRenderer.h:
6879         * kwq/WebCoreImageRendererFactory.h:
6880
6881 2003-05-12  Maciej Stachowiak  <mjs@apple.com>
6882
6883         Reviewed by Darin.
6884
6885         - fixed 3254484 - Add a way to print JavaScript exceptions to the console via the debug menu
6886
6887         * khtml/ecma/kjs_proxy.cpp:
6888         (KJSProxyImpl::evaluate): Pass the filename.
6889         * kwq/WebCoreJavaScript.h:
6890         * kwq/WebCoreJavaScript.mm:
6891         (+[WebCoreJavaScript shouldPrintExceptions]): Call through to JavaScriptCore.
6892         (+[WebCoreJavaScript setShouldPrintExceptions:]): Call through to JavaScriptCore.
6893         * khtml/ecma/kjs_events.cpp:
6894         (JSEventListener::handleEvent): Print exception if there is one.
6895         * khtml/ecma/kjs_window.cpp:
6896         (ScheduledAction::execute): Print exception in the function case.
6897
6898 2003-05-13  Darin Adler  <darin@apple.com>
6899
6900         Reviewed by Ken.
6901
6902         - fixed 3140822 -- relative URLs starting with query strings clobber path as the RFC says, but web says no
6903
6904         * kwq/KWQKURL.mm: (KURL::KURL): Add a case for queries (as with anchors) to match
6905         the behavior of the web (albeit not the RFC).
6906
6907 2003-05-13  Darin Adler  <darin@apple.com>
6908
6909         Reviewed by Ken.
6910
6911         - fixed 3120355 -- importing IE favorites garbles non-ASCII characters (esp. bad for non-Roman languages)
6912
6913         * kwq/WebCoreEncodings.h: Added decodeData:, removed all other (unused) methods.
6914         * kwq/WebCoreEncodings.mm: (+[WebCoreEncodings decodeData:]): Added. Calls the same
6915         decoder used to decode web pages.
6916
6917 2003-05-13  Darin Adler  <darin@apple.com>
6918
6919         Reviewed by John.
6920
6921         - fixed 3228186 -- REGRESSION: crash walking parent tree at housingscc.org in DOM::StyleBaseImpl::stylesheet()
6922
6923         * khtml/xml/dom_elementimpl.cpp:
6924         (ElementImpl::~ElementImpl): Unref the stylesheet with the style declaration in it
6925         when destroying the element.
6926         (ElementImpl::createDecl): Ref the stylesheet with the style declaration in it when
6927         making a style element for this. If we don't we could end up with a style declaration
6928         without a stylesheet, which can't be manipulated by the CSS parser.
6929
6930         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::removeCSSProperty): Since this
6931         function has a side effect of changing the stylesheet for the style declaration, ref
6932         the new stylesheet and unref the old one.
6933
6934 2003-05-12  Richard Williamson  <rjw@apple.com>
6935
6936         Fixed 3194614 and 3194751.  We avoid creating and render objects
6937         and loading any images if the document is in 'renderless' mode.
6938         
6939         Also, we now unique instances of the ObjC DOM wrappers.
6940         
6941         Reviewed by hyatt/darin.
6942
6943         * khtml/misc/loader.cpp:
6944         * khtml/xml/dom_docimpl.cpp:
6945         * khtml/xml/dom_docimpl.h:
6946         * khtml/xml/dom_nodeimpl.cpp:
6947         * kwq/KWQLoader.h:
6948         * kwq/KWQLoader.mm:
6949         * kwq/WebCoreBridge.h:
6950         * kwq/WebCoreBridge.mm:
6951         * kwq/WebCoreDOMNode.mm:
6952         * kwq/WebDOMNode.h:
6953
6954         Pass the reported MIME type of an image up to WebKit when
6955         creating an WebImageRenderer.  This is useful to help speed up
6956         the selection of an appropriate decoder.
6957         
6958         Reviewed by darin.
6959
6960         * kwq/WebCoreImageRendererFactory.h:
6961         * kwq/KWQPixmap.h:
6962         * kwq/KWQPixmap.mm:
6963
6964 2003-05-12  Darin Adler  <darin@apple.com>
6965
6966         Reviewed by Richard.
6967
6968         - fixed 3240925 -- can't select or copy text from readonly INPUT elements
6969
6970         An AppKit peculiarity. Calling setEditable:NO will have a side effect of
6971         doing setSelectable:NO unless you explicitly did setSelectable:YES.
6972
6973         * kwq/KWQLineEdit.mm:
6974         (QLineEdit::QLineEdit): Call setSelectable:YES.
6975
6976         * kwq/KWQTextField.mm:
6977         (-[KWQTextField setPasswordMode:]): When creating the password field, keep
6978         the setSelectable state synchronized.
6979         (-[KWQTextField setSelectable:]): If we already have a password field, be
6980         sure to keep its selectable state the same as the main field.
6981
6982 2003-05-12  Darin Adler  <darin@apple.com>
6983
6984         Reviewed by John.
6985
6986         - fixed 3255281 -- REGRESSION: objc_error in key loop code, closing tab containing aintitcool.com page
6987
6988         * kwq/KWQTextField.mm:
6989         (-[KWQSecureTextField nextKeyView]): Change back to using our own nextKeyView
6990         implementation. By returning the nextKeyView from KWQTextField, we ended up making
6991         AppKit very upset about the key view loop. This undoes a change I made last
6992         Thursday, so the regression is very new and was never in a release.
6993         (-[KWQSecureTextField previousKeyView]): More of the same.
6994         (-[KWQSecureTextField nextValidKeyView]): Ditto.
6995         (-[KWQSecureTextField previousValidKeyView]): Ditto.
6996
6997 2003-05-11  David Hyatt  <hyatt@apple.com>
6998
6999         The root element (HTML) tries to set itself to the lowest position
7000         of the canvas, before the canvas has necessarily even determined
7001         the correct lowest position.  This creates a timing problem.
7002
7003         This code is legacy code anyyway, left over from before KHTML
7004         understood about overflow.  The HTML should not be resizing itself
7005         to enclose positioned content or floats.  They should just spill
7006         out of the HTML object, so the fix is easy: kill the legacy code.
7007         
7008         There's a second fix required as well, which is to make the canvas
7009         avoid scanning its positioned objects list when computing its
7010         lowest and rightmost position.  Fixed positioned objects can't
7011         be scrolled, so it's incorrect to show scrollbars because of
7012         fixed positioned objects (since they are locked to the viewport).
7013         
7014         Reviewed by darin/gramps
7015
7016         * khtml/rendering/render_block.cpp:
7017
7018 2003-05-11  Darin Adler  <darin@apple.com>
7019
7020         Reviewed by Dave.
7021
7022         - fixed 3242493 -- loop in khtml::RenderLayer::RenderZTreeNode at google cached copy of epower2go.biz page
7023
7024         * khtml/rendering/render_layer.cpp: (RenderLayer::RenderZTreeNode::detach):
7025         Use an iterative algorithm rather than a recursive one to destroy the child
7026         nodes at each level of the tree, so our recursion is O(depth of tree) rather
7027         than O(size of tree).
7028
7029 2003-05-10  David Hyatt  <hyatt@apple.com>
7030
7031         Fix the misrendering at the top of cnn.com (the extra tearing
7032         by the Google logo on the front page of cnn).  
7033
7034         I am reducing the intrinsic margins of text fields down to 2px 
7035         to match buttons and selects.
7036
7037         This is easily sufficient distance to avoid focus ring overlap and
7038         still looks nice, e.g., on www.google.com and amazon.com.
7039         
7040         Reviewed by mjs
7041
7042         * khtml/rendering/render_form.h:
7043
7044 2003-05-10  David Hyatt  <hyatt@apple.com>
7045
7046         A refinement of our intrinsic margin rules for form controls.
7047         Rather than always applying the intrinsic margin to form controls,
7048         this patch makes the application conditional.
7049
7050         If the Web page explicitly specifies a width on a form control,
7051         the form control will honor that precise pixel-width and will not
7052         apply left/right intrinsic margins.  If a Web page specifies margins
7053         that the control should use, then the control will honor those
7054         margins.  The same rules apply for height and top/bottom margins.
7055
7056         Reviewed by mjs
7057
7058         * khtml/css/html4.css:
7059         * khtml/rendering/render_box.cpp:
7060         (RenderBox::calcReplacedWidth):
7061         (RenderBox::calcReplacedHeight):
7062         * khtml/rendering/render_form.cpp:
7063         (RenderFormElement::addIntrinsicMarginsIfNeeded):
7064         (RenderFormElement::setStyle):
7065         * khtml/rendering/render_form.h:
7066
7067 2003-05-10  Darin Adler  <darin@apple.com>
7068
7069         Reviewed by Maciej.
7070
7071         - fixed 3206695 -- Safari puts all of the mailto form content in email subject line, should put content in body
7072
7073         The bug was caused by our KURL class not parsing the query out of the mailto URL properly.
7074
7075         * kwq/KWQKURL.h: Removed parameter from prettyURL, unused in KHTML.
7076         * kwq/KWQKURL.mm:
7077         (KURL::prettyURL): Removed parameter, unused in KHTML.
7078         (KURL::parse): Parse queries even from non-hierarchical URLs. This fixes the bug.
7079
7080         * WebCore-tests.exp: Updated for parameter removed from prettyURL.
7081         * WebCore-combined.exp: Regenerated.
7082
7083 2003-05-09  Darin Adler  <darin@apple.com>
7084
7085         Reviewed by Maciej.
7086
7087         - fixed 3131026 -- half-width yen character (x5C) shows up as a backslash
7088
7089         To fix this, I had to reverse our previous decoding approach for the characters
7090         that are different in Shift-JIS and ASCII. Before, we would decode them as
7091         ASCII, and so they would be wrong in web pages, but right in URLs. Now, I decode
7092         them as Shift-JIS, so they are right for web pages. This does not break URLs,
7093         though, because back in February we added code to re-encode characters for URLs
7094         to fix bug 3124596. But there is a TEC bug we have to work around to make this
7095         work right for the tilde character.
7096
7097         * kwq/KWQTextCodec.mm:
7098         (QTextCodec::fromUnicode): Work around the TEC bug that prevents the tilde
7099         character from surviving the round trip through the decoding process by explicitly
7100         changing decoded tildes back to ASCII tildes.
7101         (KWQTextDecoder::convertUsingTEC): Do not set kUnicodeForceASCIIRangeMask.
7102
7103         * kwq/KWQCString.h: Added replace call for use by new code. Some other
7104         small improvements.
7105         * kwq/KWQCString.mm:
7106         (QCString::contains): Make this faster by not doing the case-insensitive
7107         and case-sensitive cases both in the same loop.
7108         (QCString::append): Changed the += calls to this name, and made the
7109         += operator override call these.
7110         (QCString::replace): Added.
7111
7112         * WebCore-tests.exp: Changed to export append calls.
7113         * WebCore-combined.exp: Regenerated.
7114
7115 2003-05-09  David Hyatt  <hyatt@apple.com>
7116
7117         Finally get tables cutting the right properties off and letting
7118         the right ones through in quirks mode.  Font-family *is* inherited
7119         through into tables in all other browsers.  We have been doing this
7120         wrong the whole time.  Also ensure that font-style and font-variant
7121         are reset.
7122         
7123         Reviewed by darin
7124
7125         * khtml/css/quirks.css:
7126
7127 2003-05-09  David Hyatt  <hyatt@apple.com>
7128
7129         Always allow KONQ_TEXT as a valid value, and don't restrict its
7130         use to lax CSS parsing.  (We want our UA sheets to be parsed
7131         strictly.)
7132
7133         Fixes bug 3224791, color inheritance not being properly cut off
7134         in tables in quirks mode.
7135         
7136         Reviewed by mjs and darin
7137
7138         * khtml/css/cssparser.cpp:
7139         (CSSParser::parseValue):
7140
7141 2003-05-09  David Hyatt  <hyatt@apple.com>
7142
7143         Fix for 3253695, XML pages with <style>@import...</style> don't
7144         render.  The XML tokenizer is getting text in small chunks, and
7145         so it tries to load the sheet multiple times.  This fix patches
7146         the stylesheet code to properly decrement the loading sheet
7147         count when you abort a still-loading @import.
7148         
7149         Reviewed by darin
7150
7151         * khtml/html/html_headimpl.cpp:
7152         (HTMLStyleElementImpl::childrenChanged):
7153
7154 2003-05-09  Darin Adler  <darin@apple.com>
7155
7156         Reviewed by John.
7157
7158         - fixed 3191943 -- XML parsing error occurs when loading shift-JIS Japanese XML file
7159
7160         * khtml/misc/decoder.h: Add a new type of encoding, EncodingFromXMLHeader.
7161         * khtml/misc/decoder.cpp:
7162         (findXMLEncoding): Added.
7163         (Decoder::decode): Call findXMLEncoding to extract the encoding from the XML header.
7164
7165 2003-05-08  Darin Adler  <darin@apple.com>
7166
7167         Reviewed by John and Ken.
7168
7169         - fixed 3253461 -- stylesheet-reading code does not support BOM
7170         - fixed 3253359 -- XML parser does not allow UTF-8 BOM
7171
7172         * kwq/KWQTextCodec.mm:
7173         (KWQTextDecoder::KWQTextDecoder): Initialize the new _littleEndian, _atStart,
7174         and _numBufferedBytes fields, not the old _flags, _state, and _haveBufferedByte fields.
7175         (KWQTextDecoder::convertUTF16): Moved the BOM-based endianness detection out of here;
7176         now done in toUnicode. Switched to use the new multibyte buffer, even though we only
7177         need one byte of it. Remove any BOM characters encountered within the text.
7178         (KWQTextDecoder::convertUsingTEC): Remove any BOM characters encountered within the text.
7179         (KWQTextDecoder::toUnicode): Do all the BOM detection at this level, including the
7180         UTF-8 BOM as well as the UTF-16 BOM.
7181
7182         * khtml/misc/decoder.cpp: (Decoder::decode): Don't bother stripping the UTF-8 BOM.
7183         The QTextCodec object handles that now.
7184
7185         * kwq/KWQXmlSimpleReader.mm: (QXmlSimpleReader::parse): Pass in the data in 16-bit character
7186         form, and specify the encoding when creating the parser. Both expat and KHTML
7187         want to do the decoding, so this is really just a way to get expat to back off.
7188
7189 2003-05-08  David Hyatt  <hyatt@apple.com>
7190
7191         Fix the definition of isRoot() so that it doesn't depend on
7192         the object being in the render tree yet (and to avoid any
7193         virtual function calls as well).
7194
7195         Make sure that requiresLayer() returns true if the object is
7196         the root.  This way the layer isn't destroyed when you e.g.,
7197         hit Cmd+ to increase font size.  
7198
7199         This fixes bug 3252496.
7200         
7201         Reviewed by rjw
7202
7203         * khtml/rendering/render_block.cpp:
7204         * khtml/rendering/render_box.cpp:
7205         (RenderBox::setStyle):
7206         * khtml/rendering/render_object.cpp:
7207         (RenderObject::isRoot):
7208         * khtml/rendering/render_object.h:
7209         * khtml/xml/dom_elementimpl.cpp:
7210         (ElementImpl::createRenderer):
7211
7212 2003-05-08  David Hyatt  <hyatt@apple.com>
7213
7214         Background-position-x and y should be length|percentage.  Number
7215         is not a valid option.  Need to remove this so that the quirk will
7216         kick in that translates numbers to pixels.  Fixes an issue on
7217         diveintomark's list.
7218         
7219         Reviewed by darin
7220
7221         * khtml/css/cssparser.cpp:
7222         (CSSParser::parseValue):
7223
7224 2003-05-08  Darin Adler  <darin@apple.com>
7225
7226         Reviewed by Dave.
7227
7228         - fixed part of the cause of 3251979 -- switching tabs hoses page layout
7229
7230         * kwq/WebCoreSettings.mm: (-[WebCoreSettings _updateAllViews]): Only update views that are
7231         using this settings object. The old way would result in re-laying out all views every time
7232         you created a new one.
7233
7234 2003-05-08  Darin Adler  <darin@apple.com>
7235
7236         Reviewed by Dave.
7237
7238         - fixed regression caused by my last check-in; need to use the KHTMLView layout function
7239
7240         * kwq/KWQWidget.mm: (QWidget::setFocus): Use KHTMLView's layout instead of RenderCanvas's.
7241
7242         - fixed 3251913 -- when form field has focus, dragging across text elsewhere does not select it
7243
7244         * khtml/xml/dom_docimpl.cpp:
7245         (DocumentImpl::setSelection): Remove setFocusNode(0) call. Apparently not needed these days.
7246         I tested and everything works fine without it, and its side effect was the bug above.
7247         (DocumentImpl::setFocusNode): Remove clearSelection() call for similar reasons.
7248
7249 2003-05-08  Darin Adler  <darin@apple.com>
7250
7251         Reviewed by Maciej.
7252
7253         - fixed 3251985 -- REGRESSION: tabbing doesn't scroll text fields into view any more
7254
7255         * kwq/KWQTextField.h: Add a _hasFocus field, which prevents us from focusing
7256         multiple times.
7257         * kwq/KWQTextField.mm:
7258         (+[KWQTextField initialize]): Set KWQTextFieldCell as the cell class. We need a cell
7259         subclass to detect when editing begins.
7260         (-[KWQTextField setPasswordMode:]): Don't pass a QLineEdit to the secure text field
7261         when creating it. It's no longer needed.
7262         (-[KWQTextField controlTextDidEndEditing:]): Call setHasFocus:NO, and do the actual
7263         work in there.
7264         (-[KWQTextField control:textShouldBeginEditing:]): Remove the work that was done in
7265         here. This is only called when you actually start typing, so it's too late.
7266         (-[KWQTextField becomeFirstResponder]): Keep the code to forward first responder to
7267         the password field, but get rid of the rest, because this code path does not cover
7268         all the ways to start editing.
7269         (-[KWQTextField currentEditorForEitherField]): Moved this method inside the
7270         KWQInternal category.
7271         (-[KWQTextField selectedRange]): Ditto.
7272         (-[KWQTextField setSelectedRange:]): Ditto.
7273         (-[KWQTextField setHasFocus:]): Added. This method does all the work we want to do
7274         when we get focus and when we relinquish focus, including scrolling to make the field
7275         visible.
7276         (-[KWQTextFieldCell editWithFrame:inView:editor:delegate:event:]):
7277         Call setHasFocus:YES on the KWQTextField.
7278         (-[KWQTextFieldCell selectWithFrame:inView:editor:delegate:start:length:]): Ditto.
7279         (+[KWQSecureTextField cellClass]): Use KWQSecureTextFieldCell as the cell class.
7280         We need a cell subclass to detect when editing begins and we can't use the normal
7281         technique because NSSecureTextField will raise an exception.
7282         (-[KWQSecureTextField nextKeyView]): Simplified to just call through to KWQTextField.
7283         (-[KWQSecureTextField previousKeyView]): Ditto.
7284         (-[KWQSecureTextField nextValidKeyView]): Ditto.
7285         (-[KWQSecureTextField previousValidKeyView]): Ditto.
7286         (-[KWQSecureTextField widget]): Ditto.
7287         (-[KWQSecureTextField fieldEditorDidMouseDown:]): Ditto.
7288         (-[KWQSecureTextFieldCell editWithFrame:inView:editor:delegate:event:]):
7289         Call setHasFocus:YES on the KWQTextField.
7290         (-[KWQSecureTextFieldCell selectWithFrame:inView:editor:delegate:start:length:]): Ditto.
7291         
7292         * kwq/KWQWidget.mm: (QWidget::setFocus): Do a layout before positioning the widget.
7293         The code dealt with calls after a layout and before a draw, before, but not calls
7294         before a layout.
7295
7296 2003-05-08  David Hyatt  <hyatt@apple.com>
7297
7298         Fix for a problem where positioned/floating children with
7299         percentage width tables inside them  don't expand to fill 
7300         the width of their containing block.  
7301
7302         The way to solve this is to detect this
7303         case and treat the block as though it has an infinite maxwidth.
7304
7305         Note that this is a quirk only, since doing this for real would
7306         be crazy.  We're basically just matching broken WinIE behavior.
7307         
7308         Reviewed by kocienda
7309
7310         * khtml/rendering/render_block.cpp:
7311
7312 === Safari-78 ===
7313
7314 2003-05-08  Darin Adler  <darin@apple.com>
7315
7316         Reviewed by Ken.
7317
7318         - fixed 3174769 -- Safari doesn't ignore byte order mark at start of UTF-8 HTML document
7319
7320         * khtml/misc/decoder.cpp: (Decoder::decode): Added handling of the UTF-8 BOM
7321         to the code that already handled the UTF-16 BOM.
7322
7323 2003-05-06  David Hyatt  <hyatt@apple.com>
7324
7325         The purpose of this patch is to unify XML and HTML documents' root
7326         element handling.  Instead of having a special RenderHTML object
7327         for dealing with <html>, root element handling is now done in
7328         base classes so that it works with XML documents as well.
7329
7330         The changes include:
7331           * Rename RenderRoot to RenderCanvas to more accurately
7332             reflect what this RenderObject represents in CSS2.
7333           * Rename root() to canvas()
7334           * Rename isHtml() to isRoot()
7335           * Rename isRoot() to isCanvas().
7336           * Eliminate RenderHTML and fold its functionality into base
7337             classes (RenderBlock and RenderBox).
7338           * isRoot() now means "are you the RenderObject for the root
7339             element".  All isHtml() callers now say isRoot() instead.
7340           
7341         Reviewed by gramps
7342
7343         * ForwardingHeaders/rendering/render_canvas.h: Added.
7344         * ForwardingHeaders/rendering/render_html.h: Removed.
7345         * ForwardingHeaders/rendering/render_root.h: Removed.
7346         * WebCore.pbproj/project.pbxproj:
7347         * khtml/ecma/kjs_dom.cpp:
7348         * khtml/ecma/kjs_window.cpp:
7349         * khtml/html/html_baseimpl.cpp:
7350         (HTMLHtmlElementImpl::id):
7351         * khtml/html/html_baseimpl.h:
7352         * khtml/khtmlview.cpp:
7353         (KHTMLView::layout):
7354         (KHTMLView::print):
7355         (KHTMLView::slotPaletteChanged):
7356         (KHTMLView::paint):
7357         (KHTMLView::timerEvent):
7358         * khtml/khtmlview.h:
7359         * khtml/rendering/render_applet.cpp:
7360         * khtml/rendering/render_block.cpp:
7361         * khtml/rendering/render_block.h:
7362         * khtml/rendering/render_body.cpp:
7363         * khtml/rendering/render_box.cpp:
7364         (RenderBox::setStyle):
7365         (RenderBox::paintRootBoxDecorations):
7366         (RenderBox::paintBoxDecorations):
7367         (RenderBox::paintBackgroundExtended):
7368         (RenderBox::containingBlockWidth):
7369         (RenderBox::repaint):
7370         (RenderBox::calcHeight):
7371         (RenderBox::availableHeight):
7372         (RenderBox::calcAbsoluteVertical):
7373         * khtml/rendering/render_box.h:
7374         * khtml/rendering/render_canvas.cpp: Added.
7375         (RenderCanvas::RenderCanvas):
7376         (RenderCanvas::~RenderCanvas):
7377         (RenderCanvas::calcHeight):
7378         (RenderCanvas::calcWidth):
7379         (RenderCanvas::calcMinMaxWidth):
7380         * khtml/rendering/render_canvas.h: Added.
7381         * khtml/rendering/render_container.cpp:
7382         (RenderContainer::removeChildNode):
7383         * khtml/rendering/render_flow.cpp:
7384         * khtml/rendering/render_frames.cpp:
7385         (RenderFrameSet::layout):
7386         (RenderFrameSet::userResize):
7387         * khtml/rendering/render_html.cpp: Removed.
7388         * khtml/rendering/render_html.h: Removed.
7389         * khtml/rendering/render_image.cpp:
7390         (RenderImage::paintObject):
7391         * khtml/rendering/render_layer.cpp:
7392         (RenderLayer::enclosingPositionedAncestor):
7393         (RenderLayer::convertToLayerCoords):
7394         (RenderLayer::constructZTree):
7395         * khtml/rendering/render_layer.h:
7396         * khtml/rendering/render_line.cpp:
7397         * khtml/rendering/render_list.cpp:
7398         (RenderListMarker::paintObject):
7399         * khtml/rendering/render_object.cpp:
7400         (RenderObject::containingBlock):
7401         (RenderObject::canvas):
7402         (RenderObject::container):
7403         (RenderObject::removeFromObjectLists):
7404         (RenderObject::detach):
7405         (RenderObject::nodeAtPoint):
7406         (RenderObject::scheduleRelayout):
7407         * khtml/rendering/render_object.h:
7408         * khtml/rendering/render_replaced.cpp:
7409         * khtml/rendering/render_root.cpp: Removed.
7410         * khtml/rendering/render_root.h: Removed.
7411         * khtml/rendering/render_table.cpp:
7412         (RenderTable::layout):
7413         * khtml/rendering/render_text.cpp:
7414         (RenderText::paintObject):
7415         * khtml/rendering/table_layout.cpp:
7416         (shouldScaleColumns):
7417         * khtml/xml/dom_docimpl.cpp:
7418         (DocumentImpl::attach):
7419         (DocumentImpl::setSelection):
7420         (DocumentImpl::clearSelection):
7421         (DocumentImpl::prepareMouseEvent):
7422         * khtml/xml/dom_elementimpl.cpp:
7423         (ElementImpl::createRenderer):
7424         * khtml/xml/dom_nodeimpl.cpp:
7425         (NodeImpl::rendererIsNeeded):
7426         * kwq/KWQKHTMLPart.mm:
7427         (KWQKHTMLPart::adjustPageHeight):
7428         (KWQKHTMLPart::forceLayoutForPageWidth):
7429         (KWQKHTMLPart::selectionRect):
7430         * kwq/WebCoreBridge.mm:
7431         (-[WebCoreBridge _setupRootForPrinting:]):
7432
7433 2003-05-07  Darin Adler  <darin@apple.com>
7434
7435         Reviewed by John.
7436
7437         - fixed 3127927 -- web view should not use primary selection color when it's not first responder
7438
7439         * kwq/WebCoreBridge.h: Added usesInactiveTextBackgroundColor getter and setter.
7440         * kwq/WebCoreBridge.mm:
7441         (-[WebCoreBridge drawRect:]): Set the QPainter's usesInactiveTextBackgroundColor to match the
7442         value from the part.
7443         (-[WebCoreBridge selectionRect]): Fix nil-deref that happened in the no-KHTMLView case.
7444         (-[WebCoreBridge setUsesInactiveTextBackgroundColor:]): Added.
7445         (-[WebCoreBridge usesInactiveTextBackgroundColor]): Added.
7446
7447         * kwq/KWQKHTMLPart.h: Added usesInactiveTextBackgroundColor, including getter and setter.
7448         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::KWQKHTMLPart): Initialize usesInactiveTextBackgroundColor.
7449
7450         * kwq/KWQPainter.h: Added setUsesInactiveTextBackgroundColor and made selectedTextBackgroundColor
7451         a const member function, not a static one.
7452         * kwq/KWQPainter.mm:
7453         (QPainter::QPainter): Initialize _usesInactiveTextBackgroundColor to false.
7454         (QPainter::selectedTextBackgroundColor): Return secondarySelectedControlColor instead of
7455         selectedTextBackgroundColor if _usesInactiveTextBackgroundColor is true.
7456
7457         * khtml/rendering/render_text.cpp: (TextRun::paintSelection): Call selectedTextBackgroundColor
7458         on the painter object; it's no longer a static member function.
7459
7460         * khtml/rendering/render_root.cpp: (RenderRoot::selectionRect): Fix nil-deref that happened
7461         in the no-selection case.
7462
7463 2003-05-07  Vicki Murley  <vicki@apple.com>
7464
7465         Reviewed by darin.
7466
7467         - modify the Mixed build style to build optimized with symbols
7468
7469         * WebCore.pbproj/project.pbxproj: removed OPTIMIZATION_CFLAGS, use WebCore.exp
7470
7471 2003-05-07  Darin Adler  <darin@apple.com>
7472
7473         Reviewed by Ken.
7474
7475         - fixed 3109258 -- Unicode above U+FFFF not handled correctly when expressed as numeric entities
7476
7477         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::parseEntity): Keep track of the entity in
7478         an unsigned integer that can hold 32 bits rather than a QChar. Convert to a pair of Unicode
7479         surrogate code points if necessary.
7480         
7481         * khtml/misc/stringit.h: Add a second pushed character, used for the case where we have a pair of
7482         surrogate characters for a single numeric entity.
7483
7484         * khtml/html/htmltokenizer.h: Add missing DOM:: that was compiling only due to "using namespace DOM"
7485         in stringit.h. Replace EntityChar with EntityUnicodeValue.
7486
7487 2003-05-06  Darin Adler  <darin@apple.com>
7488
7489         Reviewed by Chris.
7490
7491         - fixed 3211756 -- form field contents on the left instead of right on page in RtL language
7492
7493         * khtml/rendering/render_form.cpp:
7494         (RenderLineEdit::updateFromElement): Call setAlignment based on the style's direction.
7495         (RenderTextArea::updateFromElement): Ditto.
7496         * kwq/KWQLineEdit.h: Added setAlignment.
7497         * kwq/KWQLineEdit.mm: (QLineEdit::setAlignment): Added. Calls setAlignment on KWQTextField.
7498         * kwq/KWQTextArea.h: Added setAlignment.
7499         * kwq/KWQTextArea.mm: (-[KWQTextArea setAlignment:]): Added. Calls setAlignment on NSTextView.
7500         * kwq/KWQTextEdit.h: Added setAlignment.
7501         * kwq/KWQTextEdit.mm: (QTextEdit::setAlignment): Added. Calls setAlignment on KWQTextField.
7502         * kwq/KWQTextField.mm: (-[KWQTextField setAlignment:]): Added. Call setAlignment on secure
7503         text field too.
7504
7505         - fixed 3250538 -- on pages labeled "US-ASCII", non-ASCII chars are not decoded as Latin-1
7506           as in other browsers
7507
7508         * kwq/KWQTextCodec.mm:
7509         (effectiveEncoding): Added. Maps ISO Latin-1 and US-ASCII to Windows Latin-1.
7510         (QTextCodec::fromUnicode): Use effectiveEncoding.
7511         (KWQTextDecoder::convertUsingTEC): Use effectiveEncoding.
7512
7513         - other changes
7514
7515         * kwq/KWQCharsets.mm: (buildDictionaries): Make the first encoding in the file win for
7516         purposes of deciding which name is used. I thought this was happening before, but actually
7517         the last one was winning. Do this by using CFDictionaryAddValue, which does nothing if
7518         there's already a dictionary entry, instead of CFDictionarySetValue, which replaces.
7519
7520 2003-05-06  David Hyatt  <hyatt@apple.com>
7521
7522         Make negative z-index content paint above the background of
7523         the stacking context element that encloses it.  This fixes
7524         gettyimages.com and hotwired.com.
7525         
7526         Reviewed by kocienda
7527
7528         * khtml/css/html4.css:
7529         * khtml/rendering/render_block.cpp:
7530         * khtml/rendering/render_inline.cpp:
7531         (RenderInline::paintObject):
7532         * khtml/rendering/render_layer.cpp:
7533         (RenderLayer::paint):
7534         (RenderLayer::nodeAtPoint):
7535         (RenderLayer::RenderZTreeNode::constructLayerList):
7536         * khtml/rendering/render_layer.h:
7537         * khtml/rendering/render_object.h:
7538         * khtml/rendering/render_root.cpp:
7539         * khtml/rendering/render_table.cpp:
7540         (RenderTable::paint):
7541         * kwq/KWQRenderTreeDebug.cpp:
7542         (write):
7543
7544 2003-05-06  Maciej Stachowiak  <mjs@apple.com>
7545
7546         Reviewed by Darin.
7547
7548         - fixed 3245048 - "Block Pop-Up Windows" can easily be bypassed using javascript: URLs
7549
7550         Closed the loophole by tracking what client redirects were
7551         triggered by user actions, and making sure the script interpreter
7552         knows.
7553
7554         * khtml/ecma/kjs_window.cpp:
7555         (Window::put):
7556         (WindowFunc::tryCall):
7557         (Location::put):
7558         (LocationFunc::tryCall):
7559         * khtml/khtml_part.cpp:
7560         (KHTMLPart::executeScript):
7561         (KHTMLPart::clear):
7562         (KHTMLPart::scheduleRedirection):
7563         (KHTMLPart::slotRedirect):
7564         (KHTMLPart::urlSelected):
7565         * khtml/khtml_part.h:
7566         * khtml/khtmlpart_p.h:
7567         * kwq/WebCoreBridge.mm:
7568         (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]):
7569
7570 2003-05-06  Darin Adler  <darin@apple.com>
7571
7572         Reviewed by Ken.
7573
7574         - used ObjectAlloc to find large numbers of allocations on startup and get rid of some
7575
7576         * kwq/KWQColor.mm: (QColor::getNSColor): Keep a cache of 32 colors instead of returning a new
7577         one each time. Also use special cases for black and white.
7578
7579 2003-05-05  Maciej Stachowiak  <mjs@apple.com>
7580
7581         Reviewed by Dave.
7582
7583         - fixed 3241065 - popcap.com doesn't work in Safari, window.scrollBy fails to work in onLoad
7584
7585         Make sure to do a layout before accessing any window properties or
7586         calling any window functions that require a layout to work
7587         properly.
7588
7589         * khtml/ecma/kjs_window.cpp:
7590         (Window::get):
7591         (WindowFunc::tryCall):
7592         (Window::updateLayout):
7593         * khtml/ecma/kjs_window.h:
7594
7595 2003-05-05  David Hyatt  <hyatt@apple.com>
7596
7597         Fix for 3247722. Make sure the grammar accepts properties with
7598         no values as declarations (albeit bad ones).
7599         
7600         Reviewed by darin
7601
7602         * khtml/css/parser.cpp:
7603         * khtml/css/parser.y:
7604
7605 2003-05-05  David Hyatt  <hyatt@apple.com>
7606
7607         Fix for 3248587.  Refine the crash fix for generated image
7608         content so that we still set the image's intrinsic width
7609         and height properly.
7610         
7611         Reviewed by john
7612
7613         * khtml/rendering/render_image.cpp:
7614         (RenderImage::setPixmap):
7615
7616 2003-05-04  David Hyatt  <hyatt@apple.com>
7617
7618         When using the content property in CSS, you can string together
7619         an intermixed list of strings and image URLs.  The old code
7620         only supported a single image URL, and if you tried to mix
7621         text in with images, you ended up crashing.
7622
7623         The crash bug is 3248172.  The fix is to maintain a list of
7624         ContentData objects instead of just a single object and to
7625         ensure that a whole list of generated content gets made (and
7626         not just a single RenderObject).
7627         
7628         Reviewed by john
7629
7630         * khtml/css/cssstyleselector.cpp:
7631         (applyRule)
7632         * khtml/rendering/render_container.cpp:
7633         (RenderContainer::insertPseudoChild):
7634         * khtml/rendering/render_image.cpp:
7635         (RenderImage::setStyle):
7636         (RenderImage::setContentObject):
7637         (RenderImage::updateFromElement):
7638         * khtml/rendering/render_image.h:
7639         * khtml/rendering/render_style.cpp:
7640         (RenderStyle::setContent):
7641         (ContentData::clearContent):
7642         * khtml/rendering/render_style.h:
7643
7644 2003-05-05  Darin Adler  <darin@apple.com>
7645
7646         Reviewed by John.
7647
7648         - fixed replaceOccurrencesOfString crash reported in bug 3247249 (not what the bug is about)
7649
7650         * kwq/KWQTextArea.mm: (-[KWQTextArea text]): Use the length of the replaced text.
7651
7652 2003-05-04  Darin Adler  <darin@apple.com>
7653
7654         Reviewed by John.
7655
7656         - fixed 3131534 -- "javascript:window.open()" leads to page not found error
7657
7658         * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): For open() calls, if the
7659         first parameter is not present, use "" instead of "undefined" as the URL.
7660
7661         - fixed 3244766 -- window.open() doesn't position window correctly along the y axis
7662
7663         * kwq/KWQKHTMLPartBrowserExtension.mm: (KHTMLPartBrowserExtension::createNewWindow):
7664         Fixed the code that flips the y coordinate to take the window height into account.
7665
7666 2003-05-03  David Hyatt  <hyatt@apple.com>
7667
7668         Add smallCaps boolean to the string drawing and measuring
7669         routines.  WebCore should be done after this patch, with
7670         the rest of the work being done entirely in WebKit.
7671         
7672         Reviewed by darin
7673
7674         * khtml/rendering/font.cpp:
7675         (Font::drawText):
7676         (Font::floatWidth):
7677         (Font::floatCharacterWidths):
7678         (Font::width):
7679         * kwq/KWQFontMetrics.h:
7680         * kwq/KWQFontMetrics.mm:
7681         (QFontMetrics::width):
7682         (QFontMetrics::floatWidth):
7683         (QFontMetrics::floatCharacterWidths):
7684         * kwq/KWQPainter.h:
7685         * kwq/KWQPainter.mm:
7686         (QPainter::drawText):
7687         * kwq/WebCoreTextRenderer.h:
7688
7689 2003-05-03  David Hyatt  <hyatt@apple.com>
7690
7691         Rename layouted to needsLayout.  Add a layoutIfNeeded method
7692         and start using it in places that do if (needsLayout()) layout();
7693         
7694         Reviewed by kocienda
7695
7696         * khtml/ecma/kjs_dom.cpp:
7697         (DOMNode::getValueProperty):
7698         * khtml/html/html_baseimpl.cpp:
7699         (HTMLFrameSetElementImpl::recalcStyle):
7700         * khtml/html/html_documentimpl.cpp:
7701         (HTMLDocumentImpl::close):
7702         * khtml/html/html_imageimpl.cpp:
7703         (HTMLImageElementImpl::width):
7704         (HTMLImageElementImpl::height):
7705         * khtml/html/html_tableimpl.cpp:
7706         (HTMLTableElementImpl::parseAttribute):
7707         * khtml/khtmlview.cpp:
7708         (KHTMLView::layout):
7709         (KHTMLView::print):
7710         (KHTMLView::timerEvent):
7711         * khtml/rendering/bidi.cpp:
7712         * khtml/rendering/render_applet.cpp:
7713         (RenderApplet::layout):
7714         (RenderEmptyApplet::layout):
7715         * khtml/rendering/render_block.cpp:
7716         * khtml/rendering/render_box.cpp:
7717         (RenderBox::close):
7718         * khtml/rendering/render_container.cpp:
7719         (RenderContainer::addChild):
7720         (RenderContainer::removeChildNode):
7721         (RenderContainer::removeChild):
7722         (RenderContainer::appendChildNode):
7723         (RenderContainer::insertChildNode):
7724         (RenderContainer::layout):
7725         * khtml/rendering/render_flow.h:
7726         * khtml/rendering/render_form.cpp:
7727         (RenderFormElement::layout):
7728         (RenderSubmitButton::updateFromElement):
7729         (RenderSelect::updateFromElement):
7730         (RenderSelect::calcMinMaxWidth):
7731         (RenderSelect::layout):
7732         * khtml/rendering/render_frames.cpp:
7733         (RenderFrameSet::layout):
7734         (RenderFrameSet::positionFrames):
7735         (RenderFrameSet::userResize):
7736         (RenderFrameSet::canResize):
7737         (RenderPart::setWidget):
7738         (RenderPartObject::updateWidget):
7739         (RenderPartObject::layout):
7740         * khtml/rendering/render_image.cpp:
7741         (RenderImage::setPixmap):
7742         (RenderImage::layout):
7743         * khtml/rendering/render_inline.cpp:
7744         (RenderInline::addChildToFlow):
7745         (RenderInline::splitInlines):
7746         (RenderInline::splitFlow):
7747         * khtml/rendering/render_layer.cpp:
7748         (RenderLayer::checkScrollbarsAfterLayout):
7749         * khtml/rendering/render_list.cpp:
7750         (RenderListItem::layout):
7751         (RenderListMarker::setStyle):
7752         (RenderListMarker::layout):
7753         (RenderListMarker::setPixmap):
7754         * khtml/rendering/render_object.cpp:
7755         (RenderObject::RenderObject):
7756         (RenderObject::setNeedsLayout):
7757         (RenderObject::information):
7758         (RenderObject::dump):
7759         (RenderObject::setStyle):
7760         (RenderObject::invalidateLayout):
7761         (RenderObject::detach):
7762         * khtml/rendering/render_object.h:
7763         * khtml/rendering/render_replaced.cpp:
7764         (RenderReplaced::paint):
7765         (RenderWidget::setQWidget):
7766         (RenderWidget::layout):
7767         * khtml/rendering/render_root.cpp:
7768         * khtml/rendering/render_table.cpp:
7769         (RenderTable::addChild):
7770         (RenderTable::layout):
7771         (RenderTable::paint):
7772         (RenderTable::close):
7773         (RenderTable::splitColumn):
7774         (RenderTable::appendColumn):
7775         (RenderTable::recalcSections):
7776         (RenderTableSection::addChild):
7777         (RenderTableSection::setCellWidths):
7778         (RenderTableSection::layoutRows):
7779         (RenderTableSection::recalcCells):
7780         (RenderTableRow::addChild):
7781         (RenderTableRow::layout):
7782         (RenderTableCell::paint):
7783         * khtml/rendering/render_text.cpp:
7784         (RenderText::setText):
7785         * khtml/xml/dom_docimpl.cpp:
7786         (DocumentImpl::recalcStyle):
7787         (DocumentImpl::updateStyleSelector):
7788         * khtml/xml/dom_nodeimpl.cpp:
7789         (NodeBaseImpl::insertBefore):
7790         (NodeBaseImpl::replaceChild):
7791         (NodeBaseImpl::appendChild):
7792         * kwq/KWQKHTMLPart.mm:
7793         (KWQKHTMLPart::forceLayoutForPageWidth):
7794         * kwq/WebCoreBridge.mm:
7795         (-[WebCoreBridge needsLayout]):
7796
7797 2003-05-02  Maciej Stachowiak  <mjs@apple.com>
7798
7799         Reviewed by Richard.
7800
7801         - reformatted method prototypes to match AppKit style
7802
7803         * kwq/WebCoreBridge.h:
7804         * kwq/WebCoreDOMPrivate.h:
7805         * kwq/WebCoreHistory.h:
7806         * kwq/WebCoreResourceLoader.h:
7807         * kwq/WebCoreTextRenderer.h:
7808         * kwq/WebDOMDocument.h:
7809         * kwq/WebDOMElement.h:
7810         * kwq/WebDOMNode.h:
7811
7812 2003-05-02  Maciej Stachowiak  <mjs@apple.com>
7813
7814         Reviewed by Darin.
7815
7816         - fixed 2936175 - MALLORY: please implement onResize
7817
7818         * khtml/khtmlview.cpp:
7819         (KHTMLView::resizeEvent): Put most of this in #if !APPLE_CHANGES,
7820         since we already do the relayout and such on resize elswhere.
7821         * kwq/KWQEvent.h: Add a minimal QResizeEvent.
7822         * kwq/KWQKHTMLPart.h:
7823         * kwq/KWQKHTMLPart.mm:
7824         (KWQKHTMLPart::sendResizeEvent): Send it to the view.
7825         * kwq/WebCoreBridge.h:
7826         * kwq/WebCoreBridge.mm:
7827         (-[WebCoreBridge sendResizeEvent]): Send it to the part.
7828
7829 2003-05-02  David Hyatt  <hyatt@apple.com>
7830
7831         Fix for 3184113, bottom margins didn't collapse with their children
7832         like they were supposed to.  The problem is fixed by separately
7833         caching whether or not the top and bottom margins can collapse
7834         with their kids instead of having one global canCollapse variable.
7835         
7836         Reviewed by kocienda
7837
7838         * khtml/rendering/render_block.cpp:
7839
7840 2003-05-02  Darin Adler  <darin@apple.com>
7841
7842         Reviewed by John.
7843
7844         - fixed 3236383 -- http://www.xy.com/ exception, crash loading main page
7845
7846         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::scheduleClose): Change to use closeWindowSoon, so that
7847         the delay is on the WebKit side so it can be tied to the WebView as a whole, not a particular bridge.
7848
7849         * kwq/WebCoreBridge.h: Replaced closeWindow with closeWindowSoon.
7850
7851         - rolled in a couple of harmless and eventually-possibly-useful changes inspired by changes
7852           OmniGroup made in their copy of WebCore
7853
7854         * kwq/KWQListBox.mm: Make KWQTableView a KWQWidgetHolder.
7855         (-[KWQTableView widget]): Return the widget.
7856         * kwq/KWQScrollView.mm: (QScrollView::ensureVisible): First cut at implementing these.
7857
7858 2003-05-02  David Hyatt  <hyatt@apple.com>
7859
7860         Make sure that recalcSections always clears out the needSectionRecalc
7861         boolean, even in the case where it finds column elements.
7862
7863         Fixes the assert outlined in bug 3237651.
7864         
7865         Reviewed by john
7866
7867         * khtml/rendering/render_table.cpp:
7868         (RenderTable::recalcSections):
7869
7870 2003-05-01  David Hyatt  <hyatt@apple.com>
7871
7872         Fix for 3226030, percentage height tables inside table cells
7873         don't grow to fill the space inside the cell.  There was
7874         a missing edge case here for the case where the table was
7875         nested inside a table cell.
7876         
7877         Reviewed by darin
7878
7879         * khtml/rendering/render_table.cpp:
7880         (RenderTable::layout):
7881
7882 2003-05-01  David Hyatt  <hyatt@apple.com>
7883
7884         Add a cycle check when importing stylesheets to prevent
7885         infinite loops.
7886         
7887         Reviewed by john
7888
7889         * khtml/css/css_ruleimpl.cpp:
7890         (CSSImportRuleImpl::init):
7891
7892 2003-05-01  David Hyatt  <hyatt@apple.com>
7893
7894         Table rows don't know their precise dimensions, so repainting
7895         them fails.  For now, just make an invalidation of a table
7896         row due to CSS changes invalidate the whole table.
7897
7898         This is what the old Safari table code used to do prior to the
7899         new table code landing.
7900
7901         Fixes bug #3205092.
7902         
7903         Reviewed by darin/john
7904
7905         * khtml/rendering/render_table.cpp:
7906         (RenderTableRow::repaint):
7907         * khtml/rendering/render_table.h:
7908
7909 2003-05-01  David Hyatt  <hyatt@apple.com>
7910
7911         Fix for 3232637, don't let generated parentless image content
7912         try to do width/height/layout calculations.  It will do this
7913         all anyway, when it finally gets inserted into the rendering
7914         tree.
7915         
7916         Reviewed by john
7917
7918         * khtml/rendering/render_image.cpp:
7919         (RenderImage::setPixmap):
7920
7921 2003-05-01  David Hyatt  <hyatt@apple.com>
7922
7923         Fix for 3239404, a crash caused because a block-level :after
7924         element was being inserted as generated content inside an
7925         inline element.
7926
7927         The fix is to mutate the display of the generated content to
7928         be inline when the parent of the generated content is also
7929         inline. 
7930
7931         Section 12.1 of the CSS2 spec (at the very end of the spec)
7932         covers this special case.  Once we do the mutation it becomes
7933         impossible for generated content to cause a splitFlow, and so
7934         the crash is plugged.
7935         
7936         Reviewed by john
7937
7938         * khtml/rendering/render_container.cpp:
7939         (RenderContainer::insertPseudoChild):
7940
7941 2003-05-01  David Hyatt  <hyatt@apple.com>
7942
7943         Replace effectiveWidth and effectiveHeight with a 
7944         parameterized overflowWidth/Height, since this is much better
7945         terminology.
7946
7947         Also fix event handling so that it no longer assumes (incorrectly)
7948         that being inside the overflow rect of an object means you are
7949         inside the object.  Now there are two separate checks, with the
7950         overflow check being used only to figure out if you should check
7951         inside your kids.
7952         
7953         Reviewed by darin
7954
7955         * khtml/rendering/render_block.cpp:
7956         * khtml/rendering/render_block.h:
7957         * khtml/rendering/render_box.cpp:
7958         (RenderBox::repaint):
7959         * khtml/rendering/render_flow.cpp:
7960         (RenderFlow::repaint):
7961         * khtml/rendering/render_object.cpp:
7962         (RenderObject::nodeAtPoint):
7963         * khtml/rendering/render_object.h:
7964         * khtml/rendering/render_table.h:
7965
7966 === Safari-77 ===
7967
7968 2003-04-30  David Hyatt  <hyatt@apple.com>
7969
7970         Fix for 3244157, giantrobot.com misrenders with a lot of
7971         vertical space.  Overflow heights were being miscomputed for
7972         overflow:auto blocks.
7973         
7974         Reviewed by gramps
7975
7976         * khtml/rendering/render_block.cpp:
7977         * khtml/rendering/render_block.h:
7978
7979 2003-04-30  David Hyatt  <hyatt@apple.com>
7980
7981         Fix for 3210725, invalid n/a selector treated as valid.  This
7982         fix also makes the CSS1 test on the test suite for forward-compatible
7983         parsing completely pass (yay!), which was an issue on
7984         diveintomark's list.
7985
7986         Reviewed by gramps
7987
7988         * khtml/css/parser.cpp:
7989         * khtml/css/parser.y:
7990
7991 2003-04-30  David Hyatt  <hyatt@apple.com>
7992
7993         Fixes for 3227983 and 3224521, both bugs involving bad letter-spacing
7994         property values.  This fixes all Movable Type blogs that had this
7995         error in their stylesheets.
7996         
7997         Reviewed by gramps
7998
7999         * khtml/css/parser.cpp:
8000         * khtml/css/parser.y:
8001
8002 2003-04-30  Darin Adler  <darin@apple.com>
8003
8004         Reviewed by Maciej.
8005
8006         - fixed 3233819 -- MALLORY: onChange handler being called on SELECT even if selected item does not change
8007
8008         * kwq/KWQComboBox.h: Added _currentItem variable, updateCurrentItem function, and replaced
8009         activated function with itemSelected function.
8010         
8011         * kwq/KWQComboBox.mm:
8012         (QComboBox::QComboBox): Call updateCurrentItem so _currentItem is up to date.
8013         (QComboBox::insertItem): Ditto.
8014         (QComboBox::clear): Ditto.
8015         (QComboBox::setCurrentItem): Ditto.
8016         (QComboBox::updateCurrentItem): Added. Returns true if current item has changed since the last time
8017         the function was called.
8018         (QComboBox::itemSelected): Only send the activate method if updateCurrentItem returns true.
8019         (-[KWQComboBoxAdapter action:]): Call itemSelected instead of calling activated directly.
8020
8021 2003-04-29  David Hyatt  <hyatt@apple.com>
8022
8023         Fix for the Adam Rice float/padding test on diveintomark's list
8024         of bugs.  We weren't adding in the parent's border/padding in
8025         one case in the clearFloats function, which resulted in the
8026         float being incorrectly positioned.
8027         
8028         Reviewed by darin
8029
8030         * khtml/rendering/render_block.cpp:
8031
8032 2003-04-29  David Hyatt  <hyatt@apple.com>
8033
8034         This patch fixes the following bugs:
8035
8036         (1) 3186174 - padding-left improperly applied to list items.
8037         The fix is in render_list.cpp and involves adding in the
8038         list item's border and padding so that outside markers end up
8039         outside the border box instead of just inside the padding box.
8040
8041         (2) 3239571 - a stray !important after a ; causes the CSS parser
8042         to choke.  This patch adds a rule to parser.y to deal with
8043         !importants found in between property values and to just ignore
8044         them.
8045
8046         (3) 3170647 - positioned boxes with auto widths ended up adding
8047         in their border/padding twice!  Make sure that when 
8048         calcAbsoluteHorizontal in render_box.cpp examines m_maxWidth that
8049         it subtracts out the border and padding and looks at content width.
8050
8051         (4) 3186165 - Negative padding values were being incorrectly
8052         honored by Safari.  A patch to css_styleselector.cpp checks to
8053         see if the value specified by the rule is negative, and if so
8054         the rule is not applied.
8055
8056         (5) 3132172 - The clip property could not be accessed via script
8057         because the cssText routine for CSS_RECT primitive values had
8058         not been implemented.  In css_valueimpl.cpp this code has now been
8059         filled in.
8060         
8061         Reviewed by mjs
8062
8063         * khtml/css/css_valueimpl.cpp:
8064         (CSSPrimitiveValueImpl::cssText):
8065         * khtml/css/cssstyleselector.cpp:
8066         * khtml/css/parser.cpp:
8067         * khtml/css/parser.y:
8068         * khtml/rendering/render_box.cpp:
8069         (RenderBox::calcAbsoluteHorizontal):
8070         * khtml/rendering/render_list.cpp:
8071         (RenderListMarker::paintObject):
8072
8073 2003-04-29  David Hyatt  <hyatt@apple.com>
8074
8075         Fix for 3226138, crash on canada.gc.ca.  Make sure a failed
8076         @media parse doesn't crash by adding a null check.
8077         
8078         Reviewed by mjs
8079
8080         * khtml/css/parser.cpp:
8081         * khtml/css/parser.y:
8082
8083 2003-04-29  David Hyatt  <hyatt@apple.com>
8084
8085         The remainder of the overflow:auto patch.
8086
8087         A minor table cell optimization has also been included.
8088
8089         Also fixing one of rjw's inline table bugs.  Inline tables
8090         didn't clear their minmaxwidth bool when contents inside them
8091         changed size.
8092         
8093         r=mjs/gramps on overflow:auto stuff
8094         r=rjw on the table stuff
8095
8096         * khtml/html/html_tableimpl.cpp:
8097         (HTMLTableElementImpl::parseAttribute):
8098         * khtml/rendering/render_block.cpp:
8099         * khtml/rendering/render_block.h:
8100         * khtml/rendering/render_layer.cpp:
8101         (RenderLayer::checkScrollbarsAfterLayout):
8102         * khtml/rendering/render_object.cpp:
8103         (RenderObject::nodeAtPoint):
8104         * khtml/rendering/render_table.cpp:
8105         (RenderTableCell::layout):
8106         * khtml/rendering/render_table.h:
8107
8108 2003-04-29  Darin Adler  <darin@apple.com>
8109
8110         Reviewed by John.
8111
8112         - fixed 3234633 -- page with moderately deep tag nesting causes crash when closed (www.4strokenationals.com)
8113
8114         * khtml/xml/dom_nodeimpl.cpp: (NodeBaseImpl::~NodeBaseImpl): Avoid recursion by using a global
8115         list of child nodes to destroy and only doing the actual destruction at the top level.
8116
8117 2003-04-29  Darin Adler  <darin@apple.com>
8118
8119         Mostly reviewed by Ken, some bits reviewed by John.
8120
8121         - fixed 3188781 -- eliminate globally initialized objects from WebCore
8122
8123         * kwq/KWQString.h: Change QChar::null to be a char constant, and QString::null to be a const char *.
8124         In the cases where the code still compiles after these changes, everything works fine. A few cases
8125         that didn't compile are fixed below.
8126         * kwq/KWQString.mm: Remove QString::null.
8127         (QString::mid): Return QString() instead of null.
8128         * kwq/KWQChar.mm: Remove the definition of QChar::null.
8129
8130         * khtml/css/css_base.cpp: (CSSSelector::extractPseudoType): Use DOMString explicitly in one place
8131         where the code said QString::null. The trick where QString::null is really a const char * does not
8132         work in this case.
8133         * khtml/khtml_part.cpp: (KHTMLPart::reparseConfiguration): Use QString() instead of QString::null
8134         in one place. The trick where QString::null is really a const char * does not work in this case.
8135         * kwq/KWQKHTMLSettings.h: Use QString() for settingsToCSS, the trick where QString::null is really
8136         a const char * does not work in this case.
8137         * khtml/rendering/render_list.cpp: (RenderListMarker::paintObject): Use an isEmpty check here instead
8138         of comparing with QString::null. Not sure this change was strictly required, but it is simpler and
8139         may also make the code slightly faster.
8140
8141         * kwq/KWQKFileDialog.h: Removed. This used QString::null in a way that is incompatible with the new
8142         "0" hack, but was not used any more.
8143         * kwq/KWQKFileDialog.mm: Removed.
8144         * ForwardingHeaders/kfiledialog.h: Empty this out, since there is no KWQKFileDialog.h any more.
8145         * WebCore.pbproj/project.pbxproj: Removed KWQKFileDialog.h and .mm.
8146        
8147         * khtml/html/htmltokenizer.cpp: Change the commentStart global array to be an array of char instead
8148         of QChar to avoid the static constructor; the code works fine with char anyway.
8149         * khtml/html/html_formimpl.cpp: Change the global constants in this file to be char instead of QChar.
8150         It works this way (and faster for KWQ), and avoids the static constructor.
8151
8152         * khtml/rendering/bidi.h: Change BidiIterator from a class with constructors into a plain struct.
8153         The copy construct and assignment operator weren't needed anyway since they simply duplicated default
8154         assignment, and if we have a constructor then we can't use it as a global object, since we want to
8155         avoid static constructors. Do the same with BidiStatus, and also stop using bit fields. It's silly to
8156         use bit fields for something when we have only one global instance of it; just makes extra code size
8157         and saves a few bytes.
8158         * khtml/rendering/bidi.cpp:
8159         (BidiIterator::current): Move the non-breaking space global inside this function.
8160         (appendRunsForObject): Initialize BidiIterator object using brace notation.
8161         (buildCompactRuns): Initialize BidiIterator objects using brace notation and assignment.
8162         (RenderBlock::layoutInlineChildren): Initialize BidiStatus fields separately. Initialize BidiIterator
8163         objects using brace notation and assignment.
8164         (RenderBlock::findNextLineBreak): Initialize BidiIterator objects using brace notation and assignment.
8165
8166         * khtml/rendering/render_frames.cpp: Removed an include of <iostream.h>. This pulled the entire
8167         C++ I/O library in, with lots of static constructors. Elsewhere, we are careful not to use the C++
8168         I/O library in WebCore except in Development versions. And this file didn't actually use the library,
8169         just included the header.
8170
8171         * kwq/KWQNamespace.h: Remove all the color globals except for the ones used in KHTML: black, white,
8172         darkGray, gray, and lightGray. And for those, make the globals RGB constants instead of QColor objects.
8173         This gets rid of the global objects with constructors and works without any KHTML code changes.
8174         * kwq/KWQColor.mm: Remove the definition of the QColor constants from the Qt class.
8175
8176         * kwq/KWQPainter.h: Add overloads for setPen and setBrush so they work with the "color" constants
8177         from Qt that are now RGB constants rather than QColor objects.
8178         * kwq/KWQPainter.mm:
8179         (QPainter::setPen): Set style to solid line and width to 0 when the parameter is an RGB constant.
8180         This is just like what you'd get if you constructed a QPen.
8181         (QPainter::setBrush): Set style to solid pattern when the parameter is an RGB constant.
8182         This is just like what you'd get if you constructed a QBrush.
8183         
8184         * khtml/misc/loader.h: Change m_LRULists to be a global pointer instead of a global array, so
8185         we don't have to statically construct LRUList objects.
8186         * khtml/misc/loader.cpp: (Cache::getLRUListFor): Allocate the global array the first time we
8187         pass through here.
8188
8189 2003-04-29  Darin Adler  <darin@apple.com>
8190
8191         Reviewed by Ken.
8192
8193         - fixed 3242460 -- crash in NSPopUpButtonCell at acheter-moins-cher.com
8194
8195         * kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
8196         Defer QObject timers too as well as loading while tracking a pop-up.
8197         
8198         * kwq/KWQObject.h: Add defersTimers and setDefersTimers functions.
8199         * kwq/KWQObject.mm:
8200         (QObject::setDefersTimers): Added. When called with true starts deferring timers. When called
8201         with false schedules a "delay 0" task to deliver all the timers and stop deferring them.
8202         (-[KWQObjectTimerTarget sendTimerEvent]): Added. Contains guts of the old timerFired method.
8203         (-[KWQObjectTimerTarget timerFired]): Puts timer on the deferred timers list or calls sendTimerEvent.
8204         (+[KWQObjectTimerTarget stopDeferringTimers]): Remove timers items from the deferred timers list,
8205         and makes them fire, then stops deferring timers.
8206
8207         * WebCore.pbproj/project.pbxproj: Reorder things a bit.
8208
8209 2003-04-29  Darin Adler  <darin@apple.com>
8210
8211         Reviewed by Ken.
8212
8213         - fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
8214
8215         * khtml/rendering/render_style.cpp: (RenderStyle::setContent):
8216         Change code around so we don't deref the text object without checking
8217         the contentType. Also fix the leak of a DOMStringImpl in the case
8218         where we are asked to add a string, but the string pointer is 0.
8219
8220 2003-04-28  Richard Williamson  <rjw@apple.com>
8221
8222         API changes from final review meeting.
8223         
8224         goBackOrForwardToItem: -> goToBackForwardItem:
8225         drop "Window" from WebUIDelegate method names.
8226         WebElementIsSelectedTextKey -> WebElementIsSelectedKey
8227         Cross-frame searchFor on WebView now public.
8228         
8229         Reviewed by Chris.
8230
8231         * kwq/WebCoreBridge.h:
8232         * kwq/WebCoreBridge.mm:
8233
8234 2003-04-28  Darin Adler  <darin@apple.com>
8235
8236         Reviewed by John.
8237
8238         - re-fixed 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
8239
8240         * khtml/html/html_formimpl.cpp:  (HTMLInputElementImpl::attach): Only set the type
8241         if JavaScript hasn't set it explicitly already.
8242
8243 2003-04-25  David Hyatt  <hyatt@apple.com>
8244
8245         Part two of the overflow patch.  This adds the scrollbars and
8246         patches the layers code, but it doesn't yet turn on the
8247         overflow:auto capability.
8248         
8249         Reviewed by mjs/gramps
8250
8251         * ForwardingHeaders/qscrollbar.h: Added.
8252         * WebCore.pbproj/project.pbxproj:
8253         * khtml/ecma/kjs_dom.cpp:
8254         (DOMNode::getValueProperty):
8255         (DOMNode::putValue):
8256         * khtml/ecma/kjs_dom.h:
8257         * khtml/ecma/kjs_dom.lut.h:
8258         * khtml/rendering/render_box.cpp:
8259         (RenderBox::contentWidth):
8260         (RenderBox::repaintRectangle):
8261         (RenderBox::calcAbsoluteHorizontal):
8262         (RenderBox::calcAbsoluteVertical):
8263         (RenderBox::lowestPosition):
8264         * khtml/rendering/render_layer.cpp:
8265         (RenderScrollMediator::slotValueChanged):
8266         (RenderLayer::RenderLayer):
8267         (RenderLayer::~RenderLayer):
8268         (RenderLayer::updateLayerPosition):
8269         (RenderLayer::scrollOffset):
8270         (RenderLayer::subtractScrollOffset):
8271         (RenderLayer::scrollToOffset):
8272         (RenderLayer::updateScrollPositionFromScrollbars):
8273         (RenderLayer::setHasHorizontalScrollbar):
8274         (RenderLayer::setHasVerticalScrollbar):
8275         (RenderLayer::verticalScrollbarWidth):
8276         (RenderLayer::horizontalScrollbarHeight):
8277         (RenderLayer::moveScrollbarsAside):
8278         (RenderLayer::positionScrollbars):
8279         (RenderLayer::checkScrollbarsAfterLayout):
8280         (RenderLayer::paintScrollbars):
8281         (RenderLayer::paint):
8282         (RenderLayer::nodeAtPoint):
8283         * khtml/rendering/render_layer.h:
8284         * khtml/rendering/render_object.cpp:
8285         (RenderObject::clientWidth):
8286         (RenderObject::clientHeight):
8287         (RenderObject::scrollWidth):
8288         (RenderObject::scrollHeight):
8289         (RenderObject::nodeAtPoint):
8290         * khtml/rendering/render_object.h:
8291         * kwq/KWQKHTMLPart.h:
8292         * kwq/KWQKHTMLPart.mm:
8293         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
8294         * kwq/KWQNamespace.h:
8295         * kwq/KWQScrollBar.h: Added.
8296         * kwq/KWQScrollBar.mm: Added.
8297         (-[KWQScrollBar initWithQScrollBar:]):
8298         (-[KWQScrollBar scroll:]):
8299         (:m_valueChanged):
8300         (QScrollBar::~QScrollBar):
8301         (QScrollBar::setValue):
8302         (QScrollBar::setSteps):
8303         (QScrollBar::setKnobProportion):
8304         (QScrollBar::scrollbarHit):
8305         (QScrollBar::valueChanged):
8306         * kwq/KWQSlot.mm:
8307         (KWQSlot::KWQSlot):
8308         (KWQSlot::call):
8309
8310 2003-04-24  David Hyatt  <hyatt@apple.com>
8311
8312         Rename inQuirksMode to inCompatMode.  Drop uses of it in 
8313         the render tree code in favor of style()->htmlHacks().
8314
8315         Remove dead code in the parser dealing with discarded attributes.
8316
8317         Optimize bidi run justification by adding a guard.
8318
8319         Fix :target to not match :root when no fragment ID is specified.
8320         
8321         Reviewed by mjs/gramps
8322
8323         * khtml/css/cssstyleselector.cpp:
8324         * khtml/html/html_baseimpl.cpp:
8325         (HTMLBodyElementImpl::parseAttribute):
8326         * khtml/html/html_headimpl.cpp:
8327         (HTMLLinkElementImpl::setStyleSheet):
8328         (HTMLStyleElementImpl::childrenChanged):
8329         * khtml/html/html_tableimpl.cpp:
8330         (HTMLTableElementImpl::createSharedCellDecls):
8331         * khtml/html/htmlparser.cpp:
8332         (KHTMLParser::~KHTMLParser):
8333         (KHTMLParser::reset):
8334         (KHTMLParser::parseToken):
8335         (KHTMLParser::insertNode):
8336         * khtml/html/htmlparser.h:
8337         * khtml/html/htmltokenizer.cpp:
8338         (HTMLTokenizer::parseTag):
8339         * khtml/khtml_part.cpp:
8340         (KHTMLPart::gotoAnchor):
8341         * khtml/rendering/bidi.cpp:
8342         * khtml/rendering/render_block.cpp:
8343         * khtml/rendering/render_flow.cpp:
8344         (RenderFlow::paintLineBoxDecorations):
8345         (RenderFlow::repaint):
8346         * khtml/rendering/render_inline.cpp:
8347         * khtml/rendering/render_inline.h:
8348         * khtml/rendering/render_list.cpp:
8349         (getParentOfFirstLineBox):
8350         * khtml/rendering/render_object.cpp:
8351         (RenderObject::createObject):
8352         * khtml/rendering/render_text.cpp:
8353         (RenderText::paintObject):
8354         * khtml/xml/dom_docimpl.cpp:
8355         (DocumentImpl::DocumentImpl):
8356         (DocumentImpl::recalcStyle):
8357         (DocumentImpl::recalcStyleSelector):
8358         * khtml/xml/dom_docimpl.h:
8359         * khtml/xml/dom_elementimpl.cpp:
8360         (ElementImpl::createDecl):
8361
8362 2003-04-24  Darin Adler  <darin@apple.com>
8363
8364         Reviewed by Chris.
8365
8366         - fixed 3210096 -- server identifies page as UTF-8, page identifies itself as windows-1252, server must win
8367         - fixed 3105796 -- www.thai.com does not display with correct encoding (<body> tag in comment before <meta>)
8368
8369         * khtml/khtml_part.cpp:
8370         (KHTMLPart::write): Pass in an EncodingType rather than just a boolean. This lets us tell
8371         the difference between EncodingFromHTTPHeader (which wins out over an encoding in a meta tag)
8372         and DefaultEncoding (which loses).
8373         (KHTMLPart::setEncoding): Put ifdef around the whole function. We use our own version in
8374         KWQKHTMLPart instead.
8375         
8376         * khtml/misc/decoder.h: Defined an EncodingType and changed the parameter to setEncoding to take
8377         it instead of force and 8-bit-only parameters. Store it in m_type and get rid of haveEncoding.
8378         * khtml/misc/decoder.cpp:
8379         (Decoder::Decoder): Set m_type to DefaultEncoding.
8380         (Decoder::setEncoding): Take a type parameter, instead of force and 8-bit-only parameters.
8381         Use "eight-bit-only" mode for EncodingFromMetaTag only. Fix code so we don't clobber an existing
8382         codec if we can't find a new one in a simpler way. Store the type in m_type, rather than using
8383         the confusing "haveEncoding" flag.
8384         (skipComment): Added. Used to skip comments found in the <head> section.
8385         (Decoder::decode): Moved the check for the UTF-16 BOM out and do that check even when we have
8386         an encoding (although not if we have one the user chose). Update check so that we look for a meta
8387         tag when we have nothing except a default encoding. This fixes the bug where we have an encoding
8388         from an HTTP header; in that case we do not want to look at the meta tag. Improve performance a bit
8389         by not constructing a string just so we can append the data. Merged the APPLE_CHANGES case a bit
8390         with the original case better. Added code to skip comments; this fixes the thai.com issue. Improved
8391         the code to handle data after the first buffer full. We now avoid putting data into a QString once
8392         we are past the header. Extended an APPLE_CHANGES ifdef to exclude more code we don't need.
8393
8394         * kwq/KWQKHTMLPart.h: Added setEncoding and addData to replace slotData.
8395         * kwq/KWQKHTMLPart.mm:
8396         (KWQKHTMLPart::setEncoding): Added. Needs to be called only once and does the first-time work as
8397         well as setting up the encoding for the page. In practice it is called before each time addData is.
8398         (KWQKHTMLPart::addData): Added. Needs to be called for each run of data. Now just calls write(),
8399         but does some assertions, which is why I have not removed it and changed the bridge to call write().
8400         
8401         * kwq/WebCoreBridge.h: Replaced the old addData:withEncoding: and addData:withOverrideEncoding: with
8402         setEncoding:userChosen: and addData:.
8403         * kwq/WebCoreBridge.mm:
8404         (-[WebCoreBridge setEncoding:userChosen:]): Call setEncoding on the part.
8405         (-[WebCoreBridge addData:]): Call addData on the part.
8406
8407 2003-04-24  Darin Adler  <darin@apple.com>
8408
8409         Reviewed by John.
8410
8411         - improved the text encoding database
8412
8413         * kwq/mac-encodings.txt: Changed to a new format. Now the first encoding name in every list
8414         is the "canonical" one and is in canonical case and punctuation (no longer requiring lowercase).
8415         Since the first is the one that will be used outgoing to send to servers, it's good to have
8416         that one in canonical form. All subsequent aliases in the list are now required to be all
8417         lowercase and not use any punctuation. Since the comparison is done ignoring non-alphanumeric
8418         characters, and ignoring case, this will have no effect on which encodings are recognized.
8419         
8420         * kwq/make-charset-table.pl: Updated to enforce the new format rules.
8421
8422         * kwq/KWQCharsetData.c: Regenerated.
8423
8424         * khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData): Simplify the "change commas
8425         to spaces" code in a way that lets us get rid of APPLE_CHANGES. Use the official "ISO-8859-1"
8426         here instead of something almost, but not quite, like it.
8427         * kwq/KWQKCharsets.mm: (KCharsets::codecForName): Use the official "ISO-8859-1" here instead
8428         of the unofficial "latin1". Unimportant, but cleaner this way.
8429
8430         - preparation for some text encoding changes to fix some bugs
8431
8432         * kwq/KWQKHTMLSettings.h: Added an encoding value rather than always returning a hardcoded
8433         value. Other minor cleanup.
8434         * kwq/KWQKHTMLSettings.mm: Removed.
8435         * WebCore.pbproj/project.pbxproj: Removed KWQKHTMLSettings.mm.
8436
8437         - other changes
8438
8439         * kwq/KWQKHTMLPart.h: Removed "using" statement. Headers must not pollute the namespace
8440         by doing "using".
8441         * khtml/khtml_part.cpp: Added a "using" here.
8442         * kwq/KWQPageState.mm: Added a "using" here.
8443         
8444         * kwq/KWQString.h: Added an append that takes a const char * and length for use by the decoder.
8445         * kwq/KWQString.mm: (QString::append): Implemented it.
8446
8447         * kwq/WebCoreSettings.h: Added default text encoding field and methods.
8448         * kwq/WebCoreSettings.mm:
8449         (-[WebCoreSettings dealloc]): Release defaultTextEncoding.
8450         (-[WebCoreSettings setDefaultTextEncoding:]): Added.
8451         (-[WebCoreSettings defaultTextEncoding]): Added.
8452
8453 === Safari-75 ===
8454
8455 2003-04-24  John Sullivan  <sullivan@apple.com>
8456
8457         - fixed 3151501 -- Toggling "Check Spelling As You Type" in a
8458         textarea should affect future textareas
8459
8460         Reviewed by Darin
8461
8462         * kwq/KWQTextArea.mm:
8463         (+[KWQTextAreaTextView _setContinuousSpellCheckingEnabledForNewTextAreas:]):
8464         new method, sets a static variable and an NSUserDefault
8465         (+[KWQTextAreaTextView _isContinuousSpellCheckingEnabledForNewTextAreas]):
8466         new method, checks a static variable, reading it from an NSUserDefault the
8467         first time
8468         (-[KWQTextAreaTextView initWithFrame:textContainer:]):
8469         override designated initializer to set continuous spell checking if appropriate
8470         (-[KWQTextAreaTextView setContinuousSpellCheckingEnabled:]):
8471         call _setContinuousSpellCheckingEnabledForNewTextAreas in addition to
8472         setting the value for this object
8473
8474 2003-04-23  Darin Adler  <darin@apple.com>
8475
8476         Reviewed by Ken.
8477
8478         - fixed 3237301 -- REGRESSION: text fields with size greater than maxlength are sized according to maxlength
8479
8480         * kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth): Override the maximum length
8481         for this operation.
8482
8483         - fixed 3236961 -- setting innerHTML with input elements doesn't set up value properly
8484
8485         To fix this, I rolled in the changes from the trunk of KHTML development that get rid of
8486         the init() function and do the work in either attach() or insertedIntoDocument() instead.
8487
8488         * khtml/html/html_baseimpl.h: Removed init overrides, added insertedIntoDocument override.
8489         * khtml/html/html_baseimpl.cpp:
8490         (HTMLBodyElementImpl::insertedIntoDocument): Moved HTMLBodyElementImpl::init code here.
8491         (HTMLFrameElementImpl::attach): Moved HTMLFrameElementImpl::init code here.
8492         (HTMLFrameSetElementImpl::attach): Moved HTMLFrameSetElementImpl::init code here.
8493
8494         * khtml/html/html_formimpl.h: Added m_inited flag, removed init overrides, removed unused
8495         m_encCharset field.
8496         * khtml/html/html_formimpl.cpp:
8497         (HTMLFormElementImpl::formData): Removed code that set m_encCharset.
8498         (HTMLFormElementImpl::setEnctype): Removed code that set m_encCharset.
8499         (HTMLInputElementImpl::HTMLInputElementImpl): Initialize m_inited to false.
8500         (HTMLInputElementImpl::attach): Moved HTMLInputElementImpl::init code here, guarded by
8501         m_inited.
8502         (HTMLSelectElementImpl::attach): Moved HTMLSelectElementImpl::init code here.
8503         (HTMLTextAreaElementImpl::attach): Moved HTMLTextAreaElementImpl::init code here.
8504
8505         * khtml/xml/dom_nodeimpl.h: Removed init.
8506         * khtml/xml/dom_nodeimpl.cpp: Removed init.
8507
8508         * khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Removed calls to init.
8509         * khtml/xml/xml_tokenizer.cpp:
8510         (XMLHandler::startElement): Removed call to init.
8511         (XMLHandler::startCDATA): Removed call to init.
8512         (XMLHandler::exitText): Removed call to init.
8513
8514 2003-04-22  Darin Adler  <darin@apple.com>
8515
8516         Reviewed by Maciej.
8517
8518         - fixed 3158411 -- radio button groups are per-form in WebCore, per-page in other browsers (flyglobespan.com)
8519
8520         * khtml/html/html_formimpl.h: Removed radioClicked. Made setName virtual and make
8521         HTMLInputElementImpl override it. Added isCheckedRadioButtonForDocument,
8522         addCheckedRadioButtonToDocument, and removeCheckedRadioButtonFromDocument.
8523         * khtml/html/html_formimpl.cpp:
8524         (HTMLInputElementImpl::~HTMLInputElementImpl): Call removeCheckedRadioButtonFromDocument.
8525         (HTMLInputElementImpl::setType): Call removeCheckedRadioButtonFromDocument before changing
8526         the type and addCheckedRadioButtonToDocument after.
8527         (HTMLInputElementImpl::parseAttribute): Call removeCheckedRadioButtonFromDocument before changing
8528         ATTR_NAME and addCheckedRadioButtonToDocument after.
8529         (HTMLInputElementImpl::setChecked): Call removeCheckedRadioButtonFromDocument before changing
8530         the checked state and addCheckedRadioButtonToDocument after.
8531         (HTMLInputElementImpl::setName): Call removeCheckedRadioButtonFromDocument before changing
8532         the name and addCheckedRadioButtonToDocument after.
8533         (HTMLInputElementImpl::isCheckedRadioButtonForDocument): Added. Checks if this element should
8534         be the one known to the document.
8535         (HTMLInputElementImpl::addCheckedRadioButtonToDocument): Call addCheckedRadioButton on the
8536         document if isCheckedRadioButtonForDocument returns true.
8537         (HTMLInputElementImpl::removeCheckedRadioButtonFromDocument): Call
8538         removeCheckedRadioButtonFromDocument on the document if isCheckedRadioButtonForDocument
8539         returns true.
8540         
8541         * khtml/xml/dom_docimpl.h: Add addCheckedRadioButton, removeCheckedRadioButton, and
8542         m_checkedRadioButtons.
8543         * khtml/xml/dom_docimpl.cpp:
8544         (DocumentImpl::addCheckedRadioButton): Uncheck the old radio button with this name, if any.
8545         Store the new radio button in the "checked radio buttons" map.
8546         (DocumentImpl::removeCheckedRadioButton): Remove the radio button from the map.
8547
8548 2003-04-22  Darin Adler  <darin@apple.com>
8549
8550         * khtml/html/html_formimpl.h: Remove radioClicked.
8551         * khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::setChecked): When unchecking other
8552         input elements with the same name, traverse the entire document, not just the form.
8553
8554 2003-04-22  Darin Adler  <darin@apple.com>
8555
8556         Reviewed by John.
8557
8558         - fixed 3144966 -- problems typing in form at http://www.mobile.att.net/messagecenter
8559
8560         The bug was that doing a focus would always select the entire contents of the field.
8561         While this behavior does match Mozilla's behavior for text fields, it doesn't match
8562         WinIE; we're going to imitate WinIE and not do it. Also fix the same issue for text areas.
8563
8564         * kwq/KWQTextField.h: Add lastSelectedRange field.
8565         * kwq/KWQTextField.mm:
8566         (-[KWQTextField initWithFrame:]): Initialize lastSelectedRange (to nothing).
8567         (-[KWQTextField initWithQLineEdit:]): Use [self init] instead of [super init]. The same
8568         thing, but you should never call [super xxx] where xxx is a non-designated initializer
8569         of the superclass.
8570         (-[KWQTextField currentEditorForEitherField]): Added. Returns the current editor of either
8571         the text field or the secure text field.
8572         (-[KWQTextField selectedRange]): Added.
8573         (-[KWQTextField setSelectedRange:]): Added.
8574         (-[KWQTextField controlTextDidEndEditing:]): Store the selected text range in the
8575         lastSelectedRange variable, so it can be used later. Also move the code that sends the
8576         FocusOut event here.
8577         (-[KWQTextField control:textShouldBeginEditing:]): Do the "scroll frame into view" here
8578         isntead of in becomeFirstResponder so it can be shared.
8579         (-[KWQTextField control:textShouldEndEditing:]): Moved FocusOut to controlTextDidEndEditing:.
8580         (-[KWQTextField didBecomeFirstResponder]): Added. Sets the selected range back to what it
8581         was in textShouldEndEditing, but only if we are not tabbing into the field. If we don't set
8582         the selected range, then we inherit the behavior from NSTextField, all text selected.
8583         We can't do the selected range work in textDidEndEditing because that's called too early.
8584         (-[KWQTextField becomeFirstResponder]): Call didBecomeFirstResponder.
8585         (-[KWQSecureTextField currentEditorForSecureField]): Added. Factored out of selectText:.
8586         (-[KWQSecureTextField selectText:]): Use currentEditorForSecureField for clarity.
8587         (-[KWQSecureTextField becomeFirstResponder]): Call didBecomeFirstResponder.
8588
8589         * kwq/KWQTextArea.mm:
8590         (-[KWQTextArea _createTextView]): Rearrange a bit.
8591         (-[KWQTextArea setWordWrap:]): Ditto.
8592         (-[KWQTextAreaTextView becomeFirstResponder]): Only do the selectAll: operation here
8593         if we are tabbing into the field. Otherwise keep the selection from last time.
8594         
8595         * khtml/rendering/render_form.cpp: (RenderTextArea::updateFromElement): Don't do the
8596         whole "save cursor position, set text, restore cursor position" dance for the case
8597         where the field already has the correct contents. Without this change, selections can be
8598         collapsed to an insertion point at the start of the selection at seemingly random times.
8599         
8600         * khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): Don't deselect the currently
8601         focused node on mouse down. This created a symptom where a text field would lose
8602         focus when you clicked on a button.
8603         
8604         * kwq/KWQLineEdit.h: Remove unused frame() method.
8605         * kwq/KWQLineEdit.mm: Remove unused, unimplemented frame() method.
8606
8607 2003-04-21  Darin Adler  <darin@apple.com>
8608
8609         Reviewed by Maciej.
8610
8611         - fixed bug 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
8612
8613         * khtml/html/html_formimpl.cpp:
8614         (HTMLInputElementImpl::setType): Implement; loosen rule about what type changes are allowed.
8615         (HTMLInputElementImpl::parseAttribute): Call setType for ATTR_TYPE.
8616         
8617         - unrelated tweak
8618         
8619         * kwq/KWQSlot.mm: (KWQSlot::KWQSlot): Use a macro here to make it a little easier to add items.
8620
8621 2003-04-21  Chris Blumenberg  <cblu@apple.com>
8622
8623         Use renamed plug-in view methods.
8624
8625         Reviewed by john.
8626
8627         * kwq/KWQKHTMLPart.mm:
8628         (KWQKHTMLPart::createPart):
8629         * kwq/KWQKJavaAppletWidget.mm:
8630         (KJavaAppletWidget::showApplet):
8631         * kwq/WebCoreBridge.h:
8632
8633 2003-04-18  Maciej Stachowiak  <mjs@apple.com>
8634
8635         Reviewed by Darin.
8636
8637         - fixed 3191892 - Popup blocking prevents window.open with '_self' as target (superbitdvd.com)
8638
8639         * khtml/ecma/kjs_html.h:
8640         * khtml/ecma/kjs_window.cpp:
8641         (WindowFunc::tryCall): Don't apply popup blocking if the call
8642         would open something in an existing frame (inlcuding the special
8643         _self, _top and _parent frames.
8644
8645 2003-04-18  David Hyatt  <hyatt@apple.com>
8646
8647         Make sure display:table is not accidentally mutated to
8648         display:block.
8649         
8650         Reviewed by darin
8651
8652         * khtml/css/cssstyleselector.cpp:
8653
8654 2003-04-18  Maciej Stachowiak  <mjs@apple.com>
8655
8656         Reviewed by Darin.
8657
8658         - fixed 3081926 - bookmarklet to count and display mailto links fails
8659
8660         * khtml/ecma/kjs_html.cpp:
8661         (KJS::HTMLElementFunction::tryCall): Implement custom toString JavaScript method
8662         which calls the existing toString C++ custom method.
8663         * khtml/ecma/kjs_html.h: Added AnchorToString.
8664         * khtml/ecma/kjs_html.lut.h: Regenerated.
8665
8666 2003-04-18  Chris Blumenberg  <cblu@apple.com>
8667
8668         Fixed: 3172389 - Safari doesn't parse attributes within the OBJECT tag
8669
8670         Reviewed by dave.
8671
8672         * khtml/rendering/render_frames.cpp:
8673         (RenderPartObject::updateWidget): add attributes from within the OBJECT tag to params, the list of attributes we pass to plug-ins. Don't override attributes that are already in params.
8674
8675 2003-04-18  David Hyatt  <hyatt@apple.com>
8676
8677         Make sure display:none is ignored and not accidentally mutated
8678         to display:block.
8679         
8680         Reviewed by darin
8681
8682         * khtml/css/cssstyleselector.cpp:
8683
8684 2003-04-17  Darin Adler  <darin@apple.com>
8685
8686         Reviewed by Maciej.
8687
8688         - fixed a bug caught by libgmalloc on Vicki's test machine
8689
8690         * khtml/xml/dom_docimpl.cpp:
8691         (DocumentImpl::detach): Make sure we don't have a dangling paint device after
8692         detaching from the KTHMLView.
8693         (DocumentImpl::setPaintDevice): Allow a 0 parameter.
8694         * kwq/WebCoreBridge.mm:
8695         (nowPrinting): Handle the case of a 0 paint device.
8696
8697 2003-04-15  David Hyatt  <hyatt@apple.com>
8698
8699         Missed a piece of the renaming on lowestPosition/rightmostPosition.
8700         This was already reviewed by darin.  Just missed landing one file.
8701         
8702         Reviewed by darin
8703
8704         * khtml/rendering/render_box.cpp:
8705         (RenderBox::lowestPosition):
8706         (RenderBox::rightmostPosition):
8707
8708 2003-04-15  Trey Matteson  <trey@apple.com>
8709
8710         3210061 - Forms auto-fill ignores maxlength attribute
8711
8712         Reviewed by Maciej.
8713
8714         * kwq/KWQTextField.mm:
8715         (-[KWQTextField setStringValue:]):  We now trim down incoming values
8716         to fit the maxlength criteria.  Matches the way we enforce this constraint
8717         when maxlength is set.
8718
8719 2003-04-15  David Hyatt  <hyatt@apple.com>
8720
8721         Fix 3227983 and 3229592, both the same bug involving a movable type
8722         template:
8723
8724         letter-spacing: .none;
8725
8726         Fix is to make error-handling of exprs more generic.
8727         
8728         Reviewed by darin
8729
8730         * khtml/css/parser.y:
8731
8732 2003-04-15  Darin Adler  <darin@apple.com>
8733
8734         Reviewed by Ken.
8735
8736         - fixed 3056913 -- please add Japanese auto-detect
8737
8738         * khtml/misc/decoder.cpp: (Decoder::decode): Turn on the auto-detect code if the
8739         default encoding is one of the Japanese encodings. Also change things around so
8740         the auto-detection process doesn't clobber the old chosen encoding if it does
8741         not yield a result.
8742         
8743         * kwq/KWQCharsets.h: Add a new IsJapanese encoding flag.
8744         * kwq/KWQTextCodec.h: Add a new isJapanese() member function, used by the above.
8745         * kwq/mac-encodings.txt: Add the IsJapanese flag to all Japanese encodings, and
8746         add "jis7" as a synonym for ISO-2022-JP.
8747         * kwq/make-charset-table.pl: Changed to allow flags even for unused encodings.
8748
8749         * kwq/KWQCharsetData.c: Regenerated.
8750
8751 2003-04-15  David Hyatt  <hyatt@apple.com>
8752
8753         Fix for 3220809, overflow values other than visible should not
8754         affect the document's height (or document scrollbars).  This
8755         fixes squidfingers.com and briefcase.yahoo.com
8756
8757         Also laying a bunch of groundwork for overflow:auto and scroll
8758         by adding them as supported values now.
8759
8760         Fixed overflow so that overflow objects now dodge floats and
8761         don't let them intrude into their space.
8762         
8763         Reviewed by darin
8764
8765         * khtml/css/cssstyleselector.cpp:
8766         * khtml/rendering/render_block.cpp:
8767         * khtml/rendering/render_block.h:
8768         * khtml/rendering/render_box.cpp:
8769         (RenderBox::containingBlockWidth):
8770         (RenderBox::repaint):
8771         (RenderBox::repaintRectangle):
8772         (RenderBox::calcWidth):
8773         (RenderBox::calcAbsoluteVertical):
8774         (RenderBox::lowestPosition):
8775         (RenderBox::rightmostPosition):
8776         * khtml/rendering/render_box.h:
8777         * khtml/rendering/render_flow.cpp:
8778         (RenderFlow::repaint):
8779         (RenderFlow::lowestPosition):
8780         (RenderFlow::rightmostPosition):
8781         * khtml/rendering/render_flow.h:
8782         * khtml/rendering/render_layer.cpp:
8783         (RenderLayer::updateLayerPosition):
8784         (RenderLayer::convertToLayerCoords):
8785         (RenderLayer::scrollOffset):
8786         * khtml/rendering/render_layer.h:
8787         * khtml/rendering/render_object.cpp:
8788         (RenderObject::setLayouted):
8789         (RenderObject::detach):
8790         * khtml/rendering/render_object.h:
8791         * khtml/rendering/render_style.h:
8792
8793 2003-04-15  Trey Matteson  <trey@apple.com>
8794
8795         3229318 - no back entry created when searching at lonelyplanet.com
8796
8797         Reviewed by Darin.
8798
8799         * khtml/ecma/kjs_binding.cpp:
8800         (ScriptInterpreter::wasRunByUserGesture):  Treat blur/focus events as being
8801         user gestures, since they probably were caused by something the user did.
8802         This cues us to not lock history for navigations that are spawned by these events.
8803
8804 2003-04-15  David Hyatt  <hyatt@apple.com>
8805
8806         A collection of fixes.
8807
8808         (1) Don't lay out positioned elements so early in
8809         layoutInlineChildren.  They need to get a layout only after
8810         all the normal flow kids have gotten a layout (and this happens
8811         already in layoutPositionedObjects).
8812
8813         (2) Fix a mistake with overflow:hidden.  I was applying the
8814         overflow-clip for positioned elements only if you had defined
8815         clip using the clip property.  This makes iht.com look better
8816         (although it still misrenders pretty badly due to some JS error
8817         we hit in the source).
8818
8819         (3) Patch RenderText's height method to give more accurate
8820         information.  This affects all the layout tests. :)
8821         
8822         Reviewed by darin
8823
8824         * khtml/rendering/bidi.cpp:
8825         * khtml/rendering/render_layer.cpp:
8826         (RenderLayer::constructZTree):
8827         * khtml/rendering/render_text.cpp:
8828         (RenderText::height):
8829
8830 2003-04-14  Trey Matteson  <trey@apple.com>
8831
8832         3009051 - Find on Page stops (once) at end of page, should wrap automatically   WebKit
8833         3051546 - Find on Page doesn't work for frameset pages
8834         3058437 - can have a selection in two frames at the same time (problem for finding in frames)
8835         3097498 - Find Previous continues to "Find Next" until end of paragraph 
8836         3097507 - Find Next searches from previous find hit instead of current selection
8837
8838         And a commented out fix for:
8839
8840         3121828 - scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
8841
8842         Various missing pieces are implemented to support better finding.  The fix for
8843         3121828 is left out until 3228511 is dealt with.
8844
8845         Reviewed by Maciej.
8846
8847         * WebCore.pbproj/project.pbxproj:
8848         * khtml/khtml_part.cpp:
8849         (KHTMLPart::findTextBegin):  Added args to allow starting a find at an arbitrary
8850         places, such as the current selection.
8851         (KHTMLPart::findTextNext):  Implement reverse search - only the param was there.
8852         Don't do lame scrolling selection to visible here, do better ourselves later.
8853         * khtml/khtml_part.h:
8854         * kwq/KWQKHTMLPart.h:
8855         * kwq/KWQKHTMLPart.mm:
8856         (KWQKHTMLPart::jumpToSelection):  Make whole selection rect visible, and only scroll
8857         anything if needed.  ***Commented out in lieu of 3228511.
8858         (KWQKHTMLPart::findString):  Implement find starting at the right place relative to
8859         the selection, forwards and backwards, and wraparound.  This is just setup around
8860         calling findTextNext.  Also scroll the result to be visible.
8861         * kwq/WebCoreBridge.h:
8862         * kwq/WebCoreBridge.mm:
8863         (-[WebCoreBridge deselectAll]):  Call part instead of doc so its state isn't out of sync.
8864         (-[WebCoreBridge searchFor:direction:caseSensitive:wrap:]):  Pass extra wrap arg.
8865         * kwq/WebCoreDOMNode.mm:
8866         (+[WebCoreDOMNode nodeWithImpl:DOM::]):
8867         Return a nil for a null element instead of croaking.
8868         (-[WebCoreDOMNode initWithImpl:DOM::]):  Ditto.
8869
8870 2003-04-14  Maciej Stachowiak  <mjs@apple.com>
8871
8872         Reviewed by Trey.
8873
8874         - fixed 3214900 - iBench JavaScript test times get progressively slower with each test run
8875
8876         The fix is to make sure to always cast NodeImpl * to DocumentImpl
8877         *. Multiple inheritance means the pointer values need not be the
8878         same.
8879         
8880         * khtml/ecma/kjs_binding.cpp:
8881         (ScriptInterpreter::getDOMObjectForDocument):
8882         (ScriptInterpreter::putDOMObjectForDocument):
8883         (ScriptInterpreter::deleteDOMObjectsForDocument):
8884         (ScriptInterpreter::forgetDOMObjectsForDocument):
8885         * khtml/ecma/kjs_binding.h:
8886         * khtml/ecma/kjs_dom.cpp:
8887         (KJS::getDOMNode):
8888
8889 2003-04-11  David Hyatt  <hyatt@apple.com>
8890
8891         Reviewed by darin
8892
8893         * ChangeLog:
8894         * khtml/css/cssstyleselector.cpp:
8895         * khtml/html/htmltokenizer.cpp:
8896         (HTMLTokenizer::parseComment):
8897
8898 2003-04-11  David Hyatt  <hyatt@apple.com>
8899
8900         Refine the code that sets the display of floating and positioned
8901         elements to block.
8902         
8903         Reviewed by darin
8904
8905         * khtml/css/cssstyleselector.cpp:
8906
8907 2003-04-14  Chris Blumenberg  <cblu@apple.com>
8908
8909         Fixed build failure.
8910
8911         Reviewed by darin.
8912
8913         * khtml/rendering/render_table.cpp:
8914         (RenderTable::cellAbove):
8915
8916 2003-04-12  Chris Blumenberg  <cblu@apple.com>
8917
8918         Fixed: 3162338 - Embedding SVG with <object type="image/svg+xml"> doesn't work
8919
8920         Whenever we encounter an OBJECT tag with a type that starts with "image/" we create a render image object instead of a render part object. The behavior is nice because this allows the render object to resize to the size of the image if no WIDTH and HEIGHT are supplied. For example, the image at the bottom of this page:
8921
8922         http://tantek.com/CSS/Examples/boxmodelhack.html
8923
8924         The problem is that we do this for image types that we can't handle and when there are plug-ins that *can* handle the types.
8925
8926         Reviewed by dave.
8927
8928         * khtml/html/html_objectimpl.cpp:
8929         (HTMLObjectElementImpl::rendererIsNeeded): call canRenderImageType instead of serviceType.startsWith
8930         (HTMLObjectElementImpl::createRenderer): call canRenderImageType instead of serviceType.startsWith
8931         (HTMLObjectElementImpl::attach): call canRenderImageType instead of serviceType.startsWith
8932         * kwq/KWQPixmap.h:
8933         * kwq/KWQPixmap.mm:
8934         (canRenderImageType): new, checks if the MIME type is supported by the image factory
8935         * kwq/WebCoreImageRendererFactory.h: added supportedMIMETypes to the WebCoreImageRendererFactory protocol
8936
8937 2003-04-13  Maciej Stachowiak  <mjs@apple.com>
8938
8939         Reviewed by Trey.
8940
8941         - fixed 3165326 - javascript getSelection not implemented
8942         
8943         * khtml/ecma/kjs_window.cpp:
8944         (Window::get):
8945         (WindowFunc::tryCall):
8946         * khtml/ecma/kjs_window.h:
8947         * khtml/ecma/kjs_window.lut.h:
8948
8949 2003-04-13  Trey Matteson  <trey@apple.com>
8950
8951         3219720 - autofill mapping confused by tables, worse than MacIE (at store.apple.com)
8952
8953         If in scanning backwards we get to the end of a table row, we take a diversion
8954         and scan the cell that is above the cell we started at.
8955         Big improvement for store.apple.com.
8956
8957         Reviewed by Maciej
8958
8959         * khtml/rendering/render_table.cpp:
8960         (RenderTable::cellAbove):  New support routine to find the cell above another
8961         * khtml/rendering/render_table.h:
8962         * kwq/KWQKHTMLPart.h:
8963         * kwq/KWQKHTMLPart.mm:
8964         (KWQKHTMLPart::searchForLabelsAboveCell):
8965         Get the cell above, scan its tree for matching text.
8966         (KWQKHTMLPart::searchForLabelsBeforeElement):
8967         Call above routine if we are working within a table
8968
8969 2003-04-12  Chris Blumenberg  <cblu@apple.com>
8970
8971         Fixed: 3188070 - 6I32 EMBED tag with no SRC attribute doesn't load the plugin
8972
8973         Reviewed by dave.
8974
8975         * khtml/khtml_part.cpp:
8976         (KHTMLPart::requestObject): allow URL-less parts
8977
8978 2003-04-11  Trey Matteson  <trey@apple.com>
8979
8980         3148002 - printing shouldn't depend on the size of the window
8981
8982         The basic strategy is copied from khtmlview's print method:  We reset the width
8983         of the document to the paper width minus margins, and relayout before paginating
8984         and printing.
8985
8986         Reviewed by Richard.
8987
8988         * khtml/rendering/render_root.cpp:
8989         (RenderRoot::layout):  Always resize our view, even when doing a layout when in
8990         printing mode.  It's necessary to change the view size because we rely on the AppKit
8991         built-in pagination, which operates using the view geometry.
8992         * kwq/KWQKHTMLPart.h:
8993         * kwq/KWQKHTMLPart.mm:
8994         (KWQKHTMLPart::forceLayoutForPageWidth):  New method to do a layout given a
8995         specific width.
8996         * kwq/WebCoreBridge.h:
8997         * kwq/WebCoreBridge.mm:
8998         (-[WebCoreBridge _setPrintingMode:]):  Helper routine to take the RenderRoot in
8999         and out of printing mode.
9000         (-[WebCoreBridge forceLayout]):  Turn printing mode on/off.
9001         (-[WebCoreBridge forceLayoutForPageWidth:]):  Turn printing mode on/off.
9002         New glue routine to call part.
9003         (-[WebCoreBridge drawRect:withPainter:]):  Turn printing mode on/off.
9004         (-[WebCoreBridge drawRect:]):  Test paintDevice type instead of graphics context
9005         to determine printing mode.  The latter is still on when we are wrapping up the
9006         job and want to be setting things back to normal.
9007         (-[WebCoreBridge adjustFrames:]):  Ditto.
9008         (-[WebCoreBridge adjustPageHeightNew:top:bottom:limit:]):  Turn printing mode on/off.
9009
9010 2003-04-11  Darin Adler  <darin@apple.com>
9011
9012         Reviewed by Richard.
9013
9014         - fixed 3225472 -- www.sina.com.cn uses A3A0 for full-width space; used to work in Simplified Chinese (Mac OS)
9015
9016         * kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUsingTEC): Work around the problem
9017         in the Text Encoding Converter by changing all U+E5E5 to U+3000.
9018
9019         * kwq/KWQString.h: Added replace(QChar, QChar), since Qt has it and I need it.
9020         * kwq/KWQString.mm:
9021         (QString::find): Fixed a bug where we'd yield a FATAL and return -1 on deployment
9022         if you searched for a non-ASCII character in a string that had ASCII valid and
9023         not Unicode valid.
9024         (QString::replace): Added replace(QChar, QChar).
9025
9026 === Safari-73 ===
9027
9028 2003-04-10  Trey Matteson  <trey@apple.com>
9029
9030         3224973 - Safari sometimes stores data for AUTOCOMPLETE=OFF fields and password fields
9031
9032         New WC support function.
9033
9034         Reviewed by Darin.
9035
9036         * kwq/WebCoreBridge.h:
9037         * kwq/WebCoreBridge.mm:
9038         (-[WebCoreBridge elementWithName:inForm:]):  Run through the form's elements
9039         looking for a matching name.
9040
9041 === Safari-72 ===
9042
9043 2003-04-10  Maciej Stachowiak  <mjs@apple.com>
9044
9045         Reviewed by Darin and Ken.
9046
9047         - fixed 3223127 - REGRESSION: windows for PopCap games show scroll bars now, did not in Safari-60
9048
9049         * khtml/ecma/kjs_window.cpp:
9050         (WindowFunc::tryCall): Re-add scrollbars property, but change it
9051         to default to on even when other properties are specified (unlike
9052         other window properties). This seems to match what Mac IE, Win IE
9053         and Windows Mozilla do.
9054
9055 2003-04-10  Darin Adler  <darin@apple.com>
9056
9057         Reviewed by Trey.
9058
9059         - speed up startup by not loading the hand cursor until it's used
9060
9061         * khtml/khtml_part.cpp: (KHTMLPart::urlCursor): Use the hand cursor.
9062         * khtml/khtmlpart_p.h: Don't store the hand cursor in a per-part global.
9063
9064 2003-04-10  Darin Adler  <darin@apple.com>
9065
9066         Reviewed by Maciej.
9067
9068         - fixed 3224077 -- REGRESSION: tables on MacNN forums messed up because we reject %% due to style parser
9069
9070         * khtml/css/tokenizer.flex: Add a + sign after the % in the percentage rule so we allow
9071         any number of extra percent signs. This is a temporary hack.
9072
9073         * khtml/css/Makefile.am: Add make rules to build tokenizer.cpp so we don't have to do it by hand.
9074         * khtml/css/maketokenizer: Added. Script used by the make rules.
9075         * khtml/css/tokenizer.cpp: Regenerated. The only substantive change is in the state tables.
9076
9077 2003-04-09  David Hyatt  <hyatt@apple.com>
9078
9079         This first fix is a refinement of the patch I produced to fix <nobr>
9080         on cnn.com recently.  It wasn't quite good enough to plug the
9081         regression on other sites.  This fix just checks the object
9082         we're currently breaking on (which is what I meant to do) and
9083         not the last object examined (which will always just be the
9084         previous object you looked at).
9085
9086         The code currently in the tree would work if you had two objects
9087         like this:
9088
9089         [Normal Whitespace] [Nowrap Whitespace]
9090
9091         but not if you had three:
9092
9093         [Normal][Nowrap][Nowrap]
9094
9095         Since when you looked at the third object, |last| would be the
9096         previous nowrap object and not the normal object.  The line break
9097         properly stays at the normal object as long as nowrap objects are
9098         encountered, so this patch basically does what the original was
9099         intended to do.
9100
9101         This fixes the line break problems on 1800flowers.com, a line break
9102         problem on the bugzilla.mozilla.org layout test, a problem
9103         on the zdnet layout test, and 3207196 a regression on livejournal.
9104
9105         The second fix in this patch is a simple reversal of 
9106         containsOnlyWhitespace.  The method on RenderText was 
9107         backwards!  No logical changes have been made... I just inverted
9108         all the callers, and then I patched the method.
9109         
9110         The third fix is to make images check for == normal instead of != nowrap
9111         in a few places, thus preventing incorrect line break points from being
9112         set up.
9113         
9114         Reviewed by gramps
9115
9116         * khtml/rendering/bidi.cpp:
9117         * khtml/rendering/render_text.cpp:
9118         (RenderText::calcMinMaxWidth):
9119         (RenderText::containsOnlyWhitespace):
9120
9121 2003-04-09  Darin Adler  <darin@apple.com>
9122
9123         Reviewed by Maciej.
9124
9125         - fixed 3223414 -- update text encoding menu and encoding names table
9126
9127         Made changes as suggested by Deborah Goldsmith and Peter Edberg from the International group.
9128
9129         * kwq/mac-encodings.txt:
9130         Moved all Korean character sets that are not explicitly Macintosh from MacKorean to EUC_KR.
9131         Moved Shift JIS character sets that are not explicitly Microsoft from DOSJapanese to ShiftJIS_X0213_00.
9132         Moved cp949 from DOSKorean to EUC_KR (DOSKorean is not implemented in Jaguar).
9133         Moved big5 character sets that are not explicitly Microsoft from DOSChineseTrad to Big5_HKSCS_1999.
9134         Moved all gb2312-80 character sets from GB_2312_80 to GB_18030_2000.
9135         Moved all gbk character sets from GBK_95 to GB_18030_2000.
9136         Moved all euc-cn character sets from EUC_CN to GB_18030_2000.
9137
9138         * kwq/KWQCharsetData.c: Regenerated.
9139
9140 2003-04-09  Darin Adler  <darin@apple.com>
9141
9142         Reviewed by Richard.
9143
9144         - fixed 3223126 -- REGRESSION: exception BrowserWindow isDescendantOf:]: selector not recognized
9145
9146         * kwq/KWQWidget.mm: (QWidget::hasFocus): Add missing check of the class of the first
9147         responder before calling an NSView method on it.
9148
9149 2003-04-09  Darin Adler  <darin@apple.com>
9150
9151         Reviewed by Maciej.
9152
9153         - fixed 3222708 -- REGRESSION: repro crash trying to read news at nttdocomo
9154
9155         * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Make window.open do its location
9156         change with scheduleRedirection like all the other JavaScript calls that change location.
9157
9158 2003-04-08  Darin Adler  <darin@apple.com>
9159
9160         Reviewed by Maciej.
9161
9162         - fixed 3221400 -- REGRESSION: password field with onfocus handler that does select causes focus/typing trouble
9163
9164         * kwq/KWQTextField.mm:
9165         (-[KWQTextField selectText:]): Rearrange slightly.
9166         (-[KWQTextField becomeFirstResponder]): Add code to make the secure field first responder
9167         when in password mode. The old code did this indirectly through the call to setDocumentFocus,
9168         which caused minor trouble.
9169         (-[KWQSecureTextField selectText:]): Correct the current editor check to use a technique
9170         that works even for the secure text field's editor (which does not get returned by currentEditor).
9171         
9172         * kwq/KWQWidget.mm: (QWidget::hasFocus): Update the logic here so it works for the secure text
9173         field and the secure text field's editor.
9174
9175 2003-04-08  David Hyatt  <hyatt@apple.com>
9176
9177         Fix for 3166374.  Making the nudie blog work.  My loop for
9178         removing floating objects when they got deleted wasn't catching
9179         all the cases.
9180         
9181         Reviewed by darin
9182
9183         * khtml/rendering/render_object.cpp:
9184         (RenderObject::removeFromObjectLists):
9185
9186 2003-04-08  David Hyatt  <hyatt@apple.com>
9187
9188         Fix for 3220979.  Regression caused by changes to the CSS
9189         parser's error handling.  Fix is to narrow my original patch
9190         to handle a specific subtype of error for properties.
9191         
9192         Reviewed by darin
9193
9194         * khtml/css/parser.cpp:
9195         * khtml/css/parser.y:
9196
9197 2003-04-08  Richard Williamson   <rjw@apple.com>
9198
9199         Fixed 3221353.  Added check for nil part.
9200         
9201         Reviewed by Darin.
9202
9203         * khtml/html/html_baseimpl.cpp:
9204         (HTMLFrameElementImpl::detach):
9205
9206 2003-04-07  Richard Williamson  <rjw@apple.com>
9207
9208         Fix for 3220988.  Cancel frame load if it's detached before
9209         finished loading.
9210         
9211         Reviewed by Maciej.
9212
9213         * khtml/html/html_baseimpl.cpp:
9214         (HTMLFrameElementImpl::detach):
9215         * khtml/khtml_part.h:
9216         * kwq/KWQKHTMLPart.mm:
9217         (KHTMLPart::frameDetached):
9218         * kwq/WebCoreBridge.h:
9219
9220 2003-04-07  David Hyatt  <hyatt@apple.com>
9221
9222         Fix for 3220395.  nearestFloatBottom() mistakenly returned 0
9223         when it ran out of floats to return.
9224         
9225         Reviewed by gramps
9226
9227         * khtml/rendering/render_block.cpp:
9228
9229 2003-04-07  David Hyatt  <hyatt@apple.com>
9230
9231         Fix for the scrollbar problem in 3220395.  Does not yet fix
9232         the overlap problem.  lowest/rightmostPosition got broken by
9233         the RenderFlow split.  This patch makes sure that we still crawl
9234         into inlines with overhangingContents.
9235         
9236         Reviewed by darin
9237
9238         * khtml/rendering/render_block.cpp:
9239         * khtml/rendering/render_flow.cpp:
9240         (RenderFlow::lowestPosition):
9241         (RenderFlow::rightmostPosition):
9242         * khtml/rendering/render_flow.h:
9243
9244 2003-04-07  David Hyatt  <hyatt@apple.com>
9245
9246         * khtml/html/htmlparser.cpp:
9247         (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
9248
9249         This is a patch to the parser to prevent residual 
9250         style from creating illegal constructs according to the DTD.
9251         For now, it will just bail on performing the fixup if an
9252         illegal construct would be created.
9253
9254         This fixes the regression #3219944.
9255
9256         Reviewed by darin
9257         
9258 2003-04-07  Darin Adler  <darin@apple.com>
9259
9260         Reviewed by Dave.
9261
9262         - fixed 3220490 -- REGRESSION: MALLORY horiz scrollbar incorrectly appears with abs positioned content
9263
9264         * khtml/rendering/render_block.cpp: (RenderBlock::rightmostPosition):
9265         Fix a place where I had xPos instead of yPos.
9266
9267 === Safari-71 ===
9268
9269 2003-04-04  Darin Adler  <darin@apple.com>
9270
9271         Reviewed by John and Richard.
9272
9273         - fixed 3218725 -- REGRESSION: reproducible crash in recalcStyle on reload
9274
9275         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::DocumentImpl): Initialize m_paintDevice to 0.
9276
9277 2003-04-04  Darin Adler  <darin@apple.com>
9278
9279         Reviewed by Dave.
9280
9281         - fixed 3125850 -- VIP: "search by goo" instead of "search by google" at livepage.apple.com
9282         
9283         We decided not to fix the general problem right now, but just hack the site.
9284
9285         * khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::parseAttribute):
9286         Just ignore the style set by livepage.apple.com, so we get a too-big
9287         "Search by Google" rather than a cut off "Search by Goo".
9288
9289 2003-04-04  David Hyatt  <hyatt@apple.com>
9290
9291         Fix for the Search button cutoff on livepage.apple.com  We
9292         weren't honoring hspace/vspace on input elements.
9293         
9294         Reviewed by darin
9295
9296         * khtml/html/html_formimpl.cpp:
9297         (HTMLInputElementImpl::parseAttribute):
9298
9299 2003-04-04  David Hyatt  <hyatt@apple.com>
9300
9301         Fix for 3218085.  Remove the bogus 2cm print rule for body in the
9302         html4.css sheet.
9303         
9304         Reviewed by darin/trey
9305
9306         * khtml/css/html4.css:
9307
9308 2003-04-04  Darin Adler  <darin@apple.com>
9309
9310         Reviewed by Ken.
9311
9312         - fixed 3217687 -- REGRESSION: printing uses widths from screen fonts, messing up layout
9313
9314         To get the style machinery working for me instead of against me, I had to introduce both
9315         FontDef and QFont to the screen/printer font dichotomy. Just following that through took
9316         care of the bugs we were seeing.
9317
9318         * khtml/rendering/font.h: Add a usePrinterFont field to FontDef (in APPLE_CHANGES).
9319         * khtml/rendering/font.cpp: (Font::update): Set the new "printer font" field on the QFont
9320         (in APPLE_CHANGES).
9321         
9322         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Set usePrinterFont field on the
9323         document's fontDef (in APPLE_CHANGES).
9324         
9325         * kwq/KWQFont.h: Add isPrinterFont, setter, getter.
9326         * kwq/KWQFont.mm:
9327         (QFont::QFont): Default isPrinterFont to false, copy when copying.
9328         (QFont::operator=): Copy isPrinterFont.
9329         (QFont::setPrinterFont): Added.
9330         (QFont::operator==): Compare isPrinterFont.
9331         
9332         * kwq/KWQFontMetrics.mm: Remove the _rendererUsesPrinterFont field and associated code.
9333         This was only needed when the same QFont could be both printer and screen font, but now
9334         the QFont itself is different.
9335         * kwq/KWQPainter.mm: (QPainter::_updateRenderer): Remove textRendererUsesPrinterFont field
9336         and associated code, for same reason as above.
9337         
9338         * kwq/WebCoreBridge.mm: (-[WebCoreBridge reapplyStylesForDeviceType:]): Set the document's
9339         paint device.
9340         
9341         * kwq/WebCoreTextRendererFactory.h: Remove global setUsingPrinterFonts: and
9342         usingPrinterFonts methods. We now handle this at the document level. Add a usingPrinterFont:
9343         parameter to rendererWithFont:, which is now how KHTML tells the text rendering code which
9344         kind to use.
9345         * kwq/WebCoreTextRendererFactory.m: Removed KWQTextRendererFactoryUsingPrinterFonts.
9346         (-[WebCoreTextRendererFactory rendererWithFont:usingPrinterFont:]): Added parameter.
9347
9348         - other changes
9349         
9350         * kwq/KWQPaintDevice.h: Store the device type instead of using a virtual function.
9351         * kwq/KWQPrinter.h: Set device type in constructor instead of overriding devType function.
9352         * kwq/KWQPixmap.h: Changed destructor back to non-virtual (and entire class back to
9353         non-polymorphic), now that QPaintDevice doesn't use virtual functions any more.
9354
9355         * kwq/KWQPaintDeviceMetrics.h: Remove unused width() and height().
9356         * kwq/KWQPaintDeviceMetrics.mm: Ditto.
9357         
9358         * WebCore.pbproj/project.pbxproj: Removed KWQTextRendererFactory.h.
9359         * kwq/KWQTextRendererFactory.h: Removed.
9360
9361 2003-04-03  Maciej Stachowiak  <mjs@apple.com>
9362
9363         Reviewed by Trey.
9364
9365         - fixed 3031544 - can't login on secure paytrust page due to lack of onchange handler
9366
9367         * kwq/KWQTextField.mm:
9368         (-[KWQTextField control:textShouldBeginEditing:]): Send FocusIn event
9369         to event filter here.
9370         (-[KWQTextField control:textShouldEndEditing:]): Send FocusOut event to
9371         event filter here.
9372         (-[KWQTextField fieldEditorDidBecomeFirstResponder]): Removed.
9373         (-[KWQTextField fieldEditorDidResignFirstResponder]): Removed.
9374         * kwq/WebCoreFirstResponderChanges.h: Removed first responder methods.
9375
9376 2003-04-03  Trey Matteson  <trey@apple.com>
9377
9378         3067928 - printing should not break lines in half
9379         3217607 - when printing we should not draw the selection
9380
9381         We leverage the existing knowledge that a couple render object classes had
9382         for adjusting pagination.  Wrote 3217705 saying we should add similar
9383         smarts to a few more places.
9384
9385         Reviewed by Darin.
9386
9387         * ForwardingHeaders/qprinter.h: Added.
9388         * khtml/rendering/render_list.cpp:
9389         (RenderListMarker::paintObject):  Call our special setBestTruncatedAt instead
9390         of khtml's setTruncatedAt.
9391         * khtml/rendering/render_root.cpp:
9392         (RenderRoot::setBestTruncatedAt):  Accumulate the best pagination boundary.
9393         * khtml/rendering/render_root.h:
9394         * khtml/rendering/render_text.cpp:
9395         (RenderText::paintObject):  Call our special setBestTruncatedAt instead
9396         of khtml's setTruncatedAt.
9397         * kwq/KWQKHTMLPart.h:
9398         * kwq/KWQKHTMLPart.mm:
9399         (KWQKHTMLPart::paint):  Don't draw the debugging red background when printing.
9400         (KWQKHTMLPart::adjustPageHeight):  The meat of the change.  Make another
9401         painting pass (with actual painting disabled) to get the pagination boundary
9402         set as a side effect.  Return result up to AppKit.
9403         * kwq/KWQPaintDevice.h:  devType() made virtual
9404         * kwq/KWQPainter.h:
9405         * kwq/KWQPainter.mm:
9406         (QPainter::QPainter):  New constructor for making a printing painter.
9407         (QPainter::device):  Return either the Screen or Printer device.
9408         * kwq/KWQPixmap.h:  Destructor needed to become virtual.
9409         * kwq/KWQPrinter.h:  Implement devType().
9410         * kwq/WebCoreBridge.h:
9411         * kwq/WebCoreBridge.mm:
9412         (-[WebCoreBridge drawRect:]):  Setup printer device in our painter if we're
9413         not drawing to the screen.
9414         (-[WebCoreBridge adjustFrames:]):  Ditto.
9415         (-[WebCoreBridge adjustPageHeightNew:top:bottom:limit:]):  Forward to part.
9416
9417 2003-04-03  Darin Adler  <darin@apple.com>
9418
9419         Reviewed by John.
9420
9421         - fixed 3194468 -- ARCH: text zoom should scale line-height as well as font-size
9422
9423         * khtml/css/css_valueimpl.h:
9424         * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::computeLength): Add a new version that does
9425         a multiply before rounding. Also simplify the rounding code.
9426         
9427         * khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): For line height, multiply by the
9428         text zoom factor in cases where the height isn't already relative to the font size.
9429
9430         - other changes
9431
9432         * khtml/rendering/render_replaced.cpp: (RenderWidget::paintObject): Disable code to work around
9433         X11 widget size limit. It can only do harm for us.
9434
9435 2003-04-03  Darin Adler  <darin@apple.com>
9436
9437         Reviewed by Ken.
9438
9439         - fixed bug 3216832 -- REGRESSION: scroll bar doesn't appear soon enough when shrinking excite.com horizontally
9440
9441         * khtml/rendering/table_layout.cpp: (AutoTableLayout::calcEffectiveWidth):
9442         Fixed mistake where using the wrong variable led to the colspan distribution
9443         loop terminating early, and not giving any additional width to the second column.
9444
9445         - fixed some navigator properties as discussed in the meeting yesterday (with Don, Dave, Mike Malone)
9446
9447         * khtml/ecma/kjs_navigator.cpp: (Navigator::getValueProperty):
9448         Use the date 20030107 instead of 20021225 because people think it's less arbitrary.
9449         Use "Apple Computer, Inc." as the vendor string.
9450
9451 2003-04-02  David Hyatt  <hyatt@apple.com>
9452
9453         Fix for 3216650.  Needed an additional check when the disabled
9454         attribute is changed on <link> elements for stylesheets to keep
9455         the pending sheet count in sync.
9456         
9457         Reviewed by gramps
9458
9459         * khtml/html/html_headimpl.cpp:
9460         (HTMLLinkElementImpl::parseAttribute):
9461
9462 2003-04-02  David Hyatt  <hyatt@apple.com>
9463
9464         Fix for 3212011.  Avoid applying a fixup to the minwidth
9465         of overflow:hidden table cells, since we don't really have
9466         an accurate width to compare against.
9467
9468         I filed followup bug 3216709 to deal with the fact that this
9469         fixup has been disabled.
9470         
9471         Reviewed by john
9472
9473         * khtml/rendering/render_block.cpp:
9474
9475 2003-04-02  David Hyatt  <hyatt@apple.com>
9476
9477         Do not assume all columns have a minwidth/maxwidth of 1px.
9478         Instead give them a min/maxwidth of 0px, and only inflate to
9479         1px if a cell originates in the column.
9480
9481         This fixes the error on travelocity.com, where a large colspan
9482         leads to the implicit creation of a new column that contains no
9483         originating cells.  That new column should be 0px wide, not 
9484         1px.
9485
9486         The bug # is 3170592.
9487         
9488         Reviewed by kocienda
9489
9490         * khtml/rendering/table_layout.cpp:
9491         (AutoTableLayout::recalcColumn):
9492         * khtml/rendering/table_layout.h:
9493
9494 2003-04-01  David Hyatt  <hyatt@apple.com>
9495
9496         Fix for excite.com.  There are many bugs being fixed that all
9497         contributed to the wideness of the table.
9498
9499         The bug # is 3200534
9500         
9501         Reviewed by darin
9502
9503         * khtml/rendering/table_layout.cpp:
9504         (shouldScaleColumns):
9505
9506 2003-04-02  Darin Adler  <darin@apple.com>
9507
9508         Reviewed by Dave.
9509
9510         - fixed 3213854 -- REGRESSION: can't click on a text field to select it
9511         - fixed 3201477 -- friends links don't work on hyatt's blog
9512
9513         * khtml/rendering/render_object.cpp: (RenderObject::nodeAtPoint): Skip floating objects when
9514         hit testing children.
9515         * khtml/rendering/render_inline.cpp: (RenderInline::nodeAtPoint): Ditto.
9516
9517 2003-04-01  Trey Matteson  <trey@apple.com>
9518
9519         3119711 - redirects to anchors leave window half-loaded (was SCClib.org is half loaded, half rendered)
9520
9521         The problem happened when an anchor nav was the last half of a client redirect.
9522         We would never stop the redirect timer, and thus never post a clientRedirectCanceled
9523         message up through the stack.  This left the app thinking that it was in redirect
9524         mode even when the whole navigation had finished, which makes it not clear the
9525         progress bar.
9526
9527         Reviewed by Darin.
9528
9529         * kwq/KWQKHTMLPart.mm:
9530         (KWQKHTMLPart::scrollToAnchor):  Stop the redirect timer.
9531
9532 2003-04-01  Maciej Stachowiak  <mjs@apple.com>
9533
9534         Reviewed by Dave.
9535
9536         - fixed 3182103 - REGRESSION: one developer.apple.com page is so slow, it almost seems like a hang 
9537         
9538         * khtml/rendering/bidi.cpp:
9539         (RenderBlock::findNextLineBreak): Avoid returning bad iterators
9540         that point past the end of an object instead of to the start ot
9541         the next one.
9542
9543 2003-04-01  Darin Adler  <darin@apple.com>
9544
9545         Reviewed by Maciej.
9546
9547         - fixed 3123709 -- redirect isn't followed at Apple's Dental Benefits provider
9548
9549         * khtml/dom/dom2_events.h: Added boolean "isWindowEvent" parameter.
9550         * khtml/dom/dom2_events.cpp: (EventListener::handleEvent): Ignore boolean "isWindowEvent" parameter.
9551
9552         * khtml/ecma/kjs_events.h: Added boolean "isWindowEvent" parameter.
9553         * khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Look at new "isWindowEvent" parameter,
9554         and send the event to the window if it's true, rather than the current node, document, and form.
9555
9556         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::defaultEventHandler): Pass true for "isWindowEvent".
9557         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::handleLocalEvents): Pass false for "isWindowEvent".
9558
9559 2003-04-01  Darin Adler  <darin@apple.com>
9560
9561         Reviewed by John.
9562
9563         - fixed 3144287 -- CSS with media=print not used when printing
9564
9565         * kwq/KWQKHTMLPart.h: Added a setMediaType function, so the bridge can access
9566         the KHTMLView::setMediaType function, which is private (KWQKHTMLPart is a friend).
9567         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::setMediaType): Call setMediaType on the
9568         KHTMLView.
9569         
9570         * kwq/WebCoreBridge.h: Added a device type parameter to reapplyStyles.
9571         * kwq/WebCoreBridge.mm: (-[WebCoreBridge reapplyStylesForDeviceType:]):
9572         Call setMediaType with the appropriate media type for the passed in device type.
9573
9574 2003-04-01  David Hyatt  <hyatt@apple.com>
9575
9576         Table code fixes.  Working to try to fix excite.com.
9577         
9578         Reviewed by darin
9579
9580         * khtml/rendering/table_layout.cpp:
9581         (shouldScaleColumns):
9582         (AutoTableLayout::calcMinMaxWidth):
9583
9584 2003-04-01  Darin Adler  <darin@apple.com>
9585
9586         Reviewed by Dave.
9587
9588         - fixed 3213900 -- REGRESSION: crash in CSS parser at http://radioalice.com/
9589
9590         * khtml/css/cssparser.cpp: (CSSParser::parseColor): Add a missing check for nil.
9591
9592 2003-04-01  Darin Adler  <darin@apple.com>
9593
9594         Reviewed by Trey.
9595
9596         - fixed 3202542 -- REGRESSION: preinitialized password inputs do not show dots (affects mac.com)
9597
9598         * kwq/KWQTextField.mm: (-[KWQTextField setPasswordMode:]): Remove code that sets the string
9599         value to "". This is not needed, and because a text changed signal is sent out it makes the
9600         caller think the text was deleted intentionally. Added code to move the string from the current
9601         field in use to the other field, so changing the password mode does not make the string go away.
9602         The old code was fragile and depended on the order of operations.
9603
9604 2003-03-31  Darin Adler  <darin@apple.com>
9605
9606         * English.lproj/InfoPlist.strings: Changed "1.0 Beta" to "1.0 Beta 2".
9607         * WebCore.pbproj/project.pbxproj: Changed "1.0 Beta" to "1.0 Beta 2".
9608
9609 2003-03-31  David Hyatt  <hyatt@apple.com>
9610
9611         Fixes for 3211862 and 3212750, add error-handling cases for
9612         property values to the CSS parser so the whole sheet doesn't
9613         get rejected.
9614         
9615         Reviewed by darin
9616
9617         * khtml/css/parser.cpp:
9618         * khtml/css/parser.y:
9619
9620 2003-03-31  Darin Adler  <darin@apple.com>
9621
9622         Reviewed by Chris.
9623
9624         - fixed 3213093 -- REGRESSION: crash accessing menu items right after launch with about:blank as homepage
9625
9626         * khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent):
9627         Another place needed a check for null.
9628
9629 2003-03-31  David Hyatt  <hyatt@apple.com>
9630
9631         Fix for 3211849.  I accidentally removed a BORDER_COLOR case
9632         from the switch when I removed the transparency check for
9633         the shorthand.  The case originally fell through to the case
9634         below it, so a straight removal was wrong.  I needed to add
9635         it to the following set of case labels.
9636         
9637         Reviewed by darin
9638
9639         * khtml/css/cssstyleselector.cpp:
9640
9641 2003-03-31  David Hyatt  <hyatt@apple.com>
9642
9643         First-letter can be floated.  Make sure we mutate the display
9644         to BLOCK so that we don't make an inline when we're floating.
9645         Fixes bug 3186004.
9646         
9647         Reviewed by darin
9648
9649         * khtml/rendering/render_block.cpp:
9650
9651 2003-03-31  Darin Adler  <darin@apple.com>
9652
9653         Reviewed by John.
9654
9655         - fixed 3213093 -- accessing menu items immediately after launch causes crash when about:blank is homepage
9656
9657         * khtml/khtmlview.cpp: (isSubmitImage): Add check for node of 0.
9658         
9659         - fixed 3211461 -- crash in KWQListIteratorImpl tabbing through w3c test page
9660
9661         * kwq/KWQKHTMLPart.h: Added childFrameForPart function, better than KHTMLPart::frame because it works
9662         for HTML frames inside objects as well as plain old HTML frames.
9663         * kwq/KWQKHTMLPart.mm:
9664         (KWQKHTMLPart::childFrameForPart): Like KHTMLPart::frame, but looks through m_objects too.
9665         (KWQKHTMLPart::nextKeyViewInFrameHierarchy): Use childFrameForPart instead of frame function.
9666
9667 2003-03-30  Maciej Stachowiak  <mjs@apple.com>
9668
9669         Reviewed by Darin.
9670
9671         - fixed 3206524 - incyte.com "load properties" function does not work
9672         
9673         * khtml/html/html_documentimpl.cpp:
9674         (HTMLDocumentImpl::close): Make sure to clear the tokenizer before firing
9675         the onLoad handler, otherwise document.write from inside an onLoad handler
9676         will fail.
9677         * khtml/xml/dom_docimpl.h:
9678         * khtml/xml/dom_docimpl.cpp:
9679         (DocumentImpl::close): Call closeInternal.
9680         (DocumentImpl::closeInternal): New version of close that allows
9681         bypassing the tokenizer null check, in case we already deleted the
9682         tokenizer/
9683
9684 2003-03-30  Maciej Stachowiak  <mjs@apple.com>
9685
9686         Reviewed by Trey.
9687
9688         - fixed 3169064 - can't search at lonelyplanet.com; onSubmit handler fails due to problem addressing radio button
9689         
9690         * khtml/ecma/kjs_dom.cpp:
9691         (DOMNamedNodesCollection::tryGet): Allow lookup by id as well as
9692         by integer index.
9693
9694 2003-03-29  Maciej Stachowiak  <mjs@apple.com>
9695
9696         Reviewed by Trey.
9697
9698         - fixed 3138427 - new window opened by javascript is too small for popcap.com game
9699
9700         * khtml/ecma/kjs_window.cpp:
9701         (WindowFunc::tryCall): Be a bit more tolerant of misformatted attribute strings.
9702
9703 2003-03-29  Maciej Stachowiak  <mjs@apple.com>
9704
9705         Reviewed by Trey.
9706
9707         - fixed 3180786 - Can't log in to the LL Bean Web site
9708
9709         The problem on this site was misnested tags, leading to two FORM
9710         elements that were nested. Both their onSubmit handlers fired, and
9711         the outer one returned false. The fix was to avoid bubbling submit
9712         events, since this can never be useful in a valid document and
9713         because that is what other browsers seem to do, and what Win IE
9714         documents.
9715         
9716         * khtml/html/html_formimpl.cpp:
9717         (HTMLFormElementImpl::prepareSubmit): Don't allow the submit event to bubble.
9718
9719 2003-03-28  Maciej Stachowiak  <mjs@apple.com>
9720
9721         Reviewed by Ken.
9722
9723         - improved on Darin's fix for 3211289 - REGRESSION: nil-deref in bridgeForWidget 
9724         
9725         * kwq/KWQKHTMLPart.mm:
9726         (KWQKHTMLPart::bridgeForWidget): Special-case KHTMLView - this is
9727         the only kind of widget in the program that's not a form control
9728         (so nodeForWidget would return nil for it).
9729
9730 2003-03-28  David Hyatt  <hyatt@apple.com>
9731
9732         Fix a regression caused by my addition of nearestFloatBottom
9733         to the code.  I needed to make that a loop rather than just call
9734         it once, since the nearestFloatBottom could be a bad position
9735         for the next line.
9736
9737         This fixes the overlapping text problem at CNN: 3186593.
9738         
9739         Reviewed by john
9740
9741         * khtml/rendering/bidi.cpp:
9742
9743 2003-03-28  Darin Adler  <darin@apple.com>
9744
9745         Reviewed by Ken.
9746
9747         - fixed 3191163 -- hang in QPtrListIterator at www.phiffer.com
9748         - fixed 3183520 -- XML page has no vertical scrollbar
9749
9750         The hang was due to an exponential algorithm in lowest/rightmostPosition.
9751         Fixed by making some simplifications to these functions, used only to determine the size
9752         of the entire web page. While doing that I cleared some things up that made the XML
9753         scroll bar problem go away too.
9754         
9755         Note that www.phiffer.com still does not render right.
9756
9757         * khtml/rendering/render_block.cpp:
9758         (RenderBlock::lowestPosition): Since this is always called on the whole tree, don't worry
9759         about which parent deals with which child. Just make sure that every object is visited
9760         exactly once.
9761         (RenderBlock::rightmostPosition): Ditto.
9762         * khtml/rendering/render_html.cpp: (RenderHtml::layout): Use the result from calling
9763         lowestPosition on the root, since some floating/positioned objects hang off there, rather
9764         than here. This seems consistent with the long term approach of doing more work in the root
9765         and less in RenderHtml, since XML documents don't have a RenderHtml.
9766         * khtml/rendering/render_root.cpp:
9767         (RenderRoot::docHeight): Call lowestPosition() on self rather than on children. Now that
9768         I understand the method, it's clear this is the correct way to do things.
9769         (RenderRoot::docWidth): Ditto, but rightmostPosition().
9770
9771         - fixed 3211289 -- REGRESSION: nil-deref in bridgeForWidget
9772
9773         Maciej may have some ideas about how to fix this even better, but this
9774         is better than just rolling his change out.
9775
9776         * kwq/KWQKHTMLPart.mm:
9777         (KWQKHTMLPart::nextKeyViewForWidget): Added an assertion.
9778         (KWQKHTMLPart::bridgeForWidget): Handle case where node is 0 by returning 0.
9779         (KWQKHTMLPart::partForNode): Added an assertion.
9780         (KWQKHTMLPart::nodeForWidget): Handle case where eventFilterObject is 0 by returning 0.
9781         (KWQKHTMLPart::setDocumentFocus): Quietly do nothing if the node is 0.
9782         (KWQKHTMLPart::clearDocumentFocus): Quietly do nothing if the node is 0.
9783
9784 2003-03-27  David Hyatt  <hyatt@apple.com>
9785
9786         A collection of fixes for tables.
9787
9788         (1) Fixed table layout should only be used if an explicit width
9789         is specified on a table.
9790         (2) width="0" and height="0" should be ignored on table cells!
9791         (3) Fixed table layout wasn't spreading extra space over 
9792         columns.
9793         
9794         Reviewed by mjs
9795
9796         * khtml/html/html_tableimpl.cpp:
9797         (HTMLTableCellElementImpl::parseAttribute):
9798         * khtml/rendering/render_table.cpp:
9799         (RenderTable::setStyle):
9800         * khtml/rendering/table_layout.cpp:
9801         (FixedTableLayout::layout):
9802
9803 2003-03-27  David Hyatt  <hyatt@apple.com>
9804
9805         Fix for the top of directory.apple.com.  Only use the fixed
9806         width on the cell (with nowrap set) if it is *larger* than
9807         our current minwidth.
9808         
9809         Reviewed by darin
9810
9811         * khtml/rendering/render_table.cpp:
9812         (RenderTableCell::calcMinMaxWidth):
9813
9814 2003-03-27  David Hyatt  <hyatt@apple.com>
9815
9816         Fix for 3166374.  When a float is removed, crawl up and down the
9817         tree looking for blocks that contain the float and dirty them all.
9818         
9819         Reviewed by darin
9820
9821         * ChangeLog:
9822         * khtml/rendering/render_block.cpp:
9823         * khtml/rendering/render_block.h:
9824         * khtml/rendering/render_object.cpp:
9825         (RenderObject::markAllDescendantsWithFloatsForLayout):
9826         (RenderObject::removeFromObjectLists):
9827         * khtml/rendering/render_object.h:
9828
9829 2003-03-27  Maciej Stachowiak  <mjs@apple.com>
9830
9831         Reviewed by Darin.
9832
9833         - fixed 3192344 - nil-deref in KWin::info scrolling amazon while other shopping tabs load
9834         - fixed 3098365 - Default window size changes as a result of popup windows
9835         - fixed 3189291 - javascript window.close() closes window, not just originating tab
9836
9837         * kwq/KWQKHTMLPart.h:
9838         * kwq/KWQKHTMLPart.mm:
9839         (KWQKHTMLPart::scheduleClose): Close via the bridge, not the window directly.
9840         (KWQKHTMLPart::bridgeForWidget): Take const QWidget * instead of QWidget *.
9841         (KWQKHTMLPart::nodeForWidget): Likewise.
9842         (KWQKHTMLPart::khtmlMousePressEvent): Deal with responder issues via bridge,
9843         not window directly.
9844         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Likewise.
9845         (KWQKHTMLPart::mouseDown): Likewise.
9846         * kwq/KWQKHTMLPartBrowserExtension.mm:
9847         (KHTMLPartBrowserExtension::createNewWindow): Set resizability via bridge,
9848         not window directly.
9849         * kwq/KWQTextArea.mm:
9850         (-[KWQTextArea becomeFirstResponder]): Deal with bridge for first responder
9851         issues, not window directly.
9852         (-[KWQTextArea drawRect:]): Likewise.
9853         (-[KWQTextAreaTextView insertTab:]): Likewise.
9854         (-[KWQTextAreaTextView insertBacktab:]): Likewise.
9855         (-[KWQTextAreaTextView shouldDrawInsertionPoint]): Likewise.
9856         (-[KWQTextAreaTextView selectedTextAttributes]): Likewise.
9857         * kwq/KWQWidget.mm:
9858         (QWidget::setActiveWindow): Focus window via bridge.
9859         (QWidget::hasFocus): Handle first responder issues via bridge.
9860         (QWidget::setFocus): Likewise.
9861         (QWidget::isVisible): Get window from bridge.
9862         (QWidget::mapFromGlobal): Get window from bridge.
9863         (QWidget::disableFlushDrawing): Add comment noting why it's OK
9864         to get the window from the view instead of from the bridge here.
9865         (QWidget::enableFlushDrawing): Likewise.
9866         * kwq/KWQWindowWidget.mm:
9867         (KWQWindowWidget::frameGeometry): Work through bridge, not window
9868         directly.
9869         (KWQWindowWidget::mapToGlobal): Likewise.
9870         (KWQWindowWidget::setFrameGeometry): Likewise.
9871         * kwq/WebCoreBridge.h:
9872
9873 2003-03-27  David Hyatt  <hyatt@apple.com>
9874
9875         This is just a long-standing screwup where I didn't port an old
9876         table fix I made to Lars' new table code properly.  The original
9877         fix had this check in it.
9878
9879         The bug is 3171963 (cvs.com).
9880         
9881         Reviewed by darin
9882
9883         * khtml/rendering/render_table.cpp:
9884         (RenderTableSection::layoutRows):
9885
9886 2003-03-27  Darin Adler  <darin@apple.com>
9887
9888         Reviewed by Trey.
9889
9890         - fixed 3156509 -- Safari fills src="" frame with current contents of frameset instead of leaving it empty
9891
9892         The trick here is to always use "about:blank" when the frame URL is empty string.
9893         If we pass the empty string elsewhere, it's going to get passed to completeURL and
9894         turned into a reference to the current document, and we have to avoid doing that
9895         ourselves explicitly too.
9896
9897         * khtml/html/html_baseimpl.cpp:
9898         (HTMLFrameElementImpl::HTMLFrameElementImpl): Let the URL default to null rather
9899         than "about:blank". We do want to treat the frame as "about:blank", but that's not
9900         something people should see when inspecting the frame via the DOM.
9901         (HTMLFrameElementImpl::isURLAllowed): Allow empty URLs explicitly, so we don't
9902         call completeURL on them.
9903         (HTMLFrameElementImpl::updateForNewURL): Map empty URLs to "about:blank" at this level.
9904         (HTMLFrameElementImpl::attach): Do the same thing here. At some point we can share more
9905         code between these two.
9906         (HTMLFrameElementImpl::setLocation): Change this to call updateForNewURL. Not only does
9907         this make us handle the empty URL case properly, it also gets the benefit of other things
9908         we do in updateForNewURL, like handling the "isURLAllowed" rule, and properly handling
9909         the case where we already have a suitable frame.
9910
9911         - other changes
9912
9913         * kwq/KWQKHTMLView.mm: Improved a comment.
9914
9915 === Safari-69 ===
9916
9917 2003-03-26  Maciej Stachowiak  <mjs@apple.com>
9918
9919         Reviewed by Chris.
9920
9921         - fix unitialized access.
9922         
9923         * kwq/KWQKHTMLPart.mm:
9924         (KWQKHTMLPart::KWQKHTMLPart):
9925
9926 2003-03-26  Maciej Stachowiak  <mjs@apple.com>
9927
9928         Reviewed by Trey.
9929
9930         Made progress towards better handling of window operations.
9931         
9932         * khtml/ecma/kjs_window.cpp:
9933         (Window::get): Replace a few part->widget() calls with part->view() -- just
9934         as good for the real khtml, but easier to adapt to with KWQ.
9935         (WindowFunc::tryCall): Likewise.
9936         * khtml/khtmlview.h:
9937         * kwq/KWQKHTMLPart.h:
9938         * kwq/KWQKHTMLPart.mm:
9939         (KWQKHTMLPart::~KWQKHTMLPart): Delete the window widget.
9940         (KWQKHTMLPart::topLevelWidget): Return the window widget.
9941         (KWQKHTMLPart::setBridge): Make a new window widget passing it the bridge.
9942         * kwq/KWQKHTMLView.mm:
9943         (KHTMLView::topLevelWidget): Moved here from KHTMLView; get the top level
9944         widget from the part.
9945         (KHTMLView::mapToGlobal): Moved here from KHTMLView; add a needed cast.
9946         * kwq/KWQWidget.h:
9947         * kwq/KWQWidget.mm: Remove all top level widget considerations.
9948         * kwq/KWQWindowWidget.h:
9949         * kwq/KWQWindowWidget.mm:
9950         (KWQWindowWidget::KWQWindowWidget): Changed to work based on bridge, not window.
9951         (KWQWindowWidget::~KWQWindowWidget): Ditto.
9952         (KWQWindowWidget::frameGeometry): Ditto.
9953         (KWQWindowWidget::mapToGlobal): Ditto.
9954         (KWQWindowWidget::mapFromGlobal): Ditto.
9955         (KWQWindowWidget::setFrameGeometry): Ditto.
9956
9957         Also:
9958
9959         * kwq/KWQKHTMLPart.cpp: Removed stuff that did not belong here.
9960         * kwq/KWQKHTMLPart.mm:
9961         (KWQKHTMLPart::selectionStartOffset): Moved here from KWQKHTMLPart.cpp
9962         (KWQKHTMLPart::selectionEndOffset): Likewise.
9963         (KWQKHTMLPart::selectionStart): Likewise.
9964         (KWQKHTMLPart::selectionEnd): Likewise.
9965         (KWQKHTMLPart::selectionRect): Likesie.
9966
9967 2003-03-26  Darin Adler  <darin@apple.com>
9968
9969         Reviewed by Trey.
9970
9971         - fixed a storage leak when running cvs-base
9972
9973         * khtml/rendering/render_list.h: Added _markerInstalledInParent.
9974         * khtml/rendering/render_list.cpp:
9975         (RenderListItem::setStyle): Set _markerInstalledInParent to false when
9976         creating a new marker.
9977         (RenderListItem::detach): Detach the marker if it's not not installed in the
9978         parent yet.
9979         (RenderListItem::updateMarkerLocation): Set _markerInstalledInParent to true
9980         when installing the marker in a parent.
9981
9982 2003-03-26  David Hyatt  <hyatt@apple.com>
9983
9984         Make <label> use tag list 1.  Fixes 3206063.  Residual style
9985         changes called this out.
9986         
9987         Reviewed by darin
9988
9989         * khtml/html/dtd.cpp:
9990         (DOM::checkChild):
9991
9992 2003-03-26  Darin Adler  <darin@apple.com>
9993
9994         Reviewed by Ken.
9995
9996         - fixed 3208468 -- REGRESSION: checkbox immediately unchecks the first time you check it
9997
9998         The stateChanged signal must be delivered before the mouse up event is handled.
9999
10000         * kwq/KWQButton.mm:
10001         (-[KWQButton initWithQButton:]): Use [self init] instead of [super init]; no real difference,
10002         just makes more logical sense.
10003         (-[KWQButton action:]): Don't send the mouse up event here.
10004         (-[KWQButton sendConsumedMouseUpIfNeeded]): Added. New method that sends the consumed mouse
10005         up event.
10006         (-[KWQButton mouseDown:]): Use a simplified scheme that uses only a single boolean to control
10007         sending the consumed mouse up event. Call sendConsumedMouseUpIfNeeded to do the deed.
10008         (QButton::clicked): Added comment to explain why it's important to send the consumed mouse
10009         up event here. Added a call to the new sendConsumedMouseUpIfNeeded method, replacing the
10010         code that was formerly in -[KWQButton action:].
10011
10012 2003-03-25  David Hyatt  <hyatt@apple.com>
10013
10014         Fix font-family parsing to match the spec (and other browsers).
10015
10016         This fixes bugs 3197584 and 3207760.
10017
10018         Also fix pseudos to be lower-cased.  Fixes 3208303.
10019         
10020         Reviewed by darin
10021
10022         * khtml/css/css_valueimpl.h:
10023         * khtml/css/cssparser.cpp:
10024         (CSSParser::parseFontFamily):
10025
10026 2003-03-24  Trey Matteson  <trey@apple.com>
10027
10028         Pass -seg_addr_table_filename <FILENAME> to ld.  This makes our frameworks in
10029         SYMROOT actually work for symbol resolution because they will have the correct
10030         prebinding address.  It also fixes obscure B&I problems with prebinding
10031         reported by Matt Reda.
10032
10033         Note the reason all this is tricky for our projects is that we have a different
10034         install location for Jaguar and Panther.  The purpose of this arg is to declare
10035         at link time our eventual location, which allows the prebinding address to be
10036         found in /AppleInternal/Developer/seg_addr_table.  We use a funky back-tick
10037         expression within OTHER_LDFLAGS to get a conditional value depending on the
10038         build train we are in.
10039
10040         This can all go away once we only build on Panther and don't embed the
10041         frameworks inside the Safari.app wrapper.
10042
10043         In addition I fixed the OTHER_LDFLAGS settings in our build styles to be
10044         additive instead of overriding, so we have the args we used for B&I in force
10045         when building outside of B&I.
10046
10047         Reviewed by Maciej.
10048
10049         * WebCore.pbproj/project.pbxproj:
10050
10051 2003-03-24  David Hyatt  <hyatt@apple.com>
10052
10053         Clean up isInlineFlow.  Add a couple of new methods that I'll
10054         be converting code over to use (carefully) piece by piece in
10055         future patches.
10056         
10057         Reviewed by gramps
10058
10059         * khtml/rendering/render_block.h:
10060         * khtml/rendering/render_flow.h:
10061         * khtml/rendering/render_inline.h:
10062         * khtml/rendering/render_object.cpp:
10063         (RenderObject::setStyle):
10064         * khtml/rendering/render_object.h:
10065
10066 2003-03-24  Maciej Stachowiak  <mjs@apple.com>
10067
10068         Reviewed by Richard.
10069
10070         - fixed 3083339 - significant top and side margin appended to new windows
10071
10072         * kwq/KWQKHTMLPartBrowserExtension.mm:
10073         (KHTMLPartBrowserExtension::createNewWindow): Account for distinction between
10074         frame and content rect.
10075         * kwq/KWQStyle.h: Return 0 for the appropriate style to avoid
10076         adding extra padding when making a new window from JavaScript.
10077         * kwq/WebCoreBridge.h: Prototype new methods.
10078
10079 2003-03-24  David Hyatt  <hyatt@apple.com>
10080
10081         Fix for crash on www.lnt.com.  3199929 is the bug number.  
10082
10083         Blocks must have all their kids as inlines or all theirs kids
10084         as blocks.  Floats and positioned elements are special and
10085         disregarded when this check occurs.  
10086
10087         If a float or positioned element suddenly becomes a normal flow
10088         element again, then the parent block might have to make its kids
10089         all be non-inline or it might have to wrap a normal flow inline
10090         with an anonymous block.
10091
10092         This patch fixed RenderObject's setStyle method to check for
10093         this situation and to make the parent block fix itself up
10094         appropriately.
10095         
10096         Reviewed by darin
10097
10098         * khtml/rendering/render_object.cpp:
10099         (RenderObject::setStyle):
10100
10101 2003-03-24  David Hyatt  <hyatt@apple.com>
10102
10103         ignore the float property on first-letter styles.
10104         The bug # is 3186044.
10105         
10106         Reviewed by darin
10107
10108         * khtml/css/parser.cpp:
10109         * khtml/rendering/render_block.cpp:
10110
10111 2003-03-24  David Hyatt  <hyatt@apple.com>
10112
10113         Add error-handling case to deal with a common CSS malformation:
10114
10115         clip: rect( )
10116
10117         The bug is 3206171.
10118         
10119         Reviewed by darin
10120
10121         * khtml/css/parser.cpp:
10122         * khtml/css/parser.y:
10123
10124 2003-03-22  Darin Adler  <darin@apple.com>
10125
10126         Reviewed by John.
10127
10128         - fixed 3203869 -- Monaco 9 looks different in Safari than in TextEdit (uses outline instead of bitmap)
10129
10130         * kwq/KWQFontMetrics.mm: (QFontMetricsPrivate::getRenderer): Get a new renderer
10131         if the one we have is wrong printer-vs-screen-wise. For speed, use a global
10132         variable rather than methods.
10133         * kwq/KWQPainter.mm: (QPainter::_updateRenderer): Get a new renderer if the
10134         one we have is wrong printer-vs-screen-wise. For speed, use a global variable
10135         rather than methods.
10136
10137         * kwq/KWQTextRendererFactory.h: Added. Exposes a global variable that tells whether we are
10138         in global "using printer font" mode.
10139         * kwq/WebCoreTextRendererFactory.h: Added setUsingPrinterFonts: and usingPrinterFonts methods.
10140         * kwq/WebCoreTextRendererFactory.m:
10141         (-[WebCoreTextRendererFactory setUsingPrinterFonts:]): Added. Sets global.
10142         (-[WebCoreTextRendererFactory usingPrinterFonts]): Added. Returns value of global.
10143
10144         * WebCore.pbproj/project.pbxproj: Added KWQTextRendererFactory.h.
10145
10146 2003-03-22  David Hyatt  <hyatt@apple.com>
10147
10148         Fix the top of the gamespot.com page on the PLT.  The
10149         clear status for <br> should be ignored if/when we decide
10150         to ignore the <br> because the previous line didn't break 
10151         cleanly.
10152         
10153         Reviewed by gramps
10154
10155         * khtml/rendering/bidi.cpp:
10156
10157 2003-03-22  David Hyatt  <hyatt@apple.com>
10158
10159         Loosen up the DTD for <dl>, <dt>, and <dd> so that they can
10160         occur anywhere in a document and be independent of one 
10161         another.
10162         
10163         Reviewed by darin/gramps
10164
10165         * khtml/html/dtd.cpp:
10166         (DOM::checkChild):
10167
10168 2003-03-22  David Hyatt  <hyatt@apple.com>
10169
10170         Bottom border/padding was incorrectly being used in float
10171         computations.  The fix is trivial... positioning of floats
10172         occurs before you add in the bottom border/padding rather
10173         than after.
10174
10175         Also implementing support for transparent borders and adding
10176         code that understands how to draw more complex polys when
10177         individual sides are transparent.  This code existed for left
10178         and right borders, but not for top and bottom borders.
10179
10180         These two fixes make the tantek demo found at:
10181
10182         http://www.tantek.com/map.html
10183
10184         work properly for the first time in Safari.
10185         
10186         Reviewed by darin
10187
10188         * ChangeLog:
10189         * khtml/css/cssparser.cpp:
10190         (CSSParser::parseValue):
10191         * khtml/css/cssstyleselector.cpp:
10192         * khtml/rendering/bidi.cpp:
10193         * khtml/rendering/render_object.cpp:
10194         (RenderObject::paintBorder):
10195         * khtml/rendering/render_style.h:
10196
10197 2003-03-21  David Hyatt  <hyatt@apple.com>
10198
10199         Fixes for all 4 macromedia rendering problems.  They were all
10200         related to buggy float handling.  
10201
10202         The bugs are 3194998, 3195014, 3915155, 3204114.
10203
10204         This patch splits floats and positioned elements into two lists
10205         instead of 1, and it also adds better logic for clearing out
10206         floats when blocks move vertically.
10207         
10208         Reviewed by darin
10209
10210         * khtml/rendering/bidi.cpp:
10211         * khtml/rendering/render_block.cpp:
10212         * khtml/rendering/render_block.h:
10213         * khtml/rendering/render_container.cpp:
10214         (RenderContainer::detach):
10215         * khtml/rendering/render_flow.cpp:
10216         (RenderFlow::addChildWithContinuation):
10217         * khtml/rendering/render_inline.cpp:
10218         (RenderInline::addChildToFlow):
10219         (RenderInline::nodeAtPoint):
10220         * khtml/rendering/render_object.cpp:
10221         (RenderObject::setStyle):
10222         (RenderObject::removeFromObjectLists):
10223         (RenderObject::nodeAtPoint):
10224         * khtml/rendering/render_object.h:
10225         * khtml/rendering/render_root.cpp:
10226         (RenderRoot::layout):
10227         * khtml/rendering/render_table.cpp:
10228         (RenderTable::layout):
10229
10230 2003-03-21  Darin Adler  <darin@apple.com>
10231
10232         Reviewed by John.
10233
10234         - fixed 3203212 -- nil-deref in khtml::CachedImage::isErrorImage at turbotax.com
10235
10236         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::removeImage): Remove all occurrences
10237         of the image from the list. We don't try to prevent multiple occurrences from getting
10238         in there. Also use removeRef instead of remove, for speed.
10239
10240 2003-03-21  Darin Adler  <darin@apple.com>
10241
10242         Reviewed by John.
10243
10244         - fixed 3204660 -- EUC decoding not used for japanese yahoo page
10245
10246         * khtml/misc/decoder.cpp: (Decoder::decode):
10247         Do the search for charset= in a case-insensitive way. It's possible that other
10248         browsers are case-insensitive, but also possible that it's just Japanese
10249         auto-detect that papers over this problem there.
10250         
10251         - other changes
10252         
10253         * kwq/KWQString.mm: (QString::hash): Get rid of unnecessary code to avoid hashes of 0.
10254         This is useful in the place in JavaScriptCore where we copied this from, but
10255         it is not helpful here (slightly ugly and does slow things down a smidgen).
10256         
10257         * kwq/WebCoreTextRendererFactory.m: Remove unused method.
10258
10259 2003-03-20  David Hyatt  <hyatt@apple.com>
10260
10261         Fix the color handling of link= attributes on <body> elements
10262         to pass in the quirks mode so that lax parsing can take place.
10263         
10264         Reviewed by rjw and john
10265
10266         * khtml/html/html_baseimpl.cpp:
10267         (HTMLBodyElementImpl::parseAttribute):
10268
10269 2003-03-20  Richard Williamson   <rjw@apple.com>
10270
10271         Use "Item" consistently in the WebHistory and WebBackForwardList.
10272         Change createSharedHistoryWithFile: to setSharedHistory:
10273         Make the various page cache methods per WebBackForwardList instead of global.
10274         
10275         Reviewed by gramps.
10276
10277         * kwq/KWQKHistoryProvider.mm:
10278         * kwq/WebCoreHistory.h:
10279
10280 2003-03-20  David Hyatt  <hyatt@apple.com>
10281
10282         Always do residual style fixups in all three Safari rendering
10283         modes.
10284         
10285         Reviewed by darin
10286
10287         * khtml/html/htmlparser.cpp:
10288         (KHTMLParser::popBlock):
10289
10290 === Safari-68 ===
10291
10292 2003-03-19  David Hyatt  <hyatt@apple.com>
10293
10294         Adding a few more tags to the list of ones to check for
10295         residual style.
10296         
10297         Reviewed by gramps
10298
10299         * khtml/html/htmlparser.cpp:
10300         (KHTMLParser::isResidualStyleTag):
10301         (KHTMLParser::isAffectedByResidualStyle):
10302
10303 2003-03-19  David Hyatt  <hyatt@apple.com>
10304
10305         Fix continuations so that they are smarter about reusing
10306         anonymous blocks.  Avoids deep nesting when it isn't 
10307         necessary.
10308
10309         A complete implementation of the residual style fixes.  It
10310         seems to fix all current outstanding bugs.
10311
10312         One of the bugs in the residual style list was caused by
10313         font-weight not being reset to tables and is actually its
10314         own problem.  I fixed that by moving the quirks resets for
10315         table elements into the quirks stylesheet (which should be
10316         a speed boost).
10317         
10318         <b><p>Foo</b> Goo</p>
10319
10320         Also fixed the huge XML failure issue that made us fail hundreds
10321         of test cases.  Attachment of text nodes was being done way too
10322         early, before the text of the node had been determined.  By moving
10323         the attachment from enterText to exitText, the problem is solved.
10324         
10325         Reviewed by darin (res. style fix 1) and gramps (rest of res. style fix and XML fix)
10326
10327         * khtml/css/quirks.css:
10328         * khtml/html/html_tableimpl.cpp:
10329         (HTMLTableElementImpl::attach):
10330         * khtml/html/htmlparser.cpp:
10331         (KHTMLParser::isResidualStyleTag):
10332         (KHTMLParser::isAffectedByResidualStyle):
10333         (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
10334         (KHTMLParser::reopenResidualStyleTags):
10335         (KHTMLParser::popBlock):
10336         (KHTMLParser::popOneBlock):
10337         * khtml/html/htmlparser.h:
10338         * khtml/rendering/render_inline.cpp:
10339         (RenderInline::splitFlow):
10340         * khtml/xml/xml_tokenizer.cpp:
10341         (XMLHandler::enterText):
10342         (XMLHandler::exitText):
10343         
10344 2003-03-18  Darin Adler  <darin@apple.com>
10345
10346         Reviewed by Ken.
10347
10348         - fixed 3197684 -- <textarea wrap="hard"> behaves incorrectly (bugzilla)
10349
10350         By doing the line breaking inside the KWQ class for textarea we can both remove
10351         the broken lineOfCharAtIndex: method and avoid the n-squared algorithm KHTML uses to
10352         insert hard line breaks.
10353
10354         * khtml/rendering/render_form.cpp: (RenderTextArea::text):
10355         Call textWithHardLineBreaks on widget instead of trying to break lines here.
10356         
10357         * kwq/KWQTextEdit.h: Added textWithHardLineBreaks member function. Made text member function
10358         const. Got rid of text(int), paragraphs, paragraphLength, and lineOfChar member functions.
10359         * kwq/KWQTextEdit.mm:
10360         (QTextEdit::text): Made this const, and move code that transforms CRLF and CR into LF
10361         inside KWQTextArea.
10362         (QTextEdit::textWithHardLineBreaks): Added. Calls new textWithHardLineBreaks method.
10363
10364         * kwq/KWQTextArea.h: Added textWithHardLineBreaks method. Removed numLines, textForLine:,
10365         paragrahs, paragraphLength:, textForParagraph:, and lineOfCharAtIndex: methods.
10366         * kwq/KWQTextArea.mm:
10367         (-[KWQTextArea initWithQTextEdit:]): Call [self init] for clarity instead of [super init].
10368         In both cases, we end up calling [self initWithFrame:].
10369         (-[KWQTextArea text]): Added logic for transforming CRLF and CR into LF here instead of at
10370         the KWQTextEdit level.
10371         (-[KWQTextArea textWithHardLineBreaks]): Added. This method uses the layout manager to extract
10372         the characters for one line at a time, and put line breaks in between.
10373
10374 2003-03-18  Maciej Stachowiak  <mjs@apple.com>
10375
10376         Reviewed by Trey.
10377
10378         - fixed 3146407 - bring the window with the targeted frame to the front
10379
10380         * kwq/KWQKHTMLPartBrowserExtension.mm:
10381         (KHTMLPartBrowserExtension::createNewWindow): If we use an existing frame,
10382         focus it.
10383         * kwq/WebCoreBridge.h: Prototype focusWindow method.
10384
10385 2003-03-17  Trey Matteson  <trey@apple.com>
10386
10387         Support for password saving in forms.  Added elementIsPassword:,
10388         nuked deadwood formIsLoginForm:.
10389
10390         Reviewed by Maciej.
10391
10392         * khtml/html/html_formimpl.cpp:
10393         (HTMLFormElementImpl::submit):  Pass forms data for login forms and
10394         password fields to bridge.  This case was skipped for security in
10395         khtml's autocomplete, but we need this data to save passwords, and
10396         we enforce policy at a higher level.
10397         * khtml/html/html_formimpl.h:
10398         * kwq/WebCoreBridge.h:
10399         * kwq/WebCoreBridge.mm:
10400         Nuked formIsLoginForm:.
10401         (-[WebCoreBridge elementIsPassword:]):  New utility.
10402
10403 2003-03-18  Maciej Stachowiak  <mjs@apple.com>
10404
10405         Reviewed by John.
10406
10407         - fixed 3119663 - document.lastModified returns the wrong date format
10408
10409         * kwq/WebCoreBridge.mm:
10410         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
10411         Instead of using NSDate's default date format, use the format that
10412         IE and Gecko use.
10413
10414 2003-03-18  Maciej Stachowiak  <mjs@apple.com>
10415
10416         Reviewed by Darin.
10417
10418         * khtml/ecma/kjs_window.cpp:
10419         (WindowFunc::tryCall): Fix build, use size instead of length.
10420
10421 2003-03-18  Maciej Stachowiak  <mjs@apple.com>
10422
10423         Reviewed by John.
10424
10425         - fixed 3080337 - default values seem to be "no" when third param of window.open is an empty string
10426         
10427         * khtml/ecma/kjs_window.cpp:
10428         (WindowFunc::tryCall): Treat empty string the same as missing for
10429         third argument - leave all chrome on. Also remove support for
10430         scrollbars= property
10431
10432 2003-03-18  Darin Adler  <darin@apple.com>
10433
10434         Reviewed by Maciej.
10435
10436         - fixed 3164522 -- text encoding conversion is done a chunk at a time with no state; won't work in some cases
10437         - fixed 3164557 -- pages served with encoding UTF-16LE but no BOM character won't be decoded correctly
10438         - fixed 3164569 -- pages without BOM that have a server-specified encoding of utf-16 will fail to decode
10439         - fixed 3165002 -- can't open link with tilde (~) in page with Japanese encoding
10440         - fixed 3181297 -- can't open link with backslash (\) in page with Japanese encoding (download at netscape.com)
10441         - fixed 3182977 -- "unicode" encoding handled as UTF-16 rather than UTF-8 at www.delcom-eng.com
10442
10443         * khtml/misc/decoder.h: Add an optional "8-bit-only" parameter to the
10444         setEncoding method.
10445         * khtml/misc/decoder.cpp:
10446         (Decoder::setEncoding): Add an "8-bit-only" parameter. Use the new
10447         codeForNameEightBitOnly method when that parameter is true. Use the new
10448         usesVisualOrdering constant rather than all the hardcoded logic here to
10449         tell logical from visual Hebrew encodings.
10450         (Decoder::decode): Pass true for "8-bit-only" when the encoding came out
10451         of an HTML header, since we are already parsing the file by this point so
10452         it makes no sense to use a non-8-bit encoding.
10453         (Decoder::flush): Pass true for the "flush" parameter when calling the decoder.
10454         
10455         * kwq/KWQCharsets.h: Add a new KWQEncodingFlags enum, and return a parameter of
10456         that type (optionally) from KWQCFStringEncodingFromIANACharsetName.
10457         * kwq/KWQCharsets.mm:
10458         (buildDictionaries): Make the dictionaries lead to table entries so we can get
10459         both the flags and the encoding.
10460         (KWQCFStringEncodingFromIANACharsetName): Get the flags as well as the encoding.
10461         (KWQCFStringEncodingToIANACharsetName): Use the new dictionary format.
10462         (encodingNameHash): Removed special case for hash for 0. This was useful in
10463         JavaScriptCore where this hash function came from, but it's not relevant for
10464         a CF hash function.
10465         
10466         * kwq/KWQTextCodec.h: Added codecForNameEightBitOnly function to QTextCodec. Added optional
10467         KWQEncodingFlags parameter to QTextCodec constructor. Replaced isISOLatin1Hebrew with
10468         usesVisualOrdering. Added == and hash functions to QTextCodec. Added virtual destructor to
10469         QTextDecoder. Added optional "flush" boolean parameter to QTextDecoder's toUnicode function.
10470         * kwq/KWQTextCodec.mm:
10471         (codecForCFStringEncoding): Use both the encoding and the flags as a key for the dictionary
10472         that holds QTextCodec objects.
10473         (QTextCodec::codecForName): Pass flags through.
10474         (QTextCodec::codecForNameEightBitOnly): Added. Maps kCFStringEncodingUnicode to
10475         kCFStringEncodingUTF8.
10476         (QTextCodec::codecForLocale): Pass noEncodingFlags.
10477         (QTextCodec::makeDecoder): Pass flags to KWQTextDecoder constructor.
10478         (QTextCodec::toUnicode): Pass true for the "flush" boolean parameter to KWQTextDecoder.
10479         (operator==): Added. Compares both encoding and flags.
10480         (QTextCodec::hash): Added. Computes a hash of encoding and flags.
10481         (QTextCodecsEqual): Added. Calls operator==.
10482         (QTextCodecHash): Added. Calls hash member function.
10483         (QTextDecoder::~QTextDecoder): Added. Empty.
10484         (KWQTextDecoder::KWQTextDecoder): Made this no longer inline.
10485         (KWQTextDecoder::~KWQTextDecoder): Added. Cache the TEC object for use next time.
10486         (KWQTextDecoder::convertUTF16): Use the flags to decide on big vs. little endian when the
10487         page does not have a BOM marker that makes it unambiguous.
10488         (KWQTextDecoder::convertUsingTEC): Added flush parameter. Changed code to reuse the same
10489         converter for successive convert calls, and only flush when the flush parameter is passed.
10490         Added code to set the kUnicodeForceASCIIRangeMask. Do it directly since we can't use
10491         TECSetBasicOptions due to bug 3201405.
10492         (KWQTextDecoder::toUnicode): Pass flush parameter through.
10493         
10494         * kwq/mac-encodings.txt: Added new sections for "Unicode, bigEndian", "Unicode, littleEndian",
10495         and "ISOLatinHebrew, visualOrdering". Also moved UTF-16 to "Unicode" from "UTF8" since we now
10496         handle this with the "8-bit-only" mechanism.
10497         
10498         * kwq/make-charset-table.pl: Updated script to support flags (after a comma), and made it a bit
10499         more strict about what to do with ill-formed lines.
10500
10501         * kwq/KWQCharsetData.c: Regenerated.
10502         
10503         - other changes
10504         
10505         * kwq/KWQKHTMLPart.mm:
10506         (KWQKHTMLPart::searchForLabelsBeforeElement): Take advantage of "using" and remove
10507         unneeded namespace prefixes.
10508         (KWQKHTMLPart::matchLabelsAgainstElement): Ditto.
10509         (KWQKHTMLPart::pauseActions): Ditto.
10510         (KWQKHTMLPart::resumeActions): Add check for nil to match pauseActions. Also take
10511         advantage of "using" and remove unneeded namespace prefixes.
10512         (KWQKHTMLPart::saveWindowProperties): Use ERROR instead of ASSERT for the nil case.
10513         (KWQKHTMLPart::saveLocationProperties): Use ERROR instead of ASSERT for the nil case.
10514         (KWQKHTMLPart::restoreWindowProperties): Use ERROR instead of ASSERT for the nil case.
10515         (KWQKHTMLPart::restoreLocationProperties): Use ERROR instead of printf for the nil case.
10516         (KWQKHTMLPart::openURLFromPageCache): Take advantage of "using" and remove
10517         unneeded namespace prefixes.
10518         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Ditto.
10519         (KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
10520
10521 2003-03-16  Maciej Stachowiak  <mjs@apple.com>
10522
10523         Reviewed by Trey.
10524
10525         - fixed 3196050 - Hang in www.janegoodall.org dynamic menus
10526         
10527         * khtml/xml/dom_nodeimpl.cpp:
10528         (NodeImpl::handleLocalEvents): Copy handlers before processing
10529         them, so we don't go into an infinite loop if a handler adds or
10530         removes handlers.
10531
10532 2003-03-16  Trey Matteson  <trey@apple.com>
10533
10534         3198135 - need to fix our projects so SYMROOT is not stripped
10535
10536         Tweaked stripping options:  B&I build does not COPY_PHASE_STRIP.
10537         Deployment build still does.
10538         We strip manually as part of the install that we do ourselves.
10539
10540         Reviewed by Maciej.
10541
10542         * WebCore.pbproj/project.pbxproj:
10543
10544 2003-03-14  Richard Williamson   <rjw@apple.com>
10545
10546         Fixed 3197162.  The regression was introduced with the change
10547         to preferences.  The old settings API was used to 'reset' the jscript
10548         other properties of the part.  This effectively always disabled 
10549         javascript and prevented properties from being restored to the js
10550         property maps.
10551         
10552         Reviewed by trey.
10553
10554         * kwq/KWQKHTMLPart.mm:
10555         (KWQKHTMLPart::saveWindowProperties):
10556         (KWQKHTMLPart::saveLocationProperties):
10557         (KWQKHTMLPart::restoreWindowProperties):
10558         (KWQKHTMLPart::restoreLocationProperties):
10559         (KWQKHTMLPart::openURLFromPageCache):
10560
10561 2003-03-14  David Hyatt  <hyatt@apple.com>
10562
10563         Make :target match the root element if no #fragment is specified in
10564         the URL.
10565         
10566         Reviewed by john
10567
10568         * khtml/css/cssstyleselector.cpp:
10569
10570 2003-03-14  Maciej Stachowiak  <mjs@apple.com>
10571
10572         - fixed 3190846 - REGRESSION: can't use Fidelity NetBenefits account
10573         
10574         * khtml/html/html_baseimpl.cpp:
10575         (HTMLFrameElementImpl::updateForNewURL): Treat javascript: URLs as
10576         about:blank for now.
10577         (HTMLFrameElementImpl::attach): Likewise.
10578         * khtml/khtml_part.cpp:
10579         (KHTMLPart::processObjectRequest): Make sure to send completed() signal
10580         after signals are connectd in synchronous load case.
10581
10582 2003-03-13  David Hyatt  <hyatt@apple.com>
10583
10584         Fix for ew.com, hrweb and arstechnica forums.  A <br> should
10585         not create a nonempty line in the case where the previous line
10586         didn't break cleanly.  The fix is to have a new boolean that
10587         tracks how the previous line broke and to have <br> check that
10588         to figure out if it should set the line to be non-empty.
10589         
10590         Reviewed by gramps
10591
10592         * khtml/rendering/bidi.cpp:
10593
10594 2003-03-13  Maciej Stachowiak  <mjs@apple.com>
10595
10596         Reviewed by Trey.
10597
10598         - fixed 3188209 - REGRESSION: onmouseup handlers not running for most form elements
10599
10600         * khtml/rendering/render_form.cpp:
10601         (RenderLineEdit::RenderLineEdit): Connect to clicked signal.
10602         (RenderFileButton::RenderFileButton): Likewise.
10603         (RenderFileButton::slotClicked): Send clicked through DOM.
10604         (RenderTextArea::RenderTextArea): Connect to clicked signal.
10605         * khtml/rendering/render_replaced.cpp:
10606         (RenderWidget::sendConsumedMouseUp): New method to send a
10607         mouseUp event for this DOM element. Meant for up events consumed
10608         by AppKit mouseDown: methods that use modal event loops.
10609         * khtml/rendering/render_replaced.h:
10610         * kwq/KWQButton.h:
10611         * kwq/KWQButton.mm:
10612         (-[KWQButton initWithQButton:]): Moved here from former adaptor class.
10613         (-[KWQButton action:]): Make sure to send up before click.
10614         (-[KWQButton mouseDown:]): Record that we are processing a mouse
10615         event. If no click happened, send the missing up event.
10616         (QButton::QButton): Use NSButton subclass instead of separate adaptor.
10617         (QButton::~QButton): Likewise.
10618         * kwq/KWQFileButton.h:
10619         * kwq/KWQFileButton.mm:
10620         (KWQFileButton::KWQFileButton): Initialize clicked signal.
10621         (KWQFileButton::clicked): Emit clicked signal.
10622         (-[KWQFileButtonAdapter initWithKWQFileButton:]): Observe Clicked notification too.
10623         (-[KWQFileButtonAdapter clicked]): Send mouse up and click through DOM.
10624         * kwq/KWQLineEdit.h:
10625         * kwq/KWQLineEdit.mm:
10626         (QLineEdit::QLineEdit): Initialize clicked signal.
10627         (QLineEdit::clicked): Emit clicked signal.
10628         * kwq/KWQListBox.mm:
10629         (QListBox::QListBox): No longer use separate object as delegate and data source.
10630         (QListBox::~QListBox): No more need to retrieve and release delegate.
10631         (-[KWQTableView initWithListBox:items:]): 
10632         (-[KWQTableView mouseDown:]): Record that we are processing a mouse
10633         event; if no click happens while processing, send the mouse up event
10634         through the DOM.
10635         (-[KWQTableView tableViewSelectionDidChange:]): If sending clicked
10636         and processing a mouse event, send up first.
10637         * kwq/KWQTextArea.mm:
10638         (-[KWQTextAreaTextView mouseDown:]): Send up and click through DOM
10639         after calling super.
10640         * kwq/KWQTextEdit.h:
10641         * kwq/KWQTextEdit.mm:
10642         (QTextEdit::QTextEdit): Initialize clicked signal.
10643         (QTextEdit::clicked): Emit clicked signal.
10644         * kwq/KWQTextField.mm:
10645         (-[KWQTextField setPasswordMode:]): initWithQLineEdit: instead of initWithQWidget:
10646         (-[KWQTextField fieldEditorDidMouseDown:]): Send up and click through DOM.
10647         (-[KWQSecureTextField initWithQLineEdit:]): Store QLineEdit*, not just QWidget*.
10648         (-[KWQSecureTextField fieldEditorDidMouseDown:]): Send up and click through DOM.
10649         * kwq/KWQWidget.h:
10650         * kwq/KWQWidget.mm:
10651         (QWidget::sendConsumedMouseUp): Common method for widgets to send
10652         a mouseUp that has been consumed by mouseDown processing through
10653         the DOM.
10654         * kwq/WebCoreBridge.h:
10655         * kwq/WebCoreFirstResponderChanges.h:
10656         * kwq/WebCoreViewFactory.m:
10657         * WebCore.exp: Export new string constant.
10658         * WebCore-combined.exp: Regenerated.
10659
10660 2003-03-13  Richard Williamson   <rjw@apple.com>
10661
10662         First stage of the WebController -> WebView, WebView -> WebFrameView.
10663         This change does the WebView -> WebFrameView part of the change.  Also
10664         changes WebController's inheritance.  It now inherits from NSView.
10665         
10666         Reviewed by Maciej.
10667
10668         * kwq/KWQKHTMLPart.mm:
10669         (KWQKHTMLPart::nextKeyView):
10670         * kwq/KWQScrollView.mm:
10671         * kwq/KWQWidget.mm:
10672         (QWidget::getOuterView):
10673         * kwq/WebCoreBridge.h:
10674         * kwq/WebCoreBridge.mm:
10675         (-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
10676         (-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
10677
10678 2003-03-13  Darin Adler  <darin@apple.com>
10679
10680         - remove mistaken inlining to fix build with newer versions of gcc
10681
10682         * khtml/rendering/render_object.cpp: (RenderObject::container):
10683         Don't mark this inline.
10684
10685 2003-03-13  David Hyatt  <hyatt@apple.com>
10686
10687         This is a fix to stop creating textruns for the whitespace at the
10688         end of a block.  This is a major line layout bug that leads to the
10689         height of the last line in a paragraph being wrong, especially when
10690         <font> tags are used.
10691
10692         Example of the problem:
10693           <div><nobr>foo</nobr> </div>
10694
10695         The whitespace between the </nobr> and the end of the </div> was
10696         being counted when it should have been stripped.  The problem was
10697         an off-by-one error with the endpoint I set up.  I used a position
10698         of 0, which is inclusive, so I needed a new value that meant
10699         "Stop on this object and don't include any of it."  I'm using
10700         UINT_MAX as this special value for the position.
10701         
10702         Reviewed by john
10703
10704         * khtml/rendering/bidi.cpp:
10705         * khtml/rendering/bidi.h:
10706
10707 2003-03-13  Darin Adler  <darin@apple.com>
10708
10709         Reviewed by Dave.
10710
10711         - fixed 3197728 -- REGRESSION: crash at http://transitive.com/company.htm
10712
10713         * khtml/rendering/bidi.cpp: (appendRun): Added an if statement to handle
10714         the case where obj is 0; the while loop already handled that case.
10715
10716         - did the "no inlining workaround" needed for newer versions of gcc
10717
10718         * khtml/css/parser.y: Added #define __inline as we have elsewhere.
10719         * khtml/css/parser.cpp: Regenerated.
10720
10721 2003-03-13  David Hyatt  <hyatt@apple.com>
10722
10723         Add color dumping and bgcolor dumping to the render dump tool.
10724         
10725         Reviewed by darin
10726
10727         * kwq/KWQRenderTreeDebug.cpp:
10728         (operator<<):
10729
10730 2003-03-13  David Hyatt  <hyatt@apple.com>
10731
10732         Fix for 3193407, crash in CSS parser on www.hixie.ch.  Improved the grammar to
10733         understand the CSS3 :not selector so that it wouldn't think of that case as an
10734         error.  Also patched the error handling case that crashed on :not anyway.  Then
10735         I went ahead and implemented :not (since it was trivial to add once the parser
10736         was reading it in).
10737         
10738         Also fixed the regression that the * selector didn't work.  The new KHTML trunk moved
10739         away from a tag value of -1 in order to do @namespace support.  Since we aren't really ready
10740         to take that code yet, I patched our parser.y to treat * like -1 instead of 0xffff.
10741         
10742         Implemented support for a couple of new CSS3 selectors, :root and ::selection.  Also :last-child and :only-child.
10743         
10744         Fixed a trivial bug (demonstrated in the CSS3 test suite) with the matching of the ~= selector.
10745  
10746         Reviewed by darin
10747
10748         * khtml/css/Makefile.am:
10749         * khtml/css/css_base.cpp:
10750         (CSSSelector::extractPseudoType):
10751         * khtml/css/css_base.h:
10752         * khtml/css/cssstyleselector.cpp:
10753         * khtml/css/parser.cpp:
10754         * khtml/css/parser.y:
10755         * khtml/rendering/render_style.h:
10756         * khtml/rendering/render_text.cpp:
10757         (TextRun::paintSelection):
10758         (RenderText::paintObject):
10759
10760 === Safari-67 ===
10761
10762 2003-03-13  Darin Adler  <darin@apple.com>
10763
10764         Reviewed by Maciej.
10765
10766         - fixed 3194451 -- Textarea COLS='40.0' displays with width of 0
10767
10768         * khtml/xml/dom_stringimpl.h: Changed toInt to not be inline any more.
10769         It was already really too big for inline to be a good optimization.
10770         * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toInt): Rewrote this to
10771         find the valid characters at the start of the string, rather than strip
10772         invalid characters from the end. The old code would strip non-digits from
10773         the end, which doesn't help with a string like "40.0" or even "40 garbage3".
10774
10775         - fixed a bit of int/long sloppiness
10776         
10777         * kwq/KWQString.mm:
10778         (QString::toLong): Use LONG_MAX, not INT_MAX.
10779         (QString::toULong): Use ULONG_MAX, not UINT_MAX.
10780
10781 2003-03-12  Richard Williamson   <rjw@apple.com>
10782
10783         Fixed leak of RenderRoot.
10784         
10785         Reviewed by darin.
10786
10787         * kwq/KWQPageState.mm:
10788         (-[KWQPageState invalidate]):  Added comment.
10789         (-[KWQPageState dealloc]):  Ensure that the renderer is "re"set on
10790         the document so it will be correctly cleaned up in detach.
10791
10792 2003-03-12  David Hyatt  <hyatt@apple.com>
10793
10794         Two fixes.  The first is more help with macromedia.  Floats could
10795         get lost and not painted by the correct layer still.  The new
10796         code is more robust about checking if a layer crossing occurred
10797         in the case where you want to addOverhangingFloats to a parent.
10798
10799         The second fix changes the priority of space allocation when
10800         growing cells from their minwidths to their preferred widths.
10801         The old code did fixed and then percent.  The new code does
10802         percent and then fixed.
10803
10804         Also when tables are overconstrained after growing cells to their
10805         effective widths, instead of shrinking cells without regard for
10806         their type, I implemented a shrink system that follows the same
10807         priority (reversed) that was used when growing the cells originally.
10808         
10809         Reviewed by darin
10810
10811         * khtml/rendering/render_block.cpp:
10812         * khtml/rendering/table_layout.cpp:
10813         (AutoTableLayout::layout):
10814
10815 2003-03-12  Trey Matteson  <trey@apple.com>
10816
10817         3190784 REGRESSION: crash in KWQListIteratorImpl in form completion code at sonyericsson.com page
10818
10819         Don't crash on an input element with no enclosing form.
10820
10821         * kwq/WebCoreBridge.mm:
10822        (-[WebCoreBridge formForElement:]):  Gracefully bail on !form.
10823
10824 2003-03-11  David Hyatt  <hyatt@apple.com>
10825
10826         Fix for tantek's slides, this is an issue on diveintomark's
10827         list as well.  <style> was not honoring any media attributes
10828         set on it, so print stylesheets were being applied to the screen,
10829         etc.!
10830         
10831         Reviewed by rjw
10832
10833         * khtml/html/html_headimpl.cpp:
10834         (HTMLStyleElementImpl::childrenChanged):
10835         * khtml/html/html_headimpl.h:
10836
10837 === Safari-66 ===
10838
10839 2003-03-11  Darin Adler  <darin@apple.com>
10840
10841         Reviewed by John.
10842
10843         - fixed 3166759 -- two fields both look like they have focus at webmail.iquest.net due to onblur
10844
10845         * kwq/KWQTextField.mm:
10846         (-[KWQTextField selectText:]): Don't call -[NSTextField selectText:] in the case where we already
10847         have an editor, because the NSTextField version will cause the field to relinquish first responder
10848         and then take it back, which will send both onblur and onfocus.
10849         (-[KWQSecureTextField selectText:]): Same fix for the secure text field.
10850
10851 2003-03-11  David Hyatt  <hyatt@apple.com>
10852
10853         Fix the 16000 pixel tall scrollbar on macromedia.com/software.
10854         vertical-align position hints were being set to bad values.
10855         
10856         Reviewed by mjs
10857
10858         * khtml/rendering/render_object.cpp:
10859         (RenderObject::getVerticalPosition):
10860
10861 2003-03-10  David Hyatt  <hyatt@apple.com>
10862
10863         Fix for <pre> regression, bug #3193590, directory listings
10864         busted.
10865         
10866         Reviewed by gramps
10867
10868         * khtml/rendering/bidi.cpp:
10869
10870 2003-03-10  Darin Adler  <darin@apple.com>
10871
10872         Reviewed by Maciej.
10873
10874         - fixed 3010915 -- mouse wheel won't scroll the main document when you are over [i]frame
10875
10876         * kwq/WebCoreScrollView.h: Added.
10877         * kwq/WebCoreScrollView.m: Added. Overrides scrollWheel to "do the right thing".
10878         * WebCore.pbproj/project.pbxproj: Added WebCoreScrollView, and made it SPI so WebKit can use it.
10879         * WebCore.exp: Exported WebCoreScrollView so WebKit can use it.
10880         * WebCore-combined.exp: Regenerated.
10881
10882         * kwq/KWQListBox.mm: Made KWQListBoxScrollView a subclass of WebCoreScrollView instead of NSScrollView.
10883         * kwq/KWQTextArea.h: Made KWQTextArea a subclass of WebCoreScrollView instead of NSScrollView.
10884
10885         - other changes
10886
10887         * kwq/KWQComboBox.mm: Make the workaround for the position of text in the pop-up
10888         compile only when we build on Jaguar. That way a Jaguar-built Safari looks perfect on
10889         Jaguar and a Panther built one looks perfect on Panther.
10890
10891         * kwq/KWQKHTMLPart.mm: Reformatted some method calls.
10892
10893 2003-03-09  David Hyatt  <hyatt@apple.com>
10894
10895         Fix compacts and run-ins to work a lot better than they did
10896         before.  I had some huge misunderstandings with how compact
10897         worked that have now been clarified.
10898         
10899         Reviewed by kocienda
10900
10901         * khtml/rendering/bidi.cpp:
10902         * khtml/rendering/bidi.h:
10903         * khtml/rendering/render_block.cpp:
10904         * khtml/rendering/render_block.h:
10905         * khtml/rendering/render_flow.cpp:
10906         (RenderFlow::repaint):
10907         * khtml/rendering/render_line.cpp:
10908         (InlineFlowBox::placeBoxesHorizontally):
10909         * khtml/rendering/render_object.cpp:
10910         (RenderObject::nodeAtPoint):
10911         * khtml/rendering/render_object.h:
10912
10913 2003-03-08  David Hyatt  <hyatt@apple.com>
10914
10915         Check in the patch I actually meant to land.  Somehow what I landed
10916         had removed a line that was supposed to be there.
10917         
10918         * khtml/css/cssstyleselector.cpp:
10919
10920 2003-03-07  Maciej Stachowiak  <mjs@apple.com>
10921
10922         Reviewed by Trey.
10923
10924         * kwq/KWQKHTMLPart.mm:
10925         (KWQKHTMLPart::submitForm): Fix form submission (was completely broken).
10926
10927 2003-03-07  Maciej Stachowiak  <mjs@apple.com>
10928
10929         Reviewed by Richard.
10930
10931         - fixed 3127705 - don't open new window on opt-click even if the link requests it
10932         - fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
10933         
10934         * kwq/KWQKHTMLPart.h:
10935         * kwq/KWQKHTMLPart.mm:
10936         (KWQKHTMLPart::openURL): Don't use findOrCreateFrameNamed, instead pass target along.
10937         (KWQKHTMLPart::openURLRequest): Likewise.
10938         (KWQKHTMLPart::submitForm): Likewise.
10939         (KWQKHTMLPart::urlSelected): Likewise.
10940         * kwq/KWQKHTMLPartBrowserExtension.mm:
10941         (KHTMLPartBrowserExtension::createNewWindow): Likewise.
10942         * kwq/WebCoreBridge.h:
10943
10944 2003-03-07  David Hyatt  <hyatt@apple.com>
10945
10946         better fix for text-decoration issue on time.com.  
10947         
10948         Reviewed by mjs
10949
10950         * khtml/css/cssstyleselector.cpp:
10951         * khtml/rendering/render_style.h:
10952
10953 2003-03-07  David Hyatt  <hyatt@apple.com>
10954
10955         Fix for time.com regression.  Don't allow text-decoration to
10956         apply to anchor elements with no href.
10957         
10958         Reviewed by darin
10959
10960         * khtml/css/cssstyleselector.cpp:
10961
10962 2003-03-07  David Hyatt  <hyatt@apple.com>
10963
10964         Whoops. Fix regression causedb y previous checkin.
10965         
10966         Reviewed by darin
10967
10968         * khtml/css/cssstyleselector.cpp:
10969
10970 2003-03-07  David Hyatt  <hyatt@apple.com>
10971
10972         Make the :hover:active behavior much more sophisticated
10973         (and make it match WinIE, since that buggy browser is what
10974         necessitates this hack).
10975         
10976         Reviewed by darin
10977
10978         * khtml/css/cssstyleselector.cpp:
10979
10980 2003-03-06  David Hyatt  <hyatt@apple.com>
10981
10982         Fix for 3156125, regression on hiptop.com.  Caused by better
10983         nowrap handling perversely enough.  Need another quirk from
10984         Moz/WinIE to make this site behave.
10985         
10986         Reviewed by darin
10987
10988         * khtml/rendering/render_table.cpp:
10989         (RenderTableCell::calcMinMaxWidth):
10990         (RenderTableCell::setStyle):
10991
10992 2003-03-06  Darin Adler  <darin@apple.com>
10993
10994         Reviewed by John.
10995
10996         - fixed 3191027 -- REGRESSION: KWQColor assert at aol.com front page
10997
10998         * kwq/KWQColor.mm: (qRgb): Clamp to [0,0xFF] instead of asserting.
10999
11000 2003-03-06  Trey Matteson  <trey@apple.com>
11001
11002         Refinement of routine that scans the DOM for field labels.
11003         We skip nodes that have no renderer, or are invisible.
11004
11005         Reviewed by hyatt.
11006
11007         * kwq/KWQKHTMLPart.mm:
11008         (KWQKHTMLPart::searchForLabelsBeforeElement): Added check.
11009
11010 2003-03-06  David Hyatt  <hyatt@apple.com>
11011
11012         Fix for 3190580, tables should reset line-height and white-space
11013         in quirks mode.
11014         
11015         Reviewed by trey and john
11016
11017         * khtml/css/quirks.css:
11018
11019 === Safari-65 ===
11020
11021 2003-03-06  Darin Adler  <darin@apple.com>
11022
11023         Reviewed by Don.
11024
11025         - fixed 3177862 -- REGRESSION: can't upload widget at www.konfabulator.com
11026
11027         * khtml/html/html_formimpl.cpp:
11028         (fixUpfromUnicode): Add a call to fixLineBreaks here (and move this down below that function).
11029         (HTMLFormElementImpl::formData): Remove the call to fixLineBreaks here, which was being used
11030         on non-text form data, like files being uploaded.
11031
11032 2003-03-05  Trey Matteson  <trey@apple.com>
11033
11034         Autofill tweak.  In field names, replace all digits with spaces before matching
11035         labels against them.  This turns the digits to word boundaries, so field names like
11036         "address2" are matched by "address".
11037
11038         As part of this, I abandoned an earlier attempt to map Qt regexp syntax to Darwin's.
11039         Now clients just have to use Darwin's.
11040
11041         Reviewed by Maciej.
11042
11043         * kwq/KWQKHTMLPart.mm:
11044         (regExpForLabels):
11045         (KWQKHTMLPart::matchLabelsAgainstElement):  Replace digits with space.
11046         * kwq/KWQRegExp.mm:
11047         (QRegExp::KWQRegExpPrivate::compile):  Don't try to support Qt syntax.
11048
11049 2003-03-05  Darin Adler  <darin@apple.com>
11050
11051         Reviewed by John.
11052
11053         - fixed 3189442 -- REGRESSION: utf-16-little-endian.html crashes making decoder
11054
11055         * kwq/KWQCharsets.mm: (encodingNameHash): Re-add tolower call to hash function to
11056         match the equality function.
11057
11058 2003-03-04  Trey Matteson  <trey@apple.com>
11059
11060         New support for autofill.  We provide a routine that scans backwards in the text
11061         before a given element, looking for a match with a set of labels.  In addition,
11062         we provide for a similar match against the element's name.
11063
11064         To implement a few more methods in QRegExp API were implemented.
11065
11066         Reviewed by Maciej.
11067
11068         * kwq/KWQKHTMLPart.h:
11069         * kwq/KWQKHTMLPart.mm:
11070         (scanForForm):  Remove redundant call to a helper function.
11071         (regExpForLabels):  Return a regexp used to search for the set of labels.
11072         (KWQKHTMLPart::searchForLabelsBeforeElement):  Walk the DOM to scan backwards
11073         in the text before the element, apply regexp to the text we find.
11074         (KWQKHTMLPart::matchLabelsAgainstElement):  Get the element name, use regexp
11075         to check it for any of the labels.
11076         * kwq/KWQRegExp.h:
11077         * kwq/KWQRegExp.mm:
11078         (QRegExp::KWQRegExpPrivate::KWQRegExpPrivate):  Init two new ivars.
11079         (RegExpFromPattern):  Massage a non-glob expression before handing to Darwin.
11080         (QRegExp::KWQRegExpPrivate::compile):  Call RegExpFromPattern.
11081         (QRegExp::match):  Set new ivars based on match result.
11082         (QRegExp::search):  New API, just call match.
11083         (QRegExp::searchRev):  New API, call match repeatedly to (weakly) simulate a 
11084         reverse search.
11085         (QRegExp::pos):  Return info from last result.
11086         (QRegExp::matchedLength):  Return info from last result.
11087         * kwq/WebCoreBridge.h:
11088         * kwq/WebCoreBridge.mm:
11089         (-[WebCoreBridge searchForLabels:beforeElement:]):  Call straight through to part.
11090         (-[WebCoreBridge matchLabels:againstElement:]):  Call straight through to part.
11091
11092 2003-03-04  Darin Adler  <darin@apple.com>
11093
11094         Reviewed by Maciej.
11095
11096         - got rid of some framework initialization (working on bug 3188781)
11097
11098         * khtml/khtml_part.cpp:
11099         (KHTMLPart::setZoomFactor): Put some waitCursor use inside #if !APPLE_CHANGES.
11100         (KHTMLPart::reparseConfiguration): Put some waitCursor use inside #if !APPLE_CHANGES.
11101         
11102         * khtml/rendering/render_frames.cpp: (RenderFrameSet::userResize): Use KCursor cursors
11103         instead of Qt cursors.
11104
11105         * kwq/KWQNamespace.h: Remove Qt cursors.
11106         * kwq/KWQCursor.mm: Remove Qt cursors.
11107         * kwq/KWQKCursor.h: Remove waitCursor.
11108         * kwq/KWQKCursor.mm: Remove waitCursor.
11109
11110 2003-03-04  Darin Adler  <darin@apple.com>
11111
11112         Reviewed by John.
11113
11114         - fixed build rules for parser.cpp so we don't rebuild it every time
11115
11116         * khtml/css/Makefile.am: Changed target to parser.cpp, not parser.
11117
11118         - some QColor cleanup
11119
11120         * kwq/KWQColor.h: Removed the qRgba function, the unused KWQColor constructor
11121         that takes a QString parameter, and made the KWQColor constructor that takes a
11122         const char * parameter explicit.
11123         * kwq/KWQColor.mm:
11124         (QColor::QColor): Use findColor directly so we don't create and then destroy a QString.
11125         (QColor::setNamedColor): Eliminated the unnecessary special case for empty string.
11126         Get rid of the call to lower(), which is now handled by the caller. Got rid of the
11127         "can't decipher this color" ERROR, which makes little sense now that non-named colors
11128         (like hex ones) are handled at the KHTML level. Don't use setRgb to set the color,
11129         since the RGB value in the gperf table is already in the correct format to just be
11130         stored in QColor::color.
11131
11132         * khtml/misc/helper.h: Removed now-unused setNamedColor function. I'm sure this
11133         same change exists on the KHTML trunk (since the CSS parser rewrite).
11134         * khtml/misc/helper.cpp: More of the same.
11135         
11136         * khtml/misc/loader.cpp: #if !APPLE_CHANGES the places that use qRgba to set
11137         bgColor, which we don't use anyway.
11138
11139 2003-03-03  Maciej Stachowiak  <mjs@apple.com>
11140
11141         Reviewed by Richard.
11142
11143         - upgrade to new hash function in one spot that I missed:
11144
11145         * kwq/KWQString.mm:
11146         (QString::hash): Use spiffy new hash algorithm.
11147
11148 2003-03-01  Maciej Stachowiak  <mjs@apple.com>
11149
11150         Reviewed by Darin.
11151
11152         - fixed 3163855 - Need control over certain potential dialogs/sheets
11153
11154         * khtml/rendering/render_form.cpp:
11155         (RenderFileButton::RenderFileButton): Pass the part to KWQFileButton.
11156         * kwq/KWQFileButton.h:
11157         * kwq/KWQFileButton.mm:
11158         (KWQFileButton::KWQFileButton): Go through the bridge for the view,
11159         not the view factory.
11160         * kwq/KWQKHTMLPart.h:
11161         * kwq/KWQKHTMLPart.mm:
11162         (KWQKHTMLPart::runJavaScriptAlert): Go through the bridge for the panel,
11163         not the view factory.
11164         (KWQKHTMLPart::runJavaScriptConfirm): Likewise.
11165         (KWQKHTMLPart::runJavaScriptPrompt): Likewise.
11166         * kwq/WebCoreViewFactory.h: Move methods from here...
11167         * kwq/WebCoreBridge.h: ...to here.
11168
11169 2003-03-02  Maciej Stachowiak  <mjs@apple.com>
11170
11171         Reviewed by Trey.
11172
11173         Updated string hash function to match the new, improved one in
11174         JavaScriptCore.
11175         
11176         * kwq/KWQCharsets.mm:
11177         (encodingNameHash):
11178
11179 2003-03-03  Darin Adler  <darin@apple.com>
11180
11181         Reviewed by Dave.
11182
11183         - fixed 3187518 -- REGRESSION: w3c css sample page crashes in cssyyparse
11184
11185         * khtml/css/parser.y: (selector): Added code to handle the case where simple_selector is 0.
11186         * khtml/css/parser.cpp: Regenerated.
11187         
11188         - fixed regression I introduced earlier today where ID anchors wouldn't work
11189         
11190         * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
11191         Check by ID first explicitly before using DOC_ANCHORS.
11192
11193         * WebCore.pbproj/project.pbxproj: Add parser.y to the project to make it easier to open it.
11194
11195 2003-03-03  David Hyatt  <hyatt@apple.com>
11196
11197         Fix for 3185852, crash when dynamically inserting rules because
11198         of an unitialized parser variable.
11199         
11200         Reviewed by darin
11201
11202         * khtml/css/css_ruleimpl.cpp:
11203         (CSSMediaRuleImpl::insertRule):
11204         * khtml/css/css_stylesheetimpl.cpp:
11205         (CSSStyleSheetImpl::insertRule):
11206         * khtml/css/cssparser.cpp:
11207         (CSSParser::parseRule):
11208         * khtml/css/cssparser.h:
11209
11210 2003-03-03  David Hyatt  <hyatt@apple.com>
11211
11212         Clean up dynamic ID/CLASS setting/removal.  Make ID actually
11213         work when set dynamically.  Fixes bug 3173050.
11214         
11215         Reviewed by john
11216
11217         * khtml/html/html_elementimpl.cpp:
11218         (HTMLElementImpl::parseAttribute):
11219
11220 2003-03-03  Darin Adler  <darin@apple.com>
11221
11222         Reviewed by Dave.
11223
11224         - fixed 3154394 -- non-repro nil-dereference in DOM::HTMLFormElementImpl::submit
11225
11226         * khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::submit):
11227         Add checks for nil like the other methods in this file have.
11228
11229         - fixed some types to remove a bit of unnecessary overhead
11230
11231         * khtml/ecma/kjs_window.h: Change types.
11232         * khtml/ecma/kjs_window.cpp:
11233         (Window::installTimeout): Change parameter to UString, not Identifier.
11234         (WindowFunc::tryCall): Pass the UString, not Identifier.
11235         (ScheduledAction::ScheduledAction): Change parameter to use const QString & to avoid
11236         a bit of overhead.
11237         (WindowQObject::installTimeout): Change parameter to UString, not Identifier.
11238
11239 2003-03-03  David Hyatt  <hyatt@apple.com>
11240
11241         I messed up when i merged Lars' quirks color patch for CSS with
11242         my original patch.  I'm now exactly matching Lars' patch, and this
11243         now fixes bug 3181185.
11244         
11245         Reviewed by darin
11246
11247         * khtml/css/cssparser.cpp:
11248         (CSSParser::parseColor):
11249
11250 2003-03-03  David Hyatt  <hyatt@apple.com>
11251
11252         Fix for 3179084.  Fix is to just dump our code so that the new
11253         addHTMLColor code kicks in.  This code is very close to WinIE
11254         on more-colortests.html.
11255         
11256         Reviewed by darin
11257
11258         * ChangeLog:
11259         * kwq/KWQColor.mm:
11260         (QColor::setNamedColor):
11261
11262 2003-03-03  David Hyatt  <hyatt@apple.com>
11263
11264         Fix for 3178361, <th> don't draw borders.   Boneheaded mistake
11265         on my part.  Just forgot to include it along with <td> in the
11266         CSS hack for sharing cell rules.
11267         
11268         Reviewed by rjw
11269
11270         * khtml/css/cssstyleselector.cpp:
11271
11272 2003-03-03  Richard Williamson   <rjw@apple.com>
11273
11274         Fix build oops from last checkin to khtml/html/html_formimpl.cpp.
11275         
11276         Reviewed by trey
11277
11278         * khtml/html/html_formimpl.cpp:
11279         (encodeCString):
11280
11281 2003-03-03  Darin Adler  <darin@apple.com>
11282
11283         Reviewed by Dave.
11284
11285         - fixed 3183445 -- hang in QCString::length reloading page with lots of text in textarea
11286
11287         * khtml/html/html_formimpl.cpp: (encodeCString): Compute string length only once outside the loop
11288         to avoid being O(n^2) in the size of the string.
11289
11290 2003-03-03  Darin Adler  <darin@apple.com>
11291
11292         Reviewed by Trey.
11293
11294         - fixed 3180364 -- infinite loop in JavaScript at www.vw.dk (due to document.anchors problem) leads to hang
11295
11296         The underlying problem was that our document.anchors had all the anchors in it.
11297         But here's what the Gecko DOM reference documentation says about document.anchors:
11298         "For reasons of backwards compatibility, the returned set of anchors only contains
11299         those anchors created with the name attribute, not those created with the id attribute."
11300
11301         * khtml/html/html_miscimpl.cpp:
11302         (HTMLCollectionImpl::calcLength): Include only A elements with NAME attributes in the DOC_ANCHORS case.
11303         (HTMLCollectionImpl::getItem): Ditto.
11304         (HTMLCollectionImpl::getNamedItem): Ditto.
11305
11306 2003-03-02  Trey Matteson  <trey@apple.com>
11307
11308         Use a KWQPopUpButton in place of NSPopUpButton.  The only addition is that
11309         it implements the KWQWidgetHolder protocol.  This is needed in order to
11310         auto set PopUps during autofill. 
11311
11312         Reviewed by Maciej.
11313
11314         * kwq/KWQComboBox.mm:
11315         (QComboBox::QComboBox):  Make a KWQPopUpButton instead of NSPopUpButton.
11316         (QComboBox::~QComboBox):  trivial s/KWQPopUpButton/NSPopUpButton/
11317         (QComboBox::insertItem): ditto
11318         (QComboBox::sizeHint): ditto
11319         (QComboBox::baselinePosition): ditto
11320         (QComboBox::clear): ditto
11321         (QComboBox::setCurrentItem): ditto
11322         (QComboBox::currentItem): ditto
11323         (-[KWQPopUpButtonCell widget]):  Also implement KWQWidgetHolder
11324         (-[KWQPopUpButton widget]):  Implement KWQWidgetHolder by calling our cell.
11325
11326 2003-02-28  Darin Adler  <darin@apple.com>
11327
11328         * khtml/css/parser.y: Fixed bad check-in that broke the build in a subtle way.
11329         * khtml/css/parser.cpp: Regenerated.
11330
11331 2003-02-28  Trey Matteson  <trey@apple.com>
11332
11333         More support for autofill, autocomplete.
11334
11335         Pass the form element along with the values to WK when submitting.
11336
11337         isLoginForm looks for a single plain text field along with password fields, so as not to match registration forms.
11338
11339         Added means to find the "current" form on a page.
11340
11341         Added means to return the whole set of controls on a form.
11342
11343         Reviewed by Darin.
11344
11345         * khtml/html/html_elementimpl.h:
11346         Added isGenericFormElement().
11347         * khtml/html/html_formimpl.cpp:
11348         (HTMLFormElementImpl::isLoginForm):  See above.
11349         (HTMLFormElementImpl::submit):  Also register form when registering values,
11350         so it will be sent over bridge.
11351         * kwq/KWQKHTMLPart.h:  New ivar to save form along with form values to be submitted.
11352         * kwq/KWQKHTMLPart.mm:
11353         (KWQKHTMLPart::KWQKHTMLPart):  Init _formAboutToBeSubmitted ivar.
11354         (KWQKHTMLPart::~KWQKHTMLPart):  Free _formAboutToBeSubmitted ivar.
11355         (KWQKHTMLPart::openURL):  Pass form to bridge along with values.
11356         (KWQKHTMLPart::openURLRequest):   Pass form to bridge along with values.
11357         (scanForForm):  Helper function to scan forward in the DOM for a form.
11358         (KWQKHTMLPart::currentForm):  Returns current form.
11359         (KWQKHTMLPart::clearRecordedFormValues): Clear _formAboutToBeSubmitted.
11360         (KWQKHTMLPart::recordFormValue): Record _formAboutToBeSubmitted too.
11361         (KWQKHTMLPart::submitForm): Pass form to bridge along with values.
11362         (KWQKHTMLPart::urlSelected):  Pass form to bridge along with values.
11363         * kwq/KWQKHTMLPartBrowserExtension.mm:
11364         (KHTMLPartBrowserExtension::createNewWindow): Pass form to bridge along with values.
11365         * kwq/KWQTextField.mm:
11366         (-[KWQTextField setStringValue:]):
11367         Call textChanged so the changes actually make it to khtml.
11368         * kwq/WebCoreBridge.h:
11369         * kwq/WebCoreBridge.mm:
11370         (viewForElement):  New helper.
11371         (formElementFromDOMElement):    New helper.
11372         (-[WebCoreBridge formIsLoginForm:]):
11373         Changed API to operate on a form instead of a field.
11374         (-[WebCoreBridge currentForm]):  New method, described above.
11375         (-[WebCoreBridge controlsInForm:]):  New method, described above.
11376         * kwq/WebCoreDOMNode.mm:
11377         (-[WebCoreDOMNode isEqual:]):
11378         Implement this to == compare the element we contain.
11379         (-[WebCoreDOMNode hash]):  Implement to hash element ptr we contain.
11380
11381 2003-02-28  Maciej Stachowiak  <mjs@apple.com>
11382
11383         Reviewed by Trey.
11384
11385         - fixed 3180170 - filepile.com does not work correctly
11386
11387         I fixed this by making referrer work correctly for targetted
11388         cross-frame and cross-window links. It is still not working right
11389         for JavaScript window.open though.
11390
11391         * khtml/ecma/kjs_window.cpp:
11392         (WindowFunc::tryCall): Add some FIXMEs about not handling referrer right.
11393         * kwq/KWQKHTMLPart.mm:
11394         (KWQKHTMLPart::openURL): Pass referrer.
11395         (KWQKHTMLPart::openURLRequest): Pass referrer.
11396         (KWQKHTMLPart::submitForm): Pass referrer.
11397         (KWQKHTMLPart::urlSelected): Pass referrer.
11398         * kwq/KWQKHTMLPartBrowserExtension.mm:
11399         (KHTMLPartBrowserExtension::createNewWindow): Pass referrer.
11400         * kwq/WebCoreBridge.h: Ad referrer argument to loadURL:
11401
11402 2003-02-28  David Hyatt  <hyatt@apple.com>
11403
11404         Exclude <BR>s from the text-dec check.  Really fixes 3185121.
11405         
11406         Reviewed by john
11407
11408         * khtml/rendering/render_line.cpp:
11409         (shouldDrawDecoration):
11410
11411 2003-02-28  Darin Adler  <darin@apple.com>
11412
11413         Reviewed by Dave.
11414
11415         - fixed some storage leaks; this code is still leaking when we run cvs-base
11416
11417         * khtml/css/parser.y:
11418         (import): Use the new maybe_media_list (ported from KDE), and delete the
11419         media list if the current item we are parsing is not a style sheet.
11420         (maybe_media_list): Added. (ported from KDE).
11421         (media_list): Added error case so we don't leak in that case (ported from KDE).
11422         (media): Use media_list instead of media_list2 (ported from KDE).
11423         (selector_list): Added error case so we don't leak in that case (ported from KDE).
11424         (selector): Added error case so we don't leak in that case (ported from KDE).
11425         (simple_selector): Added nil-checking (ported from KDE).
11426         (element_name): Use 0xFFFF instead of -1 (ported from KDE).
11427         (specifier_list): Added error case so we don't leak in that case (ported from KDE).
11428         (declaration): Delete the expr if we don't use it because property is 0.
11429         (expr): Added error case so we don't leak in that case (ported from KDE).
11430
11431         * khtml/css/cssparser.cpp:
11432         (CSSParser::parseSheet): Delete the rule in case one was created.
11433         (CSSParser::parseRule): Zero out the rule after extracting it to return.
11434         (CSSParser::parseValue): Delete the rule in case one was created.
11435         (CSSParser::parseDeclaration): Delete the rule in case one was created.
11436
11437         * khtml/css/parser.cpp: Regenerated.
11438
11439 2003-02-28  David Hyatt  <hyatt@apple.com>
11440
11441         Fix for text-dec regression, 3185121.
11442         
11443         Reviewed by john
11444
11445         * khtml/rendering/render_line.cpp:
11446         (shouldDrawDecoration):
11447
11448 === Safari-64 ===
11449
11450 === Safari-63 ===
11451
11452 2003-02-26  David Hyatt  <hyatt@apple.com>
11453
11454         Additional cleanup.  Don't need the arg to be a reference param
11455         any more.
11456         
11457         Reviewed by mjs
11458
11459         * khtml/rendering/render_object.cpp:
11460         (RenderObject::getTextDecorationColors):
11461         * khtml/rendering/render_object.h:
11462
11463 2003-02-26  Maciej Stachowiak  <mjs@apple.com>
11464
11465         Reviewed by Dave.
11466
11467         - fixed reproducible hang at http://asp.eltonsoft.dk/cast/get.asp?cat=Quicktime
11468
11469         This was a set of mutually recursive frameset pages. This allows
11470         the number of frames to grow huge, which kills both WebCore and
11471         WebKit, so I added a hard limit of 200 total frames per page.
11472         
11473         * khtml/html/html_baseimpl.cpp:
11474         (HTMLFrameElementImpl::isURLAllowed):
11475         (HTMLFrameElementImpl::attach):
11476         (HTMLFrameElementImpl::detach):
11477         (HTMLIFrameElementImpl::attach):
11478         * khtml/html/html_baseimpl.h:
11479         * khtml/khtml_part.cpp:
11480         (KHTMLPart::init):
11481         (KHTMLPart::incrementFrameCount):
11482         (KHTMLPart::decrementFrameCount):
11483         (KHTMLPart::topLevelFrameCount):
11484         * khtml/khtml_part.h:
11485
11486 2003-02-26  David Hyatt  <hyatt@apple.com>
11487
11488         Fix numerous regressions with text-decoration in quirks mode and
11489         also fixed a bug where text-decoration:none is not being honored
11490         on links.
11491         
11492         Reviewed by mjs
11493
11494         * khtml/css/cssstyleselector.cpp:
11495         * khtml/rendering/render_object.cpp:
11496         (RenderObject::getTextDecorationColors):
11497         * khtml/rendering/render_object.h:
11498         * khtml/rendering/render_text.cpp:
11499         (TextRun::paintDecoration):
11500
11501 2003-02-26  David Hyatt  <hyatt@apple.com>
11502
11503         Fix for 3179109. containingBlock() had a big old bug in it.
11504         For ABSOLUTE positioned elements, it would return inline relative
11505         positioned parents (when it should only be returning blocks).
11506         
11507         Reviewed by john
11508
11509         * khtml/rendering/render_object.cpp:
11510         (RenderObject::containingBlock):
11511
11512 2003-02-25  David Hyatt  <hyatt@apple.com>
11513
11514         Fix for findNextLayer problems.  There was nothing wrong with
11515         findNextLayer per se... it was just getting called *way* more
11516         often than it needed to be.
11517
11518         Fixes two bugs, 3159866 and 3168815.
11519         
11520         Reviewed by darin
11521
11522         * khtml/rendering/render_container.cpp:
11523         (RenderContainer::appendChildNode):
11524         (RenderContainer::insertChildNode):
11525         * khtml/rendering/render_object.cpp:
11526         (addLayers):
11527         (RenderObject::addLayers):
11528         * khtml/rendering/render_object.h:
11529
11530 2003-02-25  Darin Adler  <darin@apple.com>
11531
11532         Reviewed by Trey.
11533         
11534         - fixed 3177139 -- REGRESSION: tiny buttons with no text on dbaron test page
11535         
11536         This is actually a shortcoming in XML support. The reason it seemed like a regression
11537         is that this page was parsed as HTML before we had the XML support.
11538         
11539         * khtml/xml/xml_tokenizer.cpp:
11540         (XMLHandler::startElement): As the HTML tokenizer/parser does, call init() on all DOM
11541         tree elements before calling attach(). The KHTML guys want to get rid of init(), but until
11542         they do, we need the same thing here as in the HTML version.
11543         (XMLHandler::startCDATA): Ditto.
11544         (XMLHandler::enterText): Ditto.
11545
11546         * khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Fix an obvious editing error that
11547         would lead to a second attach.
11548
11549 2003-02-25  David Hyatt  <hyatt@apple.com>
11550
11551         Revert one of my optimizations.  It was bogus.  You can't use
11552         the parsed value of "inherit." 
11553
11554         Fixes versiontracker.  Bug #3178204
11555         
11556         Reviewed by mjs
11557
11558         * khtml/html/html_tableimpl.cpp:
11559         (HTMLTableElementImpl::createSharedCellDecls):
11560
11561 2003-02-25  David Hyatt  <hyatt@apple.com>
11562
11563         reverseRuns was buggy and crashing.  3182658.
11564         
11565         Reviewed by mjs
11566
11567         * khtml/rendering/bidi.cpp:
11568
11569 2003-02-25  David Hyatt  <hyatt@apple.com>
11570
11571         Regression caused by my inclusion of inline flows in the bidi 
11572         iteration.  These flows are always empty and should be skipped
11573         if found at the start of a line.
11574
11575         The bug # is 3175670.
11576         
11577         * khtml/rendering/bidi.cpp:
11578
11579 2003-02-25  David Hyatt  <hyatt@apple.com>
11580
11581         Fix for bug 3166276.  <tt> uses wrong font size inside a table.
11582         Make sure logical font values like "medium" don't set the "size
11583         specified" bit on the font, so that the generic family change
11584         code will get activated.
11585         
11586         Reviewed by darin
11587
11588         * khtml/css/cssstyleselector.cpp:
11589
11590 2003-02-25  Darin Adler  <darin@apple.com>
11591
11592         Reviewed by me, changes by Dave.
11593
11594         - fixed 3181790 -- REGRESSION: TextRun objects of length 0 or with just the character '\n' leak
11595
11596         * khtml/rendering/render_text.cpp: (RenderText::position): Destroy the passed-in
11597         TextRun if it's the kind that's not needed, rather than just returning.
11598
11599         - fixed 3181794 -- REGRESSION: objects created by RenderObject::createInlineBox leak
11600                         
11601         * khtml/rendering/render_box.cpp: (RenderBox::position): Only do work for replaced
11602         elements, and for those elements, destroy the passed-in InlineBox. Dave says this
11603         is not the real solution, but it does plug the leak.
11604         
11605         * khtml/rendering/render_flow.cpp: (RenderFlow::createInlineBox): Call through
11606         to the inherited createInlineBox for all replaced elements. This code was making
11607         the wrong kind of InlineBox for replaced elements.
11608         
11609         - removed Id cvs magic string which causes big headaches in generated files
11610
11611         * khtml/css/parser.cpp: Removed Id cvs magic string.
11612         * khtml/css/parser.y: Removed Id cvs magic string.
11613
11614 2003-02-24  David Hyatt  <hyatt@apple.com>
11615
11616         The new CSS1 parser, implementation of attr(), improvement of
11617         the content property, impl of the :target selector, and new
11618         dotted/dashed line drawing code for borders.
11619         
11620         Reviewed by darin/gramps
11621
11622         * ForwardingHeaders/css/css_base.h: Added.
11623         * WebCore.pbproj/project.pbxproj:
11624         * khtml/css/Makefile.am:
11625         * khtml/css/css_base.cpp: Added.
11626         (StyleBaseImpl::checkLoaded):
11627         (StyleBaseImpl::stylesheet):
11628         (StyleBaseImpl::baseURL):
11629         (StyleBaseImpl::setParsedValue):
11630         (StyleListImpl::~StyleListImpl):
11631         (CSSSelector::print):
11632         (CSSSelector::specificity):
11633         (CSSSelector::extractPseudoType):
11634         (CSSSelector::operator == ):
11635         (CSSSelector::selectorText):
11636         * khtml/css/css_base.h: Added.
11637         * khtml/css/css_ruleimpl.cpp:
11638         (CSSRuleImpl::parentRule):
11639         (CSSImportRuleImpl::CSSImportRuleImpl):
11640         (CSSImportRuleImpl::~CSSImportRuleImpl):
11641         (CSSImportRuleImpl::setStyleSheet):
11642         (CSSImportRuleImpl::init):
11643         (CSSMediaRuleImpl::CSSMediaRuleImpl):
11644         (CSSMediaRuleImpl::append):
11645         (CSSMediaRuleImpl::insertRule):
11646         (CSSStyleRuleImpl::setDeclaration):
11647         (CSSStyleRuleImpl::setNonCSSHints):
11648         * khtml/css/css_ruleimpl.h:
11649         * khtml/css/css_stylesheetimpl.cpp:
11650         (CSSStyleSheetImpl::CSSStyleSheetImpl):
11651         (CSSStyleSheetImpl::insertRule):
11652         (CSSStyleSheetImpl::cssRules):
11653         (CSSStyleSheetImpl::parseString):
11654         (MediaListImpl::deleteMedium):
11655         * khtml/css/css_stylesheetimpl.h:
11656         * khtml/css/css_valueimpl.cpp:
11657         (CSSStyleDeclarationImpl::getPropertyValue):
11658         (CSSStyleDeclarationImpl::get4Values):
11659         (CSSStyleDeclarationImpl::getShortHandValue):
11660         (CSSStyleDeclarationImpl::getPropertyCSSValue):
11661         (CSSStyleDeclarationImpl::removeProperty):
11662         (CSSStyleDeclarationImpl::getPropertyPriority):
11663         (CSSStyleDeclarationImpl::setProperty):
11664         (CSSStyleDeclarationImpl::setLengthProperty):
11665         (CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
11666         (CSSPrimitiveValueImpl::cleanup):
11667         (CSSPrimitiveValueImpl::computeLength):
11668         (CSSPrimitiveValueImpl::computeLengthFloat):
11669         (CSSPrimitiveValueImpl::setFloatValue):
11670         (CSSPrimitiveValueImpl::cssText):
11671         (FontFamilyValueImpl::FontFamilyValueImpl):
11672         (FontValueImpl::FontValueImpl):
11673         (FontValueImpl::~FontValueImpl):
11674         * khtml/css/css_valueimpl.h:
11675         * khtml/css/cssparser.cpp:
11676         (qFatal):
11677         (ValueList::ValueList):
11678         (ValueList::~ValueList):
11679         (ValueList::addValue):
11680         (CSSParser::CSSParser):
11681         (CSSParser::~CSSParser):
11682         (CSSParser::parseSheet):
11683         (CSSParser::parseRule):
11684         (CSSParser::parseValue):
11685         (CSSParser::parseDeclaration):
11686         (CSSParser::addProperty):
11687         (CSSParser::createStyleDeclaration):
11688         (CSSParser::clearProperties):
11689         (CSSParser::document):
11690         (validUnit):
11691         (CSSParser::parseShortHand):
11692         (CSSParser::parse4Values):
11693         (CSSParser::parseContent):
11694         (CSSParser::parseShape):
11695         (CSSParser::parseFont):
11696         (CSSParser::parseFontFamily):
11697         (parseColor):
11698         (CSSParser::parseColor):
11699         (yyerror):
11700         (DOM::CSSParser::lex):
11701         (toHex):
11702         (DOM::CSSParser::text):
11703         * khtml/css/cssparser.h:
11704         * khtml/css/cssproperties.c:
11705         (findProp):
11706         * khtml/css/cssproperties.h:
11707         * khtml/css/cssproperties.in:
11708         * khtml/css/cssstyleselector.cpp:
11709         * khtml/css/cssstyleselector.h:
11710         * khtml/css/cssvalues.c:
11711         (hash_val):
11712         (findValue):
11713         * khtml/css/cssvalues.h:
11714         * khtml/css/cssvalues.in:
11715         * khtml/css/html4.css:
11716         * khtml/css/parser.cpp: Added.
11717         (DOM::getPropertyID):
11718         (getValueID):
11719         (cssyyerror):
11720         (cssyylex):
11721         (__yy_memcpy):
11722         * khtml/css/parser.h: Added.
11723         * khtml/css/parser.y: Added.
11724         * khtml/css/quirks.css: Added.
11725         * khtml/css/tokenizer.cpp: Added.
11726         * khtml/css/tokenizer.flex: Added.
11727         * khtml/dom/css_value.h:
11728         * khtml/dom/html_element.cpp:
11729         * khtml/ecma/kjs_css.cpp:
11730         * khtml/html/html_baseimpl.cpp:
11731         (HTMLBodyElementImpl::parseAttribute):
11732         * khtml/html/html_blockimpl.cpp:
11733         (HTMLDivElementImpl::parseAttribute):
11734         (HTMLHRElementImpl::attach):
11735         (HTMLParagraphElementImpl::parseAttribute):
11736         * khtml/html/html_elementimpl.cpp:
11737         (isHexDigit):
11738         (toHex):
11739         (HTMLElementImpl::addHTMLColor):
11740         * khtml/html/html_elementimpl.h:
11741         * khtml/html/html_inlineimpl.cpp:
11742         (HTMLFontElementImpl::parseAttribute):
11743         * khtml/html/html_tableimpl.cpp:
11744         (HTMLTableElementImpl::parseAttribute):
11745         (HTMLTableElementImpl::attach):
11746         (HTMLTablePartElementImpl::parseAttribute):
11747         (HTMLTableCellElementImpl::parseAttribute):
11748         * khtml/khtml_part.cpp:
11749         (KHTMLPart::gotoAnchor):
11750         * khtml/misc/helper.h:
11751         * khtml/rendering/render_body.cpp:
11752         (RenderBody::setStyle):
11753         * khtml/rendering/render_list.cpp:
11754         (RenderListMarker::lineHeight):
11755         (RenderListMarker::baselinePosition):
11756         * khtml/rendering/render_style.cpp:
11757         (RenderStyle::setContent):
11758         * khtml/rendering/render_style.h:
11759         * khtml/xml/dom_docimpl.cpp:
11760         (DocumentImpl::DocumentImpl):
11761         (DocumentImpl::setFocusNode):
11762         (DocumentImpl::setCSSTarget):
11763         (DocumentImpl::getCSSTarget):
11764         * khtml/xml/dom_docimpl.h:
11765         * kwq/KWQChar.mm:
11766         (QChar::upper):
11767         * kwq/KWQColor.h:
11768         * kwq/KWQKStandardDirs.mm:
11769         (locate):
11770         * kwq/KWQPainter.mm:
11771         (QPainter::drawLine):
11772         * kwq/KWQString.h:
11773
11774 2003-02-24  Maciej Stachowiak  <mjs@apple.com>
11775
11776         Reviewed by John.
11777
11778         - fixed 3167642 - crash in renderArena.
11779         
11780         * khtml/html/html_documentimpl.h:
11781         * khtml/html/html_documentimpl.cpp:
11782         (HTMLDocumentImpl::HTMLDocumentImpl): Added new processingLoadEvent bool.
11783         (HTMLDocumentImpl::close): Guard against re-entering the load event handler.
11784
11785 2003-02-24  Darin Adler  <darin@apple.com>
11786
11787         Reviewed by Ken.
11788
11789         - fixed 3179059 -- CSS1: capitalized letters should remain capitalized when
11790         text-transform: capitalize is applied
11791
11792         * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::capitalize): Capitalize the first
11793         letters of words, but don't make any letters lowercase.
11794
11795 2003-02-23  Darin Adler  <darin@apple.com>
11796
11797         Reviewed by Maciej.
11798
11799         - fixed 3179181 -- KURL won't accept URLs with a query part and no / separating host name from path
11800
11801         * kwq/KWQKURL.mm: (KURL::parse): Allow any path segment end character to end the host part of a
11802         URL, rather than allowing only a "/".
11803
11804 2003-02-21  Maciej Stachowiak  <mjs@apple.com>
11805
11806         Back out last change, mondo layout regressions.
11807
11808         * khtml/html/html_documentimpl.cpp:
11809         (HTMLDocumentImpl::close):
11810
11811 2003-02-21  Maciej Stachowiak  <mjs@apple.com>
11812
11813         Reviewed by Dave.
11814
11815         - fixed 3167642 - crash in renderArena.
11816
11817         * khtml/html/html_documentimpl.cpp:
11818         (HTMLDocumentImpl::close): Clear the tokenizer early to avoid
11819         re-entering the onload handler - this was causing a massive
11820         overload of frames which finally caused a crash.
11821
11822 2003-02-21  Darin Adler  <darin@apple.com>
11823
11824         Reviewed by Dave.
11825
11826         - fixed a problem that was causing layout tests to give inconsistent results
11827
11828         * kwq/KWQPixmap.mm:
11829         (QPixmap::size): Handle case of nil image so we don't use the uninitialized
11830         result of dispatching a method to a structure-returning function.
11831         (QPixmap::rect): Ditto.
11832         (QPixmap::width): Ditto.
11833         (QPixmap::height): Ditto.
11834
11835 2003-02-21  Darin Adler  <darin@apple.com>
11836
11837         Reviewed by Maciej.
11838
11839         - Made it possible to run the layout tests in a Deployment version
11840
11841         * kwq/KWQRenderTreeDebug.cpp: (externalRepresentation): Remove #ifndef NDEBUG.
11842         * kwq/KWQRenderTreeDebug.h: Remove #ifndef NDEBUG.
11843         * kwq/WebCoreBridge.mm: (-[WebCoreBridge renderTreeAsExternalRepresentation]):
11844         Remove #ifndef NDEBUG.
11845
11846 2003-02-21  Darin Adler  <darin@apple.com>
11847
11848         * kwq/KWQRenderTreeDebug.cpp: (write): Add missing spaces in render
11849         tree dump format.
11850
11851 2003-02-20  Maciej Stachowiak  <mjs@apple.com>
11852
11853         Revert Dave's patch to these files, since it turned out to cause
11854         layout regressions.
11855
11856         * khtml/rendering/render_layer.cpp:
11857         (RenderLayer::updateLayerPosition):
11858         * khtml/rendering/render_object.cpp:
11859         (RenderObject::setLayouted):
11860         (RenderObject::container):
11861
11862 2003-02-20  Maciej Stachowiak  <mjs@apple.com>
11863
11864         Reviewed by Darin Adler.
11865
11866         - fixed 3173276 - hang in kjs string at iteslj.org page
11867
11868         * khtml/html/htmltokenizer.cpp:
11869         (HTMLTokenizer::addPending): Leave whitespace unmolested inside
11870         <script>, so that literal tabs in strings come through as tabs,
11871         not spaces.
11872
11873 2003-02-20  Darin Adler  <darin@apple.com>
11874
11875         Reviewed by Trey.
11876
11877         - fixed 3177310 -- REGRESSION: "serif" mapped to "fixed"
11878         
11879         Fixed a typo where the serif method was returning the fixed font name.
11880         Also made this class use inlining for almost everything -- yields a miniscule
11881         improvement in code size and speed, and increases brevity.
11882
11883         * kwq/KWQKHTMLSettings.h: Moved almost everything here.
11884         * kwq/KWQKHTMLSettings.mm: Moved almost everything out of here.
11885
11886 2003-02-19  David Hyatt  <hyatt@apple.com>
11887
11888         Update layers to not fix their positions during setLayouted.
11889         Inline container() within render_object.cpp so setLayouted can
11890         use it inline.
11891         
11892         Reviewed by mjs
11893
11894         * khtml/rendering/render_layer.cpp:
11895         (RenderLayer::updateLayerPosition):
11896         * khtml/rendering/render_object.cpp:
11897         (RenderObject::setLayouted):
11898         (RenderObject::container):
11899
11900 2003-02-19  David Hyatt  <hyatt@apple.com>
11901
11902         Just chain BidiRuns using an internal next ptr and dump the
11903         use of QPtrList (which has to malloc internal nodes to wrap
11904         each run).
11905         
11906         Reviewed by darin (reverseRuns reviewed by mjs)
11907         
11908         * khtml/rendering/bidi.cpp:
11909         * khtml/rendering/bidi.h:
11910         * khtml/rendering/render_block.h:
11911
11912 2003-02-19  David Hyatt  <hyatt@apple.com>
11913
11914         Make the BidiIterator midpoints use an array instead of a list.
11915         
11916         Reviewed by kocienda
11917
11918         * khtml/rendering/bidi.h
11919         * khtml/rendering/bidi.cpp:
11920         * khtml/rendering/render_block.h:
11921
11922 2003-02-18  Maciej Stachowiak  <mjs@apple.com
11923
11924         Reviewed by Chris.
11925         
11926         Merged changes from Safari-58-1-branch.
11927         
11928     2003-02-11  Maciej Stachowiak  <mjs@apple.com>
11929
11930         Reviewed by Trey.
11931
11932         * WebCore.pbproj/project.pbxproj: Include /System/Library/PrivateFrameworks.
11933
11934 2003-02-18  Trey Matteson  <trey@apple.com>
11935
11936         3171982 - REGRESSION: onClick handlers run twice when button pressed (DSLReports.com forums)
11937
11938         My earlier changes added the codepath by which we let khtmlview fully process
11939         a mouse up after a widget has done it's tracking, which leads to the second
11940         onClick call.  Presumably that path does not exist in the native KDE case.
11941         The change below reduces the impact of my hack, whereby instead of fully posting
11942         a fake mouseup, we just note that the mouse has done up at the end of mousedown
11943         handling, and clear the mousePressed state (state I also added).
11944
11945         Reviewed by Darin.
11946
11947         * khtml/khtmlview.cpp:
11948         (KHTMLView::viewportMousePressEvent):  Look for a current mouseUp at the end of
11949         dispatching the mouse down.
11950         * kwq/KWQKHTMLPart.h:
11951         * kwq/KWQKHTMLPart.mm:
11952         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
11953         Don't post a phony mouse up from here.
11954         (KWQKHTMLPart::lastEventIsMouseUp):
11955         Utility routine to test for mouseUp.
11956
11957 === Safari-62 ===
11958
11959 2003-02-18  David Hyatt  <hyatt@apple.com>
11960
11961         Fix for 3176102, bad table cell regression.  I was adding in
11962         random properties for cells. Eep.
11963
11964         Also patched table element to add in the inherit property using
11965         CSS_VAL_INHERIT instead of the string "inherit" (faster).
11966         
11967         Reviewed by gramps
11968
11969         * khtml/css/cssstyleselector.cpp:
11970         * khtml/html/html_tableimpl.cpp
11971         
11972 2003-02-18  David Hyatt  <hyatt@apple.com>
11973
11974         Fix for 3171795, dotted borders drawn incorrectly.  Picked this
11975         gem up from the KHTML trunk.
11976         
11977         Reviewed by darin
11978
11979         * khtml/rendering/render_object.cpp:
11980         (RenderObject::drawBorder):
11981
11982 2003-02-17  Darin Adler  <darin@apple.com>
11983
11984         Reviewed by Dave.
11985
11986         - fixed 3174332 -- REGRESSION: bad initial layout due to empty QFontMetrics
11987
11988         * khtml/rendering/render_html.cpp: (RenderHtml::setStyle):
11989         Don't set the style's to display:BLOCK if it's display:NONE. This prevents
11990         us from modifying the special FOUC style among other things.
11991
11992         - unrelated code cleanup
11993
11994         * khtml/html/html_baseimpl.cpp: Moved code around that was grouped badly.
11995
11996 2003-02-17  David Hyatt  <hyatt@apple.com>
11997
11998         Missed another "Almost Strict" spot.
11999         
12000         Reviewed by kocienda
12001
12002         * khtml/xml/dom_docimpl.cpp:
12003         (DocumentImpl::recalcStyle):
12004
12005 2003-02-17  David Hyatt  <hyatt@apple.com>
12006
12007         Fix for 3% improvement on cached cvs-base.  Make cells share the
12008         declarations set up by the table (add these decls to the table
12009         once instead of to every cell).
12010         
12011         Reviewed by darin
12012
12013         * khtml/css/cssstyleselector.cpp:
12014         * khtml/css/cssstyleselector.h:
12015         * khtml/html/html_tableimpl.cpp:
12016         (HTMLTableElementImpl::HTMLTableElementImpl):
12017         (HTMLTableElementImpl::~HTMLTableElementImpl):
12018         (HTMLTableElementImpl::createSharedCellDecls):
12019         (HTMLTableCellElementImpl::getAdditionalStyleDecls):
12020         (HTMLTableCellElementImpl::attach):
12021         * khtml/html/html_tableimpl.h:
12022         * khtml/xml/dom_elementimpl.h:
12023
12024 2003-02-17  Trey Matteson  <trey@apple.com>
12025
12026         2938062 Mouse cursor does not change to link cursor over non-button form submission controls
12027         
12028         Reviewed by Darin
12029
12030         * khtml/khtmlview.cpp:
12031         (isSubmitImage):  Helper function to ID submit buttons with images.
12032         (KHTMLView::viewportMouseMoveEvent):  Set cursor for submit buttons with images.
12033         * kwq/WebCoreBridge.mm:
12034         (inputElementFromDOMElement):  Simplify previously written casting goop.
12035
12036 2003-02-16  David Hyatt  <hyatt@apple.com>
12037
12038         Fix "Almost Strict" mode to not match @konq-quirks.
12039         
12040         Reviewed by kocienda
12041
12042         * ChangeLog:
12043         * khtml/xml/dom_docimpl.cpp:
12044         (DocumentImpl::DocumentImpl):
12045         (DocumentImpl::recalcStyleSelector):
12046
12047 2003-02-16  David Hyatt  <hyatt@apple.com>
12048
12049         Fix to make table cells within the same table use a shared style 
12050         decl object (owned by the table).  This stops every cell in a table
12051         from having the exact same values copied on the cell itself.
12052         
12053         * khtml/css/cssstyleselector.cpp:
12054         * khtml/css/cssstyleselector.h:
12055         * khtml/html/html_tableimpl.cpp:
12056         (HTMLTableElementImpl::HTMLTableElementImpl):
12057         (HTMLTableElementImpl::~HTMLTableElementImpl):
12058         (HTMLTableElementImpl::createSharedCellDecls):
12059         (HTMLTableCellElementImpl::getAdditionalStyleDecls):
12060         (HTMLTableCellElementImpl::attach):
12061         * khtml/html/html_tableimpl.h:
12062         * khtml/xml/dom_elementimpl.h:
12063
12064 2003-02-14  David Hyatt  <hyatt@apple.com>
12065
12066         Make the inline box model live.  Borders/backgrounds and text
12067         decorations have been rewritten.
12068
12069         Also fixed a bug with clip rects.  They didn't include borders.
12070
12071         Reviewed by kocienda
12072
12073         * khtml/css/cssstyleselector.cpp:
12074         * khtml/ecma/kjs_window.cpp:
12075         (WindowFunc::tryCall):
12076         * khtml/rendering/bidi.cpp:
12077         * khtml/rendering/font.cpp:
12078         * khtml/rendering/font.h:
12079         * khtml/rendering/render_block.cpp:
12080         * khtml/rendering/render_block.h:
12081         * khtml/rendering/render_box.cpp:
12082         (RenderBox::paintBackground):
12083         (RenderBox::paintBackgroundExtended):
12084         (RenderBox::getClipRect):
12085         (RenderBox::position):
12086         * khtml/rendering/render_box.h:
12087         * khtml/rendering/render_flow.cpp:
12088         (RenderFlow::createInlineBox):
12089         (RenderFlow::paintLineBoxBackgroundBorder):
12090         (RenderFlow::paintLineBoxDecorations):
12091         (RenderFlow::repaint):
12092         * khtml/rendering/render_flow.h:
12093         * khtml/rendering/render_inline.cpp:
12094         (RenderInline::paintObject):
12095         (RenderInline::width):
12096         (RenderInline::height):
12097         (RenderInline::offsetLeft):
12098         (RenderInline::offsetTop):
12099         (RenderInline::nodeAtPoint):
12100         * khtml/rendering/render_inline.h:
12101         * khtml/rendering/render_line.cpp:
12102         (InlineFlowBox::verticallyAlignBoxes):
12103         (InlineFlowBox::computeLogicalBoxHeights):
12104         (InlineFlowBox::placeBoxesVertically):
12105         (InlineFlowBox::shrinkBoxesWithNoTextChildren):
12106         (InlineFlowBox::paintBackgroundAndBorder):
12107         (shouldDrawDecoration):
12108         (InlineFlowBox::paintDecorations):
12109         * khtml/rendering/render_line.h:
12110         * khtml/rendering/render_object.cpp:
12111         (RenderObject::setStyle):
12112         (RenderObject::lineHeight):
12113         (RenderObject::getTextDecorationColors):
12114         * khtml/rendering/render_object.h:
12115         * khtml/rendering/render_root.cpp:
12116         (enclosingPositionedRect):
12117         * khtml/rendering/render_style.cpp:
12118         (StyleVisualData::StyleVisualData):
12119         (StyleInheritedData::StyleInheritedData):
12120         (StyleInheritedData::operator==):
12121         (RenderStyle::diff):
12122         * khtml/rendering/render_style.h:
12123         * khtml/rendering/render_table.cpp:
12124         (RenderTableCell::repaintRectangle):
12125         * khtml/rendering/render_text.cpp:
12126         (TextRun::paintDecoration):
12127         (TextRun::checkSelectionPoint):
12128         (RenderText::nodeAtPoint):
12129         (RenderText::cursorPos):
12130         (RenderText::absolutePosition):
12131         (RenderText::paintObject):
12132         (RenderText::paint):
12133         (RenderText::position):
12134         * khtml/rendering/render_text.h:
12135         * kwq/KWQPainter.h:
12136         * kwq/KWQPainter.mm:
12137         (QPainter::drawLineForText):
12138         * kwq/WebCoreTextRenderer.h:
12139
12140 2003-02-13  Trey Matteson  <trey@apple.com>
12141
12142         First checkin for working forms autocomplete.
12143
12144         This level has some new support routines.
12145
12146         Reviewed by Chris
12147
12148         * khtml/html/html_formimpl.cpp:
12149         (HTMLFormElementImpl::isLoginForm):  New, returns if a form is for login.
12150         * khtml/html/html_formimpl.h:
12151         * kwq/KWQDOMNode.cpp:
12152         (idFromNode):  New, helper routine to allow us to use the id() function from ObjC.
12153         * kwq/KWQDOMNode.h:
12154         * kwq/KWQTextArea.h:  Adopt KWQWidgetHolder protocol.
12155         * kwq/KWQTextArea.mm:
12156         (-[KWQTextArea widget]):    Adopt KWQWidgetHolder protocol.
12157         (-[KWQTextAreaTextView widget]):    Adopt KWQWidgetHolder protocol.
12158         * kwq/KWQTextField.h:    Adopt KWQWidgetHolder protocol.
12159         * kwq/KWQTextField.mm:
12160         (-[KWQTextField widget]):    Adopt KWQWidgetHolder protocol.
12161         (-[KWQSecureTextField widget]):    Adopt KWQWidgetHolder protocol.
12162         * kwq/KWQView.h:  Define KWQWidgetHolder protocol
12163         * kwq/KWQView.mm:  
12164         (-[KWQView widget]): Adopt KWQWidgetHolder protocol.
12165         * kwq/WebCoreBridge.h:
12166         * kwq/WebCoreBridge.mm:
12167         (-[WebCoreBridge elementForView:]):   New method.
12168         (inputElementFromDOMElement):  Common code for next two methods.
12169         (-[WebCoreBridge elementIsInLoginForm:]):   New method.
12170         (-[WebCoreBridge elementDoesAutoComplete:]):   New method.
12171
12172 2003-02-13  Darin Adler  <darin@apple.com>
12173
12174         Reviewed by Trey.
12175
12176         - fixed 3162806 -- REGRESSION: handle == h assertion when clicking headphone link at cnn.com
12177
12178         * khtml/ecma/kjs_window.cpp: (HistoryFunc::tryCall): Instead of trying to actually do the
12179         history navigation here, call the new KHTMLPart::scheduleHistoryNavigation.
12180
12181         * khtml/khtml_part.cpp:
12182         (KHTMLPart::init): Add a few more #if !APPLE_CHANGES so we can leave out more unused fields.
12183         (KHTMLPart::openURL): Ditto.
12184         (KHTMLPart::createJavaContext): Ditto.
12185         (KHTMLPart::clear): Also initialize m_scheduledRedirection to noRedirectionScheduled.
12186         (KHTMLPart::checkCompleted): Use m_scheduledRedirection rather than m_redirectURL to check
12187         whether a redirection is already in progress.
12188         (KHTMLPart::scheduleRedirection): Use m_scheduledRedirection rather than m_redirectURL to check
12189         whether a redirection is already in progress, and set m_scheduledRedirection to redirectionScheduled.
12190         (KHTMLPart::scheduleHistoryNavigation): Added. Does the same thing as scheduleRedirection,
12191         but always uses a delay of 0, sets m_scheduledRedirection to historyNavigationScheduled, and
12192         sets m_scheduledHistoryNavigationSteps.
12193         (KHTMLPart::slotRedirect): Add an if statement that does the history navigation. The code is
12194         moved here from HistoryFunc::tryCall. Also set m_scheduledRedirection to noRedirectionScheduled.
12195         (KHTMLPart::urlSelected): Add a few more #if !APPLE_CHANGES so we can leave out more unused fields.
12196         (KHTMLPart::requestObject): Ditto.
12197         (KHTMLPart::submitForm): Ditto.
12198         (KHTMLPart::slotParentCompleted): Use m_scheduledRedirection rather than m_redirectURL to check
12199         whether a redirection is already in progress.
12200         (KHTMLPart::setZoomFactor): Add a few more #if !APPLE_CHANGES so we can leave out more unused fields.
12201
12202         * khtml/khtml_part.h: Added scheduleHistoryNavigation.
12203         * khtml/khtmlpart_p.h: Added RedirectionScheduled enum. Added more #if !APPLE_CHANGES to leave out
12204         a bunch more fields we don't use. Added m_scheduledRedirection and m_scheduledHistoryNavigationSteps.
12205         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::redirectionTimerStartedOrStopped): Check and don't do anything
12206         if the timer was being used for history redirection.
12207
12208         * khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::close):
12209         Check m_scheduledRedirection instead of m_redirectURL to figure out if there is a redirection
12210         in progress. Not strictly necessary since we really don't care about the history case here,
12211         but consistent with the rest.
12212
12213 2003-02-13  Chris Blumenberg  <cblu@apple.com>
12214
12215         Fixed WebKit typos found by Peter Wilson.
12216
12217         Reviewed by darin.
12218
12219         * kwq/KWQKHTMLPart.mm:
12220         (KWQKHTMLPart::bridgeForFrameName): call findOrCreateFrameNamed
12221         * kwq/WebCoreBridge.h: fixed method name for findOrCreateFrameNamed
12222
12223 2003-02-12  Darin Adler  <darin@apple.com>
12224
12225         Reviewed by Ken.
12226
12227         - fixed 3158484 -- after submission failure, submitting a second time doesn't work
12228
12229         * kwq/KWQKHTMLPart.h: Added didNotOpenURL method. Changed _formSubmittedFlag bool
12230         into _submittedFormURL string.
12231         * kwq/KWQKHTMLPart.mm:
12232         (KWQKHTMLPart::KWQKHTMLPart): No need to initialize string.
12233         (KWQKHTMLPart::didNotOpenURL): If the form we submitted failed, then forget about it.
12234         (KWQKHTMLPart::submitForm): Only do the protection against multiple submissions if
12235         the URL is the same.
12236         (KWQKHTMLPart::setView): Nuke the submitted URL here where we used to nuke the flag.
12237
12238         * kwq/WebCoreBridge.h: Added didNotOpenURL: method to be called by WebKit.
12239         * kwq/WebCoreBridge.mm: (-[WebCoreBridge didNotOpenURL:]): Forward the call to the part.
12240
12241 2003-02-12  Darin Adler  <darin@apple.com>
12242
12243         Reviewed by Trey.
12244
12245         - fixed 3162786 -- hang with large amounts of text in textarea
12246
12247         * kwq/KWQTextArea.mm: (-[KWQTextArea getCursorPositionAsIndex:inParagraph:]):
12248         Rewrite to not use RangeOfParagraph to avoid n^2 algorithm. Also made small
12249         changes to similar functions so they look similar, and got rid of an int/unsigned
12250         mismatch in a case where the value is guaranteed to be positive.
12251
12252 2003-02-11  Darin Adler  <darin@apple.com>
12253
12254         Reviewed by Dave.
12255
12256         - fixed 3170403 -- nil-dereference in addEventListener
12257
12258         * khtml/ecma/kjs_dom.cpp: (DOMNodeProtoFunc::tryCall): Check getJSEventListener result for nil.
12259         * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Check getJSEventListener result for nil.
12260
12261 2003-02-11  Trey Matteson  <trey@apple.com>
12262
12263         Set -seg1addr in our build styles, but not for the B&I build.
12264         This makes our SYMROOTS from B&I usable to determine symbols from crash
12265         logs from the field.
12266         Also nuked DeploymentFat build style.
12267
12268         Reviewed by Ken.
12269
12270         * WebCore.pbproj/project.pbxproj:
12271
12272 2003-02-10  David Hyatt  <hyatt@apple.com>
12273
12274         Inline box model landing, stage 1.  Doesn't really change
12275         much of anything visually yet.  Just builds a bunch of boxes
12276         and positions them, but those boxes aren't used yet.
12277
12278         Also fixing repaint() to understand not to dirty outside
12279         overflow:hidden clipped ancestors.
12280
12281         Fixed two table bugs in table painting as well.
12282         
12283         Reviewed by kocienda
12284
12285         * WebCore.pbproj/project.pbxproj:
12286         * khtml/rendering/bidi.cpp:
12287         * khtml/rendering/bidi.h:
12288         * khtml/rendering/render_block.cpp:
12289         * khtml/rendering/render_block.h:
12290         * khtml/rendering/render_box.cpp:
12291         (RenderBox::position):
12292         (RenderBox::repaintRectangle):
12293         * khtml/rendering/render_box.h:
12294         * khtml/rendering/render_flow.cpp:
12295         (RenderFlow::addChild):
12296         (RenderFlow::deleteLineBoxes):
12297         (RenderFlow::detach):
12298         (RenderFlow::createInlineBox):
12299         * khtml/rendering/render_flow.h:
12300         * khtml/rendering/render_image.cpp:
12301         (RenderImage::paintObject):
12302         * khtml/rendering/render_inline.cpp:
12303         * khtml/rendering/render_inline.h:
12304         * khtml/rendering/render_line.cpp: Added.
12305         (InlineBox::detach):
12306         (throw):
12307         (InlineBox::operator delete):
12308         (InlineFlowBox::marginLeft):
12309         (InlineFlowBox::marginRight):
12310         (InlineFlowBox::marginBorderPaddingLeft):
12311         (InlineFlowBox::marginBorderPaddingRight):
12312         (InlineFlowBox::getFlowSpacingWidth):
12313         (InlineFlowBox::nextOnLineExists):
12314         (InlineFlowBox::prevOnLineExists):
12315         (InlineFlowBox::onEndChain):
12316         (InlineFlowBox::determineSpacingForFlowBoxes):
12317         (InlineFlowBox::placeBoxesHorizontally):
12318         (InlineFlowBox::verticallyAlignBoxes):
12319         (InlineFlowBox::adjustMaxAscentAndDescent):
12320         (InlineFlowBox::computeLogicalBoxHeights):
12321         (InlineFlowBox::placeBoxesVertically):
12322         * khtml/rendering/render_line.h: Added.
12323         * khtml/rendering/render_object.cpp:
12324         (RenderObject::createInlineBox):
12325         * khtml/rendering/render_object.h:
12326         * khtml/rendering/render_replaced.cpp:
12327         * khtml/rendering/render_replaced.h:
12328         * khtml/rendering/render_table.cpp:
12329         (RenderTableSection::paint):
12330         (RenderTableCell::repaintRectangle):
12331         (RenderTableCell::paint):
12332         * khtml/rendering/render_table.h:
12333         * khtml/rendering/render_text.cpp:
12334         (RenderText::nodeAtPoint):
12335         (RenderText::paintObject):
12336         (RenderText::height):
12337         (RenderText::createInlineBox):
12338         (RenderText::position):
12339         (RenderText::width):
12340         (RenderText::metrics):
12341         * khtml/rendering/render_text.h:
12342         * khtml/xml/dom_docimpl.h:
12343
12344 2003-02-10  Darin Adler  <darin@apple.com>
12345
12346         Reviewed by Richard.
12347
12348         - fixed 3124596 -- failures handling URLs with non-ASCII characters in them
12349
12350         * khtml/xml/dom_docimpl.h: Add an m_decoder field.
12351         * khtml/xml/dom_docimpl.cpp:
12352         (DocumentImpl::DocumentImpl): Initialize m_decoder to 0.
12353         (DocumentImpl::completeURL): Pass the QTextCodec from m_decoder to KURL if present.
12354
12355         * khtml/khtml_part.cpp:
12356         (KHTMLPart::begin): Set the decoder on the document when we make the document if we have a decoder.
12357         (KHTMLPart::write): Set the decoder on the document when we make the decoder if we have a document.
12358         (KHTMLPart::completeURL): Remove APPLE_CHANGES; we handle the encoding in the document.
12359
12360         * kwq/KWQKURL.h: Removed "encoding hint" parameters. Add a QTextCodec parameter to the
12361         relative URL constructor, which is the one used when we deal with links on a page.
12362         * kwq/KWQKURL.mm: (KURL::KURL): Decode the relative string based on the QTextCodec parameter.
12363
12364         * kwq/KWQString.h: Added isAllASCII, good for detecting when it's safe to use latin1()
12365         or ascii() without worrying about character sets.
12366         * kwq/KWQString.mm: (QString::isAllASCII): Added.
12367
12368         * WebCore-tests.exp: Updated for changes in KURL API.
12369         * WebCore-combined.exp: Regenerated.
12370
12371         - other changes
12372
12373         * khtml/rendering/render_table.cpp: (RenderTableCell::setWidth): Add an assertion that will help
12374         us notice future overflow issues.
12375
12376         * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Rolled out the APPLE_CHANGES here that
12377         were intended to cope with the lack of window.history, which we now have. While KHTML's rule may
12378         not be the correct rule, this will now work as well in Safari as in Konqueror.
12379
12380 2003-02-07  Darin Adler  <darin@apple.com>
12381
12382         Reviewed by Maciej.
12383
12384         - fixed 3145899 -- tf1.fr page marked UTF-8 is being decoded as Latin-1 (due to <noscript> before <meta>)
12385
12386         * khtml/misc/decoder.cpp: (Decoder::decode): Add NOSCRIPT to the list of tags
12387         that are allowed before META tags that specify character sets.
12388
12389         - fixed 3144214 -- treat Big5 as Windows CP 950 the same way TEC does
12390
12391         * kwq/mac-encodings.txt: Move Big5 names to kCFStringEncodingDOSChineseTrad
12392         instead of kCFStringEncodingBig5.
12393         * kwq/KWQCharsetData.c: Regenerated.
12394
12395 2003-02-07  Richard Williamson   <rjw@apple.com>
12396
12397         Changes to support per WebController preferences.
12398         KHTMLPart now always accesses preferences from it's m_setting.
12399         Changes made to WebPreferences pass to WebCoreSetting to KTMLSettings.
12400         Added JavaScriptCanOpenWindowsAutomatically to KHTMLSettings.
12401         
12402         Reviewed by Maciej and Ken.
12403
12404         * khtml/ecma/kjs_window.cpp:
12405         (WindowFunc::tryCall):
12406         * khtml/khtml_part.cpp:
12407         (KHTMLPart::init):
12408         (KHTMLPart::restoreURL):
12409         (KHTMLPart::openURL):
12410         (KHTMLPart::begin):
12411         (KHTMLPart::reparseConfiguration):
12412         * khtml/khtmlpart_p.h:
12413         * kwq/KWQKConfigBase.h:
12414         * kwq/KWQKConfigBase.mm:
12415         (KConfig::readUnsignedNumEntry):
12416         * kwq/KWQKHTMLPart.h:
12417         * kwq/KWQKHTMLPart.mm:
12418         (KWQKHTMLPart::setSettings):
12419         * kwq/KWQKHTMLSettings.h:
12420         * kwq/KWQKHTMLSettings.mm:
12421         (KHTMLSettings::stdFontName):
12422         (KHTMLSettings::fixedFontName):
12423         (KHTMLSettings::serifFontName):
12424         (KHTMLSettings::sansSerifFontName):
12425         (KHTMLSettings::cursiveFontName):
12426         (KHTMLSettings::fantasyFontName):
12427         (KHTMLSettings::minFontSize):
12428         (KHTMLSettings::mediumFontSize):
12429         (KHTMLSettings::mediumFixedFontSize):
12430         (KHTMLSettings::isJavaEnabled):
12431         (KHTMLSettings::autoLoadImages):
12432         (KHTMLSettings::isPluginsEnabled):
12433         (KHTMLSettings::isJavaScriptEnabled):
12434         (KHTMLSettings::JavaScriptCanOpenWindowsAutomatically):
12435         (KHTMLSettings::userStyleSheet):
12436         (KHTMLSettings::setStdFontName):
12437         (KHTMLSettings::setFixedFontName):
12438         (KHTMLSettings::setSerifFontName):
12439         (KHTMLSettings::setSansSerifFontName):
12440         (KHTMLSettings::setCursiveFontName):
12441         (KHTMLSettings::setFantasyFontName):
12442         (KHTMLSettings::setMinFontSize):
12443         (KHTMLSettings::setMediumFontSize):
12444         (KHTMLSettings::setMediumFixedFontSize):
12445         (KHTMLSettings::setAutoLoadImages):
12446         (KHTMLSettings::setIsJavaScriptEnabled):
12447         (KHTMLSettings::setIsJavaEnabled):
12448         (KHTMLSettings::setArePluginsEnabled):
12449         (KHTMLSettings::setJavaScriptCanOpenWindowsAutomatically):
12450         (KHTMLSettings::setUserStyleSheet):
12451         * kwq/WebCoreBridge.h:
12452         * kwq/WebCoreBridge.mm:
12453         (-[WebCoreBridge init]):
12454         (-[WebCoreBridge initializeSettings:]):
12455         * kwq/WebCoreSettings.h:
12456         * kwq/WebCoreSettings.mm:
12457         (-[WebCoreSettings dealloc]):
12458         (-[WebCoreSettings init]):
12459         (-[WebCoreSettings setStandardFontFamily:]):
12460         (-[WebCoreSettings setFixedFontFamily:]):
12461         (-[WebCoreSettings setSerifFontFamily:]):
12462         (-[WebCoreSettings setSansSerifFontFamily:]):
12463         (-[WebCoreSettings setCursiveFontFamily:]):
12464         (-[WebCoreSettings setFantasyFontFamily:]):
12465         (-[WebCoreSettings setMinimumFontSize:]):
12466         (-[WebCoreSettings setDefaultFontSize:]):
12467         (-[WebCoreSettings setDefaultFixedFontSize:]):
12468         (-[WebCoreSettings setJavaEnabled:]):
12469         (-[WebCoreSettings setPluginsEnabled:]):
12470         (-[WebCoreSettings setJavaScriptEnabled:]):
12471         (-[WebCoreSettings setJavaScriptCanOpenWindowsAutomatically:]):
12472         (-[WebCoreSettings setWillLoadImagesAutomatically:]):
12473         (-[WebCoreSettings setUserStyleSheetLocation:]):
12474         (-[WebCoreSettings userStyleSheetLocation]):
12475         (-[WebCoreSettings settings]):
12476
12477 2003-02-07  Darin Adler  <darin@apple.com>
12478
12479         * khtml/rendering/render_table.h: Added copyright date.
12480         * khtml/rendering/render_table.cpp: Added copyright date.
12481
12482 2003-02-07  Darin Adler  <darin@apple.com>
12483
12484         Reviewed by Dave.
12485
12486         - fixed 3165171 -- REGRESSION: images overlap text
12487
12488         * khtml/rendering/table_layout.cpp: (AutoTableLayout::calcEffectiveWidth):
12489         Change to distribute space to the fixed columns first so the code to distribute to non-fixed columns does not
12490         assume it can distribute more to the fixed columns than it really can.
12491
12492 2003-02-07  Darin Adler  <darin@apple.com>
12493
12494         Reviewed by Ken.
12495
12496         - fixed 3167025 -- REGRESSION: http://www.buypcdirect.com doesn't wrap correctly b/c of huge cell width value
12497
12498         * khtml/rendering/table_layout.h: Make the fields in the Layout structure used in table
12499         width computations use int instead of short.
12500         * khtml/rendering/table_layout.cpp:
12501         (FixedTableLayout::calcMinMaxWidth): Make sure we don't overflow m_minWidth or m_maxWidth in case the
12502         specified fixed width value is huge.
12503         (FixedTableLayout::layout): Use ints for the calcWidth array instead of shorts.
12504         (AutoTableLayout::calcMinMaxWidth): Clamp both maxWidth and minWidth to 0x7fff to match the other code in
12505         this file, rather than using 10000.
12506
12507 2003-02-06  Darin Adler  <darin@apple.com>
12508
12509         Reviewed by Maciej.
12510
12511         - fixed 3140738 -- textarea contents are LF delimited instead of CRLF
12512
12513         * khtml/html/html_formimpl.cpp:
12514         (encodeCString): Turn CR followed by something other than LF into CRLF.
12515         (fixLineBreaks): Added. Turns stray CRs and LFs into CRLF.
12516         (HTMLFormElementImpl::formData): Call fixLineBreaks on form data.
12517
12518         - fixed 3167235 -- REGRESSION: assert after clicking on a link on radioslack.com
12519
12520         * kwq/KWQTextCodec.mm: (KWQTextDecoder::toUnicode): Return the null string
12521         if the passed in string pointer is NULL, rather than asserting.
12522
12523 2003-02-06  David Hyatt  <hyatt@apple.com>
12524
12525         Fix rollingstone regression.
12526         
12527         Reviewed by mjs
12528
12529         * khtml/rendering/render_object.cpp:
12530         (RenderObject::setLayouted):
12531
12532 2003-02-06  Darin Adler  <darin@apple.com>
12533
12534         Reviewed by Ken.
12535
12536         - fixed 3166693 -- REGRESSION: infinite recursion in makeFirstResponder while tabbing as page loaded
12537
12538         Because we now deliver blur events, we are triggering a handler on this page that changes focus.
12539         It triggered an infinite loop because setFocus kept setting the focus back to a text field, which
12540         then changed the focus to its editor. The fix was to make QWidget::setFocus smarter about editors.
12541
12542         * kwq/KWQTextField.mm: (-[KWQTextField becomeFirstResponder]): Don't do any changes in responder until
12543         after calling KWQKHTMLPart::setDocumentFocus, since that can change focus away. If it does, return NO.
12544
12545         * kwq/KWQWidget.h: Add hasFocus, remove virtual from setFocus and clearFocus.
12546         * kwq/KWQWidget.mm:
12547         (QWidget::hasFocus): Added. Moved code to check if a particular view is first responder here.
12548         Here's the bug fix too, check if the first responder is this widget's view's editor, and if so return true.
12549         (QWidget::setFocus): Do nothing if this widget already has focus.
12550         (QWidget::clearFocus): Do nothing if this widget does not have focus.
12551
12552 2003-02-06  Darin Adler  <darin@apple.com>
12553
12554         Reviewed by Dave.
12555
12556         - fixed 3161953 -- crash in KWQListImpl, DOM::CSSStyleSheetImpl::isLoading on XML page
12557
12558         The problem is that this page has some non-HTML elements, but the code was checking
12559         only the element ID, not whether it is HTML or not. Also fixed the page's layout.
12560
12561         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyleSelector):
12562         Check that the node is an HTML element before checking the ID in two places.
12563         Without this, we cast the pointer to the wrong type and trash memory.
12564
12565         * khtml/rendering/render_root.cpp:
12566         (RenderRoot::layout): Set all the children false here, not just firstChild.
12567         (RenderRoot::docHeight): Take all the children's heights into account, not just firstChild.
12568         (RenderRoot::docWidth): Take all the children's widths into account, not just firstChild.
12569
12570 2003-02-06  Darin Adler  <darin@apple.com>
12571
12572         Reviewed by Dave.
12573
12574         - fixed 3165295 -- Hang while triple clicking on page
12575
12576         Flaws in the continuation logic we added to checkSelectionPoint made it take
12577         exponential time on pages with a lot of continuations.
12578
12579         * khtml/rendering/render_object.h: Make checkSelectionPoint non-virtual, and
12580         added virtual checkSelectionPointIgnoringContinuations.
12581         * khtml/rendering/render_object.cpp:
12582         (RenderObject::checkSelectionPoint): Added. Does the inline continuation part of
12583         the render object walking process, which we only want to do at the top level,
12584         since otherwise we will see the same nodes multiple times. Also optimizes by only
12585         looking at the inline continuations of inlines, not any continuations of a block.
12586         (RenderObject::checkSelectionPointIgnoringContinuations): This is now the virtual
12587         function that is overriden by RenderText. It is identical to the old version of
12588         checkSelectionPoint, minus the continuation logic.
12589
12590         * khtml/rendering/render_text.h: Changed the name of checkSelectionPoint to
12591         checkSelectionPointIgnoringContinuations.
12592         * khtml/rendering/render_text.cpp: (RenderText::checkSelectionPointIgnoringContinuations):
12593         Changed the name, and nothing else.
12594
12595         - fixed my build which was crashing on load
12596
12597         * WebCore.pbproj/project.pbxproj: Change seg1addr from 2200000 to 9000000.
12598
12599 2003-02-05  Trey Matteson  <trey@apple.com>
12600
12601         3137647 - ad frames get their own history entries at channels.netscape.com      
12602         3133844 - 2 items in back list at http://www.kiup-bank.com/personal/main01.html
12603
12604         The logic for deciding whether new entries are added to history is moved here
12605         from WebKit.  The advantage is that we can take specific action in each of the
12606         relevant cases instead of the half-informed guessing WK was doing.
12607
12608         Here is what we now use for the lockHistory param to scheduleRedirect():
12609
12610         document.location = XXX         -    !userGesture
12611         window.location = XXX           -    !userGesture
12612         window.open                     -    false
12613         window.replace                  -    true
12614         window.reload                   -    true
12615         meta equiv http-refresh         -    delay <= 1
12616         http-refresh                    -    delay <= 1
12617
12618         Reviewed by Maciej, Darin.
12619
12620         * khtml/ecma/kjs_binding.cpp:
12621         (ScriptInterpreter::wasRunByUserGesture):  Rename of previous isWindowOpenAllowed(),
12622         since we know use it for multiple purposes.
12623         * khtml/ecma/kjs_binding.h:
12624         * khtml/ecma/kjs_html.cpp:
12625         (KJS::HTMLDocument::putValue):  Assignment to document.location locks history
12626         if not a result of a user gesture.
12627         * khtml/ecma/kjs_window.cpp:
12628         (Window::put):  Assignment to window.location locks history
12629         if not a result of a user gesture.
12630         (WindowFunc::tryCall):  Adopt rename to wasRunByUserGesture().
12631         (Location::put):  Assignment to window.location locks history
12632         if not a result of a user gesture.
12633         * khtml/khtml_part.cpp:
12634         (KHTMLPart::receivedFirstData):  http-refreshes lock history if the timeout<1
12635         * khtml/xml/dom_docimpl.cpp:
12636         (DocumentImpl::processHttpEquiv):  http-refreshes lock history if the timeout<1
12637
12638
12639 2003-02-04  Trey Matteson  <trey@apple.com>
12640
12641         Pass formValues up through the bridge at submit time.
12642
12643         Reviewed by Maciej
12644
12645         * khtml/html/html_formimpl.cpp:
12646         (HTMLFormElementImpl::submit):  Tell KWQPart about the form values, instead of
12647         talking to the khtmlview.
12648         * kwq/KWQKHTMLPart.h:  New ivar to store formValues.
12649         * kwq/KWQKHTMLPart.mm:
12650         (KWQKHTMLPart::KWQKHTMLPart):  Init ivar
12651         (KWQKHTMLPart::~KWQKHTMLPart):  Free ivar
12652         (KWQKHTMLPart::openURL):  Pass nil formValues
12653         (KWQKHTMLPart::openURLRequest):    Pass nil formValues
12654         (KWQKHTMLPart::clearRecordedFormValues):  Clear saved formValues
12655         (KWQKHTMLPart::recordFormValue):  Record a name/value
12656         (KWQKHTMLPart::submitForm):  Pass along recorded formValues
12657         (KWQKHTMLPart::urlSelected):    Pass nil formValues
12658         * kwq/KWQKHTMLPartBrowserExtension.mm:
12659         (KHTMLPartBrowserExtension::createNewWindow):    Pass nil formValues
12660         * kwq/WebCoreBridge.h:  New params for formValues
12661
12662 2003-02-05  Darin Adler  <darin@apple.com>
12663
12664         Reviewed by Dave.
12665
12666         - fixed 3165682 -- REGRESSION: assertion failure in appendChildNode loading cnn.com
12667
12668         * khtml/rendering/render_table.cpp: (RenderTable::addChild):
12669         Get rid of double-addChild introduced when I carelessly rolled in a change
12670         from the KHTML guys.
12671
12672 2003-02-05  David Hyatt  <hyatt@apple.com>
12673
12674         Fix for 3164949.  My fix to make form controls actually obey
12675         display settings in CSS exposed a bug in the html4.css 
12676         stylesheet.  SELECT had been set to be display: block, which
12677         is of course just plain wrong.
12678         
12679         Reviewed by darin
12680
12681         * khtml/css/html4.css:
12682
12683 2003-02-05  Richard Williamson   <rjw@apple.com>
12684
12685         Cleanup public WebHistory API, stage 1.
12686         
12687         Reviewed by trey.
12688
12689         * kwq/KWQKHistoryProvider.mm:
12690         * kwq/WebCoreHistory.h:
12691         * kwq/WebCoreHistory.m:
12692         (+[WebCoreHistory setHistoryProvider:]):
12693         (+[WebCoreHistory historyProvider]):
12694
12695 2003-02-04  Darin Adler  <darin@apple.com>
12696
12697         Reviewed by Maciej.
12698
12699         - fixed 3164850 -- REGRESSION: query URLs are broken
12700
12701         Mea culpa. The KURL test in the Tests directory failed last time, but for
12702         some reason I didn't notice that when I ran it, perhaps due to the other
12703         failing tests.
12704
12705         * kwq/KWQKURL.mm: (appendEscapingBadChars): Don't escape '?' even though
12706         it is in the "bad character" set, since this is a more-lenient definition
12707         of bad character. Also fixed a buffer overrun bug in the '%'-sequence-preserving
12708         code, which is a second way this function is lenient. We still get the speed
12709         because most characters this routine processes are not bad characters.
12710         (KURL::encode_string): Instead of calling appendEscapingBadChars, put in
12711         a strict version of the escaping loop that does not tolerate pre-existing
12712         '%' sequences or '?' characters.
12713
12714 2003-02-04  Darin Adler  <darin@apple.com>
12715
12716         Reviewed by Dave.
12717
12718         - rolled in table code fix from Dirk on the khtml-dev list
12719
12720         * khtml/rendering/render_table.cpp: (RenderTable::addChild):
12721         Change return back to break.
12722
12723 2003-02-04  Darin Adler  <darin@apple.com>
12724
12725         Reviewed by Maciej.
12726
12727         - we say goodbye to "MIB numbers"
12728
12729         * khtml/misc/decoder.cpp:
12730         (Decoder::Decoder): Get the Latin-1 codec using a name.
12731         (Decoder::setEncoding): Detect the Hebrew encoding using isISOLatin1Hebrew()
12732         instead of MIB number.
12733         (Decoder::decode): Get the UCS-2 codec using a name. Redo APPLE_CHANGES so
12734         we don't get the MIB-number-based workaround for a bug in QTextCodec that
12735         KWQ doesn't have. Get the Latin-1 codec using a name.
12736         * khtml/misc/loader.cpp:
12737         (CachedCSSStyleSheet::CachedCSSStyleSheet): Get the Latin-1 codec using a name.
12738         (CachedScript::CachedScript): Get the Latin-1 codec using a name.
12739         
12740         * kwq/KWQCharsets.h: Remove the two MIB-related functions.
12741         * kwq/KWQCharsets.mm: Remove the MIB number from the character set table struct.
12742         Remove the MIB-related dictionary globals and functions.
12743         (buildDictionaries): Remove code to set up the MIB-related dictionaries.
12744
12745         * kwq/KWQTextCodec.h: Remove codecForMib, mibEnum, and encoding member functions.
12746         Add isISOLatin1Hebrew member function.
12747         * kwq/KWQTextCodec.mm:
12748         (QTextCodec::makeDecoder): Pass in the encoding when making KWQTextDecoder rather
12749         than passing in the QTextCodec object.
12750         (QTextCodec::toUnicode): Ditto.
12751         (QTextCodec::isISOLatin1Hebrew): Return true for kCFStringEncodingISOLatinHebrew only.
12752         (KWQTextDecoder::convertUsingTEC): Get encoding directly instead of from a QTextCodec.
12753         (KWQTextDecoder::toUnicode): Ditto.
12754
12755         * kwq/make-charset-table.pl: Don't write out MIB numbers.
12756         * kwq/KWQCharsetData.c: Regenerated.
12757
12758         * khtml/khtml_part.cpp: (KHTMLPart::completeURL):
12759         Don't bother passing the MIB number to KURL. Soon, we'll have to
12760         do something smart here, but we won't use MIB numbers.
12761
12762         * kwq/mac-encodings.txt: Added more 16-bit Unicode character set names.
12763         Updated some comments.
12764
12765 2003-02-04  David Hyatt  <hyatt@apple.com>
12766
12767         Patch calcInlineMaxWidth to add in left/right margins/borders/padding
12768         separately (since the inline could break across multiple lines).
12769         
12770         Reviewed by darin
12771
12772         * khtml/rendering/render_block.cpp:
12773         (RenderBlock::calcInlineMinMaxWidth):
12774
12775 2003-02-04  Maciej Stachowiak  <mjs@apple.com>
12776
12777         Reviewed by Darin.
12778
12779         * WebCore.pbproj/project.pbxproj: Updated to build the framework
12780         standalone instead of embedded when doing a B&I build for Panther.
12781
12782 2003-02-04  David Hyatt  <hyatt@apple.com>
12783
12784         Patch #1: Compacts are supposed to use their maximum intrinsic width
12785         when determining if they will fit.  I was wrongly using the
12786         minwidth (i.e., being too aggressive about trying to squeeze
12787         the compact in there).
12788
12789         Also yanking the setMaxWidth/MinWidth setters, since I'm not
12790         using them any more.
12791         
12792         Reviewed by kocienda
12793
12794         Patch #2: Implement an iterator for min/max width calculations
12795         of blocks with inline children.  This iterator will include
12796         inline flows twice (with a bool flag indicating whether you're at the
12797         start or end of the flow).
12798
12799         Reviewed by darin
12800         
12801         * khtml/rendering/render_block.cpp:
12802         (RenderBlock::layoutBlockChildren):
12803         * khtml/rendering/render_box.h:
12804         * khtml/rendering/render_object.h:
12805
12806 2003-02-04  Darin Adler  <darin@apple.com>
12807
12808         Reviewed by Maciej.
12809
12810         - fixed 3142813 -- Safari displays a blank page when trying to open html file encoded in little-endian UTF-16
12811
12812         * kwq/KWQString.h: Remove fromStringWithEncoding and convertToQCString,
12813         add append that takes a QChar * and length.
12814         * kwq/KWQString.mm:
12815         (QString::fromUtf8): Use QTextCodec instead of fromStringWithEncoding.
12816         (QString::append): Implement by calling insert.
12817
12818         * kwq/KWQTextCodec.h: Added an encoding() member function to QTextCodec
12819         and made QTextDecoder an abstract base class to pave the way for putting
12820         more state in it to handle multibyte encodings.
12821         * kwq/KWQTextCodec.mm: Add KWQTextDecoder, a concrete subclass of QTextDecoder.
12822         (codecForCFStringEncoding): Moved the static inside this function for clarity.
12823         (QTextCodec::makeDecoder): Make a KWQTextDecoder.
12824         (QTextCodec::toUnicode): Make a KWQTextDecoder and use it do the decoding instead
12825         of calling fromStringWithEncoding.
12826         (KWQTextDecoder::convertUTF16): Added. Decodes Unicode, using the BOM to decide
12827         whether it's little-endian or big-endian.
12828         (KWQTextDecoder::convertUsingTEC): Added. Here's where the code from
12829         QString::fromStringWithEncoding was moved. This needs to be changed to handle
12830         state between multiple buffers passed in eventually, but not to fix this bug.
12831         (KWQTextDecoder::toUnicode): Added. Calls convertUTF16 or convertUsingTEC.
12832
12833         * kwq/WebCoreBridge.mm: (+[WebCoreBridge stringWithData:textEncoding:]):
12834         Use QTextCodec instead of fromStringWithEncoding.
12835
12836         * khtml/misc/decoder.cpp: (Decoder::decode): Rearranged the #if to make
12837         things easier to read.
12838
12839 2003-02-04  Darin Adler  <darin@apple.com>
12840
12841         Reviewed by Trey.
12842
12843         - fixed 3150252 -- files with question marks in their names fail to upload as attachments
12844
12845         * khtml/html/html_formimpl.cpp:
12846         (HTMLFormElementImpl::formData): Don't include a Content-Type header at all if we don't
12847         have a MIME type to send. Matches other web browsers' behavior.
12848         (HTMLInputElementImpl::encoding): Construct the URL using setPath rather than just passing
12849         a filename to the KURL constructor.
12850         (HTMLSelectElementImpl::state): Tweak #if formatting a bit.
12851         (HTMLSelectElementImpl::restoreState): Improve comment a bit.
12852         * kwq/KWQKURL.mm: Make ? be a "bad character". I checked carefully to be sure this does
12853         not adversely affect any calls, including running our KURL tests.
12854         (KURL::setPath): Encode the passed-in path. I determined this was correct both by looking
12855         at all the call sites in KHTML code to see that they would want this behavior, and by noticing
12856         that the path() getter decodes the path.
12857
12858 2003-02-04  Ken Kocienda  <kocienda@apple.com>
12859
12860         Reviewed by Darin
12861
12862         Radar 3142922 (file URLs should never be sent as referrers)
12863
12864         * kwq/WebCoreBridge.mm:
12865         (-[WebCoreBridge referrer]): Check that the referrer does not start with
12866         the prefix "file:". If it does, return nil.
12867
12868 2003-02-03  David Hyatt  <hyatt@apple.com>
12869
12870         Fix for 3163603, livepage.apple.com repaints entire page.
12871         
12872         Reviewed by darin.
12873
12874         * khtml/rendering/render_object.cpp:
12875         (RenderObject::setStyle):
12876
12877 2003-02-03  Darin Adler  <darin@apple.com>
12878
12879         Reviewed by Dave.
12880
12881         - fixed 3133902 -- leaked render objects from makeChildrenNonInline (4 after running cvs-base)
12882
12883         * khtml/rendering/render_block.cpp: (RenderBlock::removeChild):
12884         Deatch the anonymous block after emptying it out.
12885
12886 2003-02-03  David Hyatt  <hyatt@apple.com>
12887
12888         Fix for livepage.apple.com crash.  The bug # is
12889         3163508.
12890         
12891         Reviewed by darin
12892
12893         * khtml/rendering/render_box.cpp:
12894         (RenderBox::setPos):
12895
12896 2003-02-03  David Hyatt  <hyatt@apple.com>
12897
12898         Rename TextSlave to TextRun.
12899         
12900         Reviewed by darin
12901
12902         * khtml/khtml_part.cpp:
12903         (firstRunAt):
12904         (lastRunAt):
12905         (startAndEndLineNodesIncludingNode):
12906         * khtml/rendering/bidi.cpp:
12907         (RenderBlock::layoutInlineChildren):
12908         * khtml/rendering/render_text.cpp:
12909         (TextRun::detach):
12910         (throw):
12911         (TextRun::operator delete):
12912         (TextRun::paintSelection):
12913         (TextRun::paintDecoration):
12914         (TextRun::paintBoxDecorations):
12915         (TextRun::checkSelectionPoint):
12916         (TextRunArray::TextRunArray):
12917         (TextRunArray::compareItems):
12918         (TextRunArray::findFirstMatching):
12919         (RenderText::detach):
12920         (RenderText::deleteRuns):
12921         (RenderText::findTextRun):
12922         (RenderText::nodeAtPoint):
12923         (RenderText::checkSelectionPoint):
12924         (RenderText::cursorPos):
12925         (RenderText::posOfChar):
12926         (RenderText::paintObject):
12927         (RenderText::position):
12928         (RenderText::width):
12929         * khtml/rendering/render_text.h:
12930         * kwq/KWQRenderTreeDebug.cpp:
12931         (writeTextRun):
12932         (write):
12933
12934 2003-02-03  David Hyatt  <hyatt@apple.com>
12935
12936         Fix for assertion on nasdaq.com.  Patch containingBlock
12937         to return 0 when it can't find a containingBlock at all (e.g.,
12938         when the object is orphaned).
12939
12940         Patch setOverhangingContents to deal with a null containingBlock
12941         caused by it being called from RenderImage::setStyle().
12942
12943         The bug # is 3162989.
12944         
12945         Reviewed by Darin.
12946
12947         * khtml/rendering/render_object.cpp:
12948         (RenderObject::containingBlock):
12949         (RenderObject::setOverhangingContents):
12950
12951 2003-02-02  David Hyatt  <hyatt@apple.com>
12952
12953         Enable support for the "run-in" and "compact" display types.
12954
12955         Also implementing support for :before and :after (they were not even
12956         remotely working before these fixes).
12957
12958         Made sure :first-letter drills into inline children to find the
12959         first letter in a block, e.g., so :before content can be used in
12960         conjunction with :first-letter.
12961
12962         Fixed a regression in addOverhangingFloats that broke meyerweb.com's
12963         front page.
12964
12965         Patched findNextLineBreak to correctly handle words that cross
12966         inline boundaries and white-space mixtures.  We now pass Hixie's
12967         insanely evil mixed white-space test (we are the only browser
12968         to do so).
12969         
12970         Reviewed by kocienda
12971
12972         * ChangeLog:
12973         * khtml/css/cssstyleselector.cpp:
12974         * khtml/rendering/bidi.cpp:
12975         (RenderBlock::findNextLineBreak):
12976         * khtml/rendering/render_block.cpp:
12977         (RenderBlock::setStyle):
12978         (RenderBlock::addChildToFlow):
12979         (getInlineRun):
12980         (RenderBlock::layoutBlockChildren):
12981         (RenderBlock::paintObject):
12982         (RenderBlock::clearFloats):
12983         * khtml/rendering/render_box.cpp:
12984         (RenderBox::calcWidthUsing):
12985         * khtml/rendering/render_box.h:
12986         * khtml/rendering/render_container.cpp:
12987         (RenderContainer::insertPseudoChild):
12988         * khtml/rendering/render_container.h:
12989         * khtml/rendering/render_flow.cpp:
12990         (RenderFlow::addChild):
12991         * khtml/rendering/render_image.cpp:
12992         (RenderImage::setStyle):
12993         * khtml/rendering/render_inline.cpp:
12994         (RenderInline::setStyle):
12995         (RenderInline::addChildToFlow):
12996         * khtml/rendering/render_object.cpp:
12997         (RenderObject::createObject):
12998         * khtml/rendering/render_object.h:
12999         * khtml/rendering/render_style.cpp:
13000         (RenderStyle::addPseudoStyle):
13001
13002 2003-02-03  Darin Adler  <darin@apple.com>
13003
13004         Reviewed by Maciej.
13005
13006         - fixed 3146862 -- meta http-equiv refresh with a space before the delay does not work
13007
13008         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::processHttpEquiv):
13009         Fix code that was trying to use positions within the whitespace-stripped string,
13010         but extracting substrings from the non-stripped original.
13011
13012         - tweaks to render tree dumping format
13013
13014         * khtml/rendering/render_block.h: Make renderName not be inline, since
13015         an inline virtual function doesn't really do any good.
13016         * khtml/rendering/render_block.cpp: (RenderBlock::renderName): Use the
13017         string RenderBlock instead of the string Block for consistency with all the
13018         other renderName results.
13019         
13020         * khtml/rendering/render_inline.h: Make renderName not be inline, since
13021         an inline virtual function doesn't really do any good.
13022         * khtml/rendering/render_inline.cpp: (RenderInline::renderName): Use the
13023         string RenderInline instead of the string Inline for consistency with all the
13024         other renderName results.
13025         
13026         * khtml/rendering/render_text.h: Make textSlaves() a const member function.
13027         * kwq/KWQRenderTreeDebug.cpp:
13028         (operator<<): Format rectangles as "x at (1,2) size 3x4" rather than "(1,2,3,4)".
13029         (quoteAndEscapeNonPrintables): Added. Makes it easy to turn an arbitrary Unicode
13030         string into something that's all ASCII.
13031         (writeTextSlave): Change this so it also writes out the text.
13032         (write): Call the new writeTextSlave, and also use "layer" instead of "RenderLayer".
13033
13034 2003-02-01  Darin Adler  <darin@apple.com>
13035
13036         - fix mistake that broke build
13037
13038         * khtml/rendering/render_block.h: Add include of <qsortedlist.h>.
13039
13040 2003-01-31  Darin Adler  <darin@apple.com>
13041
13042         Reviewed by Dave.
13043
13044         - reduced the amount of RenderFlow in the world by about 1/2
13045
13046         * khtml/rendering/bidi.h: Take RenderBlock * instead of RenderFlow *.
13047         * khtml/rendering/bidi.cpp:
13048         (BidiIterator::BidiIterator): Take RenderBlock * instead of RenderFlow *.
13049         (RenderBlock::layoutInlineChildren): Fix debug message to say RenderBlock instead of RenderFlow.
13050         (RenderBlock::findNextLineBreak): Fix debug message to say RenderBlock instead of RenderFlow.
13051
13052         * khtml/rendering/render_block.cpp:
13053         (RenderBlock::addChildToFlow): Make RenderBlock * instead of RenderFlow *.
13054         (RenderBlock::layout): Fix debug message to say RenderBlock instead of RenderFlow.
13055         (RenderBlock::layoutBlockChildren): Fix debug message to say RenderBlock instead of RenderFlow.
13056         (RenderBlock::clearFloats): Fix debug message to say RenderBlock instead of RenderFlow.
13057
13058         * khtml/rendering/render_flow.h: Return a RenderFlow * instead of a RenderObject * from createFlow.
13059         * khtml/rendering/render_flow.cpp:
13060         (RenderFlow::createFlow): Use an if statement instead of ? : to get rid of typecasting.
13061
13062         * khtml/rendering/render_html.cpp: (RenderHtml::containingBlockWidth):
13063         Fix parent call to call RenderBlock. Calling RenderFlow was a mistake, but one that didn't matter
13064         since the actual method isn't implemented until up in RenderBox anyway.
13065
13066         * khtml/rendering/render_inline.h: Change some parameters to RenderBlock *.
13067         * khtml/rendering/render_inline.cpp:
13068         (cloneInline): Make this return a RenderInline * instead of a RenderFlow *.
13069         (RenderInline::splitInlines): Change some parameters to RenderBlock * and locals to RenderInline *.
13070         (RenderInline::splitFlow): Change some parameters and locals to RenderBlock *.
13071
13072         * khtml/rendering/render_layer.h: Remove forward declaration of class RenderFlow.
13073         * khtml/rendering/render_object.h: Remove forward declaration and friend declaration of class RenderFlow.
13074
13075 2003-01-31  Trey Matteson  <trey@apple.com>
13076
13077         New plumbing for autofill/autocomplete.  WebBrowser receives controlText delegate
13078         messages from our form widgets.  Should result in no behavior change.
13079
13080         New SPI is exposed over the bridge and KWQTextField passes the text delegate msgs to it.
13081
13082         Reviewed by Richard
13083
13084         * kwq/KWQTextField.mm:  Pass text delegate msgs through new SPI.
13085         (-[KWQTextField controlTextDidBeginEditing:]):
13086         (-[KWQTextField controlTextDidEndEditing:]):
13087         (-[KWQTextField controlTextDidChange:]):
13088         (-[KWQTextField control:textShouldBeginEditing:]):
13089         (-[KWQTextField control:textShouldEndEditing:]):
13090         (-[KWQTextField control:didFailToFormatString:errorDescription:]):
13091         (-[KWQTextField control:didFailToValidatePartialString:errorDescription:]):
13092         (-[KWQTextField control:isValidObject:]):
13093         (-[KWQTextField control:textView:doCommandBySelector:]):
13094         * kwq/WebCoreBridge.h:  New SPI for passing text delegate msgs.
13095
13096 2003-01-31  David Hyatt  <hyatt@apple.com>
13097
13098         Fix regression that broke John's site.  RenderInline needs
13099         to implement childrenInline() so that it can return true.
13100         I pulled this method out of RenderFlow and into RenderBlock,
13101         which caused RenderInline to use RenderObject's method (and
13102         that one returns false).
13103         
13104         Reviewed by rjw
13105
13106         * khtml/rendering/render_inline.h:
13107
13108 2003-01-31  David Hyatt  <hyatt@apple.com>
13109
13110         Fix for crash on espn.com.  Revert my change to make 
13111         containingBlock() return 0 for the root.  Put it back to the
13112         old behavior, where the root returns itself when you ask for
13113         the root's containing block.
13114         
13115         Reviewed by rjw
13116
13117         * khtml/rendering/render_object.cpp:
13118         (RenderObject::containingBlock):
13119         (RenderObject::setOverhangingContents):
13120
13121 2003-01-31  David Hyatt  <hyatt@apple.com>
13122
13123         Two whitespace handling fixes that improve <pre> handling, 
13124         especially of inline pres.
13125         
13126         Reviewed by rjw.
13127
13128         * khtml/rendering/bidi.cpp:
13129         (RenderBlock::findNextLineBreak):
13130         
13131 2003-01-31  Darin Adler  <darin@apple.com>
13132
13133         Reviewed by Richard.
13134
13135         * khtml/misc/decoder.cpp: (Decoder::decode): Turn off Japanese auto-detect.
13136         It was causing us to use Japanese encoding on pages that were UTF-8.
13137
13138 2003-01-31  Darin Adler  <darin@apple.com>
13139
13140         * Resources/Info.plist: Removed unused file.
13141
13142 2003-01-31  David Hyatt  <hyatt@apple.com>
13143
13144         Split RenderFlow into subclasses: RenderInline and RenderBlock.
13145         This change should make inlines a lot smaller (since nearly all
13146         of the member variables in RenderFlow moved into RenderBlock).
13147
13148         It also simplifies methods like containingBlock(), which can
13149         now return a RenderBlock.
13150         
13151         Reviewed by darin
13152
13153         * WebCore.pbproj/project.pbxproj:
13154         * khtml/css/cssstyleselector.cpp:
13155         * khtml/rendering/bidi.cpp:
13156         (RenderBlock::bidiReorderLine):
13157         (RenderBlock::layoutInlineChildren):
13158         (RenderBlock::findNextLineBreak):
13159         * khtml/rendering/render_block.cpp: Added.
13160         (:RenderFlow):
13161         (RenderBlock::~RenderBlock):
13162         (RenderBlock::setStyle):
13163         (RenderBlock::addChildToFlow):
13164         (getInlineRun):
13165         (RenderBlock::makeChildrenNonInline):
13166         (RenderBlock::removeChild):
13167         (RenderBlock::layout):
13168         (RenderBlock::layoutBlockChildren):
13169         (RenderBlock::layoutSpecialObjects):
13170         (RenderBlock::paint):
13171         (RenderBlock::paintObject):
13172         (RenderBlock::paintFloats):
13173         (RenderBlock::insertSpecialObject):
13174         (RenderBlock::removeSpecialObject):
13175         (RenderBlock::positionNewFloats):
13176         (RenderBlock::newLine):
13177         (RenderBlock::leftOffset):
13178         (RenderBlock::leftRelOffset):
13179         (RenderBlock::rightOffset):
13180         (RenderBlock::rightRelOffset):
13181         (RenderBlock::lineWidth):
13182         (RenderBlock::nearestFloatBottom):
13183         (RenderBlock::floatBottom):
13184         (RenderBlock::lowestPosition):
13185         (RenderBlock::rightmostPosition):
13186         (RenderBlock::leftBottom):
13187         (RenderBlock::rightBottom):
13188         (RenderBlock::clearFloats):
13189         (RenderBlock::addOverHangingFloats):
13190         (RenderBlock::checkClear):
13191         (RenderBlock::nodeAtPoint):
13192         (RenderBlock::calcMinMaxWidth):
13193         (next):
13194         (RenderBlock::calcInlineMinMaxWidth):
13195         (RenderBlock::calcBlockMinMaxWidth):
13196         (RenderBlock::close):
13197         (RenderBlock::printTree):
13198         (RenderBlock::dump):
13199         * khtml/rendering/render_block.h: Added.
13200         * khtml/rendering/render_body.cpp:
13201         (RenderBody::RenderBody):
13202         (RenderBody::setStyle):
13203         (RenderBody::layout):
13204         (RenderBody::availableHeight):
13205         * khtml/rendering/render_body.h:
13206         * khtml/rendering/render_box.cpp:
13207         (RenderBox::containingBlockWidth):
13208         (RenderBox::calcWidth):
13209         (RenderBox::calcHeight):
13210         * khtml/rendering/render_container.cpp:
13211         (RenderContainer::insertPseudoChild):
13212         (RenderContainer::removeLeftoverAnonymousBoxes):
13213         * khtml/rendering/render_flow.cpp:
13214         (RenderFlow::createFlow):
13215         (RenderFlow::addChildWithContinuation):
13216         * khtml/rendering/render_flow.h:
13217         * khtml/rendering/render_form.h:
13218         * khtml/rendering/render_html.cpp:
13219         (RenderHtml::RenderHtml):
13220         (RenderHtml::setStyle):
13221         (RenderHtml::layout):
13222         * khtml/rendering/render_html.h:
13223         * khtml/rendering/render_image.h:
13224         * khtml/rendering/render_inline.cpp: Added.
13225         (:RenderFlow):
13226         (RenderInline::~RenderInline):
13227         (RenderInline::setStyle):
13228         (RenderInline::addChildToFlow):
13229         (cloneInline):
13230         (RenderInline::splitInlines):
13231         (RenderInline::splitFlow):
13232         (RenderInline::paint):
13233         (RenderInline::paintObject):
13234         (RenderInline::calcMinMaxWidth):
13235         (RenderInline::offsetWidth):
13236         (RenderInline::offsetHeight):
13237         (RenderInline::offsetLeft):
13238         (RenderInline::offsetTop):
13239         * khtml/rendering/render_inline.h: Added.
13240         * khtml/rendering/render_list.cpp:
13241         (RenderListItem::RenderListItem):
13242         (RenderListItem::setStyle):
13243         (getParentOfFirstLineBox):
13244         (RenderListItem::calcMinMaxWidth):
13245         (RenderListItem::layout):
13246         (RenderListItem::paint):
13247         (RenderListItem::paintObject):
13248         * khtml/rendering/render_list.h:
13249         * khtml/rendering/render_object.cpp:
13250         (RenderObject::createObject):
13251         (RenderObject::containingBlock):
13252         (RenderObject::setOverhangingContents):
13253         (RenderObject::removeFromSpecialObjects):
13254         * khtml/rendering/render_object.h:
13255         * khtml/rendering/render_replaced.h:
13256         * khtml/rendering/render_root.cpp:
13257         (RenderRoot::RenderRoot):
13258         (RenderRoot::calcMinMaxWidth):
13259         (RenderRoot::layout):
13260         (RenderRoot::paintObject):
13261         * khtml/rendering/render_root.h:
13262         * khtml/rendering/render_table.cpp:
13263         (RenderTable::RenderTable):
13264         (RenderTable::setStyle):
13265         (RenderTable::lineHeight):
13266         (RenderTable::baselinePosition):
13267         (RenderTable::addChild):
13268         (RenderTable::calcWidth):
13269         (RenderTable::recalcSections):
13270         (RenderTable::dump):
13271         (RenderTableCell::RenderTableCell):
13272         (RenderTableCell::detach):
13273         (RenderTableCell::calcMinMaxWidth):
13274         (RenderTableCell::close):
13275         (RenderTableCell::repaintRectangle):
13276         (RenderTableCell::absolutePosition):
13277         (RenderTableCell::setStyle):
13278         (RenderTableCell::dump):
13279         * khtml/rendering/render_table.h:
13280         * khtml/rendering/render_text.h:
13281         * khtml/xml/dom_textimpl.cpp:
13282         (TextImpl::rendererIsNeeded):
13283
13284 2003-01-31  Darin Adler  <darin@apple.com>
13285
13286         Reviewed by me, Dave wrote the code.
13287
13288         - fixed 3162013 -- Safari collapses margins through bottom borders (affects top of zeldman.com)
13289
13290         * khtml/rendering/render_flow.cpp: (RenderFlow::layoutBlockChildren):
13291         Don't collapse if we have any bottom border or padding.
13292
13293 2003-01-31  Darin Adler  <darin@apple.com>
13294
13295         Reviewed by Dave.
13296
13297         - fixed 3160442 -- no top image map at ebay, caused by referrer returning null instead of empty string
13298
13299         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::tryGet):
13300         Return an empty string, not null, when there is no referrer.
13301         
13302 2003-01-31  Chris Blumenberg  <cblu@apple.com>
13303
13304         * kwq/WebCoreBridge.mm: fixed key value
13305
13306 2003-01-31  Chris Blumenberg  <cblu@apple.com>
13307
13308         Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
13309
13310
13311         Reviewed by darin.
13312
13313         * kwq/WebCoreBridge.h: added WebCoreElementImageRectKey
13314         * kwq/WebCoreBridge.mm:
13315         (-[WebCoreBridge elementAtPoint:]): get the rect of the image
13316
13317 2003-01-30  Trey Matteson  <trey@apple.com>
13318
13319         3161088 - disabled select elements are not disabled when scrolling list used    
13320
13321         We use a tableview delegate method to prevent the user from changing the
13322         selection when disabled.  Too bad tableviews don't know how to disable themselves.
13323         We also condition the cell used for drawing to match our enabled state.
13324
13325         Reviewed by Maciej.
13326
13327         * kwq/KWQListBox.h:  Keep track of whether we are enabled.
13328         * kwq/KWQListBox.mm:
13329         (QListBox::QListBox):  Init new flag.
13330         (QListBox::setEnabled):  Set new flag.
13331         (QListBox::isEnabled):  Getter for new flag.
13332         (-[KWQListBoxTableViewDelegate selectionShouldChangeInTableView:]):
13333         Disallow selection changes if disabled.
13334         (-[KWQListBoxTableViewDelegate tableView:willDisplayCell:forTableColumn:row:]):
13335         Enable cell based on our enabled state to get visual feedback of being disabled.
13336
13337 2003-01-30  Trey Matteson  <trey@apple.com>
13338
13339         3161486 - REGRESSION: double click on a widget causes crash
13340
13341         Slight enhancement to the earlier fix of this bug.  When handling a doubleclick we
13342         don't want to try to pass the current event down the Cocoa widgets, because Cocoa
13343         has no double-click event, and we just end up resending one we already sent.
13344
13345         The upshot is that we do not pass an extra mouseup event to the widgets at the
13346         end of a double click sequence.
13347
13348         Reviewed by Darin.
13349
13350         * kwq/KWQKHTMLPart.mm:
13351         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
13352         Do not pass event down to the widget for doubleclick events.
13353
13354 === Safari-55 ===
13355
13356 2003-01-30  Darin Adler  <darin@apple.com>
13357
13358         Reviewed by Ken, Maciej, and Trey.
13359
13360         - fixed 3161486 -- REGRESSION: double click on a widget causes crash
13361
13362         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
13363         Only pass the mouseUp event if it's not the same as the current event.
13364         Through a strange set of circumstances, sometimes the "mouse down" event is a mouse up
13365         event (due to KHTML vs. AppKit differences for double-click handling).
13366
13367         - fixed build with newer compiler
13368
13369         * khtml/html/Makefile.am: Use ANSI-C style, not C++ style, gperf.
13370         * khtml/html/doctypes.cpp: Regenerated.
13371         * khtml/html/html_documentimpl.cpp: Do __inline workaround to make newer compiler happy.
13372         (HTMLDocumentImpl::determineParseMode): Change to use ANSI-C style.
13373
13374 2003-01-30  Richard Williamson   <rjw@apple.com>
13375
13376         Fix for 3156831 (and dupe 3160816).  Don't access userInfo on an invalid NSTimer.
13377         
13378         Reviewed by trey.
13379
13380         * kwq/KWQObject.mm:
13381         (QObject::pauseTimer):
13382         (QObject::resumeTimers):
13383
13384 2003-01-30  Trey Matteson  <trey@apple.com>
13385
13386         3160565 - REGRESSION: Can't log in to etrade
13387
13388         Fix regression caused by fixed to 3058229.  We auto-select an item of a select element
13389         if it is size=1 or size is unset (m_size==0 in the code).
13390
13391         This gives us conformance with WinIE.  The test at dbaron.org fails us for the
13392         case of a disabled list with no size and no initial selection.
13393
13394         Reviewed by Darin.
13395
13396         * khtml/html/html_formimpl.cpp:
13397         (HTMLSelectElementImpl::recalcListItems):  Auto-select an item if size==1 or is unset.
13398
13399 2003-01-30  David Hyatt  <hyatt@apple.com>
13400
13401         Make quirk bits part of the bitfield to shrink RenderFlows.
13402         
13403         Reviewed by trey
13404
13405         * khtml/rendering/render_flow.h:
13406
13407 2003-01-30  David Hyatt  <hyatt@apple.com>
13408
13409         Fix for 3155954.  Make sure no layers get made for :before,
13410         :after or :first-letter.  The only debatable case is whether
13411         overflow can apply to generated content.  Included a FIXME
13412         to think about that case.
13413         
13414         Reviewed by darin
13415
13416         * khtml/rendering/render_container.cpp:
13417         (RenderContainer::insertPseudoChild):
13418         * khtml/rendering/render_flow.cpp:
13419         (RenderFlow::addChildToFlow):
13420         * khtml/rendering/render_text.cpp:
13421         (RenderText::nodeAtPoint):
13422
13423 2003-01-30  Darin Adler  <darin@apple.com>
13424
13425         * khtml/html/html_documentimpl.cpp: Updated license.
13426
13427 2003-01-29  Darin Adler  <darin@apple.com>
13428
13429         Reviewed by Maciej.
13430
13431         - fixed 3158958 -- nil-dereference in KJS::DOMNode::getValueProperty at www.babyage.com
13432
13433         * khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty):
13434         Move the code that gets the render object down after the point where the render tree
13435         is updated, so we don't end up using a stale pointer.
13436
13437 2003-01-29  Darin Adler  <darin@apple.com>
13438
13439         - add new assertion that Dave can use to debug bug 3155954 tomorrow
13440
13441         * khtml/rendering/render_arena.cpp: (RenderArena::allocate): Assert that the arena is not 0.
13442         (RenderArena::free): Change signature so we will detect double-frees even more simply.
13443
13444 2003-01-29  David Hyatt  <hyatt@apple.com>
13445
13446         Margins were being lost on documents inside iframes
13447         and objects.  This turned out to be 3 different bugs, one
13448         of which involved the bad cast of an object element to an
13449         iframe element.
13450         
13451         Reviewed by darin
13452
13453         * khtml/html/html_baseimpl.cpp:
13454         (HTMLIFrameElementImpl::HTMLIFrameElementImpl):
13455         * khtml/rendering/render_frames.cpp:
13456         (RenderPartObject::slotViewCleared):
13457         * kwq/KWQKHTMLPart.mm:
13458         (KWQKHTMLPart::createPart):
13459
13460 2003-01-29  David Hyatt  <hyatt@apple.com>
13461
13462         Fix for auto width tables.  Prevent overflow when assigning from
13463         the computed integer max width back into a short value.
13464
13465         Fixes cnn.com and spies.com. Bug # is 3158469.
13466         
13467         Reviewed by darin
13468
13469         * khtml/rendering/table_layout.cpp:
13470         (AutoTableLayout::calcMinMaxWidth):
13471
13472 2003-01-29  Darin Adler  <darin@apple.com>
13473
13474         Reviewed by Dave.
13475
13476         - fixed 3150439 -- navigating to a .xml, then away, then back causes display problems
13477
13478         * khtml/rendering/render_root.h: Add paintBoxDecorations
13479         * khtml/rendering/render_root.cpp: (RenderRoot::paintObject):
13480         Call paintBoxDecorations all the time. Don't consult shouldPaintBackgroundOrBorder(),
13481         and don't waste cycles on !isInline().
13482         (RenderRoot::paintBoxDecorations): If we don't have a RenderHtml as our first child,
13483         then fill with the background color.
13484
13485         * khtml/html/htmlparser.cpp: (KHTMLParser::finished): Remove code that makes an HTML
13486         element for an empty document. We don't need it any more.
13487
13488 2003-01-29  David Hyatt  <hyatt@apple.com>
13489
13490         Fix for tables.  They weren't initializing their max top/bottom
13491         values for margin collapsing, so their margins were being
13492         ignored!
13493         
13494         Reviewed by darin
13495
13496         * khtml/rendering/render_flow.cpp:
13497         (RenderFlow::layout):
13498         * khtml/rendering/render_flow.h:
13499         * khtml/rendering/render_table.cpp:
13500         (RenderTable::layout):
13501
13502 2003-01-29  David Hyatt  <hyatt@apple.com>
13503
13504         Back out my removal of the layer optimization.  The rest of
13505         the code is not prepared to deal with child elements overriding
13506         visibility, or with invisible layers sitting on top of
13507         visible ones.
13508         
13509         * khtml/rendering/render_layer.cpp:
13510         (RenderLayer::constructZTree):
13511
13512 2003-01-28  David Hyatt  <hyatt@apple.com>
13513
13514         Fix yet another bug with makeChildrenNonInline that caused the
13515         assertion on 3158194.  Rather than trying to work with the
13516         function as it was written by the KHTML guys, I've just thrown
13517         everything out and re-written it using a helper function to make
13518         it more clear what's going on (and less error-prone).
13519         
13520         Reviewed by darin
13521
13522         * khtml/rendering/render_flow.cpp:
13523         (getInlineRun):
13524         (RenderFlow::makeChildrenNonInline):
13525
13526 2003-01-29  Darin Adler  <darin@apple.com>
13527
13528         * khtml/rendering/break_lines.cpp: (isBreakable): Fix error that prevented this
13529         from compiling. I had failed to build, and then tested the version without my change!
13530         I retested with the change.
13531
13532 2003-01-29  Darin Adler  <darin@apple.com>
13533
13534         Reviewed by Ken.
13535
13536         - fixed 3158477 -- text break locator leak leads to giant (2.04 GB) VSIZE idling at livepage
13537
13538         * khtml/rendering/break_lines.cpp: (isBreakable): Dispose the text locator.
13539
13540 2003-01-28  David Hyatt  <hyatt@apple.com>
13541
13542         Fix quirks/strict regression caused by improper use of findRev (should
13543         be find), and latin1() (can't be invoked on temporaries).
13544         
13545         Reviewed by darin
13546
13547         * khtml/html/html_documentimpl.cpp:
13548         (parseDocTypePart):
13549         (HTMLDocumentImpl::determineParseMode):
13550
13551 2003-01-28  David Hyatt  <hyatt@apple.com>
13552
13553         Fix for 3155209, dashed-line schmutz left behind when dragging
13554         links.  
13555
13556         Also porting a fix from the old table code to the new table code
13557         that I missed.
13558         
13559         Reviewed by darin
13560
13561         * khtml/rendering/render_object.cpp:
13562         (RenderObject::setStyle):
13563         * khtml/rendering/render_table.cpp:
13564         (RenderTable::layout):
13565
13566 2003-01-27  David Hyatt  <hyatt@apple.com>
13567
13568         New implementation of determineParseMode that is much better
13569         about getting the quirks vs. strict decision right (as compared
13570         to Mozilla and WinIE).
13571
13572         Also made a new inQuirksMode function and converted callers of
13573         parseMode to use it, so that AlmostStrict and Strict modes will
13574         both be treated as non-quirks mode by those who check for this
13575         sort of thing.
13576         
13577         Reviewed by darin, mjs
13578
13579         * khtml/html/html_documentimpl.cpp:
13580         (parsePS):
13581         (containsString):
13582         (parseDocTypeDeclaration):
13583         (HTMLDocumentImpl::determineParseMode):
13584         * khtml/html/html_headimpl.cpp:
13585         (HTMLLinkElementImpl::setStyleSheet):
13586         (HTMLStyleElementImpl::childrenChanged):
13587         * khtml/html/html_tableimpl.cpp:
13588         (HTMLTableElementImpl::attach):
13589         * khtml/html/htmlparser.cpp:
13590         (KHTMLParser::parseToken):
13591         * khtml/html/htmltokenizer.cpp:
13592         (HTMLTokenizer::parseTag):
13593         * khtml/khtml_part.cpp:
13594         (KHTMLPart::gotoAnchor):
13595         * khtml/rendering/render_flow.cpp:
13596         (RenderFlow::layoutBlockChildren):
13597         * khtml/rendering/render_list.cpp:
13598         (getParentOfFirstLineBox):
13599         * khtml/rendering/render_object.cpp:
13600         (RenderObject::createObject):
13601         * khtml/xml/dom_docimpl.cpp:
13602         (DocumentImpl::determineParseMode):
13603         * khtml/xml/dom_docimpl.h:
13604         * khtml/xml/dom_elementimpl.cpp:
13605         (ElementImpl::createDecl):
13606         * kwq/KWQString.mm:
13607         (QString::compare):
13608
13609 2003-01-28  Darin Adler  <darin@apple.com>
13610
13611         Reviewed by Ken and Maciej.
13612
13613         - fixed remaining bit of 3142646 -- JavaScript Error reported at www.hotmail.com after first time
13614
13615         The problem was that forms that were attached, but had no render object yet, were
13616         not in the form names dictionary. This causes trouble for JavaScript that runs before
13617         style sheets load, since the FOUC code makes us not create render objects at that stage.
13618
13619         * khtml/html/html_formimpl.cpp:
13620         (HTMLFormElementImpl::attach): Don't check m_render before adding to dictionary.
13621         (HTMLFormElementImpl::parseAttribute): Use attached(), not m_render, to tell whether
13622         to track the name of the form in the dictionary.
13623
13624         * khtml/html/html_imageimpl.cpp:
13625         (HTMLImageElementImpl::parseAttribute): Use attached(), not m_render, to tell whether
13626         to track the name of the image in the dictionary.
13627         (HTMLImageElementImpl::attach): Don't check m_render before adding to dictionary.
13628
13629 2003-01-28  Maciej Stachowiak  <mjs@apple.com>
13630
13631         Reviewed by John.
13632
13633         - fixed 3157014 - Crash on disabling JavaScript and reloading livepage.apple.com
13634         
13635         * khtml/khtml_part.cpp:
13636         (KHTMLPart::openURL): Move check of JavaScript setting and possible disabling from here...
13637         (KHTMLPart::begin): ... to here, to make sure it happens after clearing the interpreter.
13638         * kwq/KWQKHTMLPart.mm:
13639         (KWQKHTMLPart::resumeActions): Don't bother to restore timers if JavaScript is off.
13640
13641 2003-01-28  Trey Matteson  <trey@apple.com>
13642
13643         3158465 - REGRESSION: cursor turns into I-beam after clicking on most KWQ widgets
13644
13645         When we return from handing a mousedown to an AK widget, we check to see if currentEvent
13646         is now a MouseUp, in which case we hand it to khtml.  This allows khtml to keep in
13647         synch as to the state of the mouse.  This covers the case of AK widgets that
13648         run their own event loop and consume events until a mouseup (but not ones that use
13649         Carbon, such as PopUpList, since Carbon does not update currentEvent).
13650
13651         Reviewed by Darin.
13652
13653         * kwq/KWQKHTMLPart.mm:
13654         (KWQKHTMLPart::passWidgetMouseDownEventToWidget):  Pass mouseup to khtml.
13655
13656 2003-01-28  Trey Matteson  <trey@apple.com>
13657
13658         2940179 - Arrow cursor should change to link cursor after click of link in non-frontmost window
13659
13660         3158238 - cursor shape does not track after double-click to activate a window
13661
13662         Reviewed by Darin.
13663
13664         * khtml/khtmlview.cpp:
13665         (KHTMLView::viewportMouseDoubleClickEvent):  We get this when the mouse
13666         goes up the second time, so clear d->mousePressed.
13667         * kwq/KWQKHTMLPart.mm:
13668         (KWQKHTMLPart::mouseMoved):  Pitch any mousemoved that comes through while
13669         we think the mouse is down.  Those screw up our tracking, like 3137661.  This is
13670         part of the 2940179 fix.
13671
13672 2003-01-27  Trey Matteson  <trey@apple.com>
13673
13674         3157146 REGRESSION: using a pop-up menu turns the cursor into an I-beam
13675
13676         A hack for the benefit of AK's PopUpButton, which uses the Carbon menu
13677         manager, which thus eats all subsequent events after it is starts its
13678         modal tracking loop.  After the interaction is done, we call a new routine
13679         to fix things up in the khtml event world.  We post a fake mouse up to balance
13680         the mouse down we started with.  In addition, we post a fake mouseMoved to get
13681         the cursor in sync with whatever we happen to be over after the tracking is done.
13682
13683         Reviewed by Darin.
13684
13685         * kwq/KWQComboBox.mm:
13686         (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
13687         Call part after NSPopUp's modal tracking consumes events.
13688         * kwq/KWQKHTMLPart.h:
13689         * kwq/KWQKHTMLPart.mm:
13690         (KWQKHTMLPart::doFakeMouseUpAfterWidgetTracking):  New routine to allow widgets
13691         to get out event state fixed up after a modal tracking loop.
13692
13693 2003-01-27  Chris Blumenberg  <cblu@apple.com>
13694
13695         Fixed: 3152053 - Safari: Java 141: Only visible applets are instantiated on web page
13696
13697         Reviewed by dave.
13698
13699         * khtml/rendering/render_applet.cpp:
13700         (RenderApplet::layout): move the widget before calling showApplet
13701         * kwq/KWQKJavaAppletWidget.mm:
13702         (KJavaAppletWidget::showApplet): add the java view to the main view immediately instead of waiting for first paint
13703         * kwq/WebCoreBridge.mm:
13704         (-[WebCoreBridge selectionImage]): tweak
13705
13706 2003-01-26  Maciej Stachowiak  <mjs@apple.com>
13707
13708         Reviewed by Darin.
13709
13710         - fixed 3156461 - SECURITY: contentDocument of iframe from other domain can be accessed
13711         - fixed 3156462 - SECURITY: can invoke setTimeout on other window
13712         - fixed 3156469 - SECURITY: can add an event listener on another protected window
13713         - fixed 3156527 - SECURITY: Can access HTML document from different domain in another frame
13714         - fixed 3156535 - SECURITY: Can access XML document from different domain in another frame
13715
13716         These fixes are merged from or inspired by security fixes in upstream khtml.
13717         
13718         * khtml/ecma/kjs_dom.h:
13719         * khtml/ecma/kjs_dom.cpp:
13720         (KJS::checkNodeSecurity): Prototype new method used to check whether a document
13721         is allowed to access the contents of a node.
13722         * khtml/ecma/kjs_html.cpp:
13723         (KJS::HTMLElement::getValueProperty): Apply security check to
13724         getting the contentDocument of an iframe or object.
13725         * khtml/ecma/kjs_window.cpp:
13726         (Window::get): Make sure addEventListener/removeEventListener, and
13727         all timer related functions are protocted from cross-domain calls.
13728         (WindowFunc::tryCall): Make sure this is true even if they are
13729         detached from one window and called on another.
13730         * khtml/khtml_part.cpp:
13731         (KHTMLPart::checkEmitLoadEvent): When setting frames to the domain
13732         of the parent document, don't force it, so the usual suffix check
13733         rule will apply.
13734
13735 2003-01-27  Richard Williamson   <rjw@apple.com>
13736
13737         Reviewed by trey.
13738
13739         Added ASSERT trap to help track down non-repro crash reported
13740         by 3144546.
13741         
13742         * kwq/KWQKHTMLPart.mm:
13743         (KWQKHTMLPart::openURLFromPageCache):
13744         
13745         Remove assert that caused 3155781.  We believe this was happening
13746         because of a delayed release of the page cache after emptying cache
13747         from "Empty Cache" menu item.
13748         
13749         * kwq/KWQPageState.mm:
13750         (-[KWQPageState dealloc]):
13751
13752 2003-01-27  David Hyatt  <hyatt@apple.com>
13753
13754         Fix text dragging so that text inside floats paints when you
13755         drag the selection.
13756         
13757         Reviewed by cblu
13758
13759         * ChangeLog:
13760         * khtml/rendering/render_flow.cpp:
13761         (RenderFlow::paintObject):
13762         (RenderFlow::paintFloats):
13763         * khtml/rendering/render_flow.h:
13764
13765 2003-01-26  David Hyatt  <hyatt@apple.com>
13766
13767         Fix the default font size settings for monospace fonts to
13768         really work.  It was overaggressive and kicking in when it
13769         shouldn't have, resulting in failures on the CSS1 test suite.
13770         
13771         Reviewed by darin, john
13772
13773         * khtml/css/cssstyleselector.cpp:
13774         * khtml/css/cssstyleselector.h:
13775         * khtml/rendering/font.h:
13776
13777 2003-01-26  Chris Blumenberg  <cblu@apple.com>
13778         
13779         Fixed: 3156725 - Partially selected links show extra underlining when dragged
13780         Fixed: 3156962 - Text drag image sometimes doesn't include last selected text node
13781
13782         Reviewed by darin.
13783
13784         * khtml/rendering/render_root.cpp:
13785         (RenderRoot::selectionRect): include all nodes that are selected
13786         * khtml/rendering/render_text.cpp:
13787         (TextSlave::paintDecoration): removed stray ";"
13788         (RenderText::paintObject): call paintDecoration with default parameters for "from" and "to" when not painting the selection only
13789         * khtml/rendering/render_text.h:
13790
13791 2003-01-26  Darin Adler  <darin@apple.com>
13792
13793         Reviewed by Maciej.
13794
13795         - fixed 3126431 -- failed assertion `!attached()' at silkair.net
13796
13797         * khtml/rendering/render_image.h: Fix isImage which for some strange reason was
13798         returning false. Not important because no one calls it. Added dispatchLoadEvent
13799         and detach member functions.
13800         * khtml/rendering/render_image.cpp:
13801         (RenderImage::notifyFinished): Instead of dispatching the load or error event
13802         immediately, call dispatchImageLoadEventSoon on the document.
13803         (RenderImage::dispatchLoadEvent): Added. Moved the code to do the actual
13804         event dispatch in here.
13805         (RenderImage::detach): Remove the image from the document in case it has a
13806         pending event that was not delivered yet before calling the base class detach.
13807
13808         * khtml/xml/dom_docimpl.h: Add dispatchImageLoadEventSoon, dispatchImageLoadEventsNow,
13809         removeImage, and an override of timerEvent. Moved APPLE_CHANGES code to a better place.
13810         * khtml/xml/dom_docimpl.cpp: Moved APPLE_CHANGES code to a better place and made these changes:
13811         (DocumentImpl::DocumentImpl): Initialize m_imageLoadEventTimer to 0.
13812         (DocumentImpl::detach): Redo the APPLE_CHANGES to make them easier to read.
13813         Empty out the m_imageLoadEventDispatchSoonList and the m_imageLoadEventDispatchingList
13814         to avoid an O(n^2) operation as we detach each image and remove it from the list.
13815         (DocumentImpl::dispatchImageLoadEventSoon): Added. Adds image to list and sets up timer.
13816         (DocumentImpl::removeImage): Added. Removes image from lists, and cancels timer if needed.
13817         (DocumentImpl::dispatchImageLoadEventsNow): Added. Copies list, and call images to dispatch load events.
13818         (DocumentImpl::timerEvent): Added. Calls dispatchImageLoadEventsNow.
13819
13820         * khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::close):
13821         Dispatch all pending image load events before dispatching the document load.
13822
13823         * force-clean-timestamp: Force rebuild because Project Builder doesn't do
13824         header dependencies well enough to deal with changes to the document class.
13825
13826 2003-01-26  David Hyatt  <hyatt@apple.com>
13827
13828         Fix :active to behave just like :hover.  It was being
13829         restricted and only allowed to match <a> tags, when :active
13830         should be applicable to any element (e.g., like images).
13831
13832         Fixes the :active feedback on numerous blog sites (e.g.,
13833         the photo image buttons on joehewitt.com).
13834         
13835         Reviewed by gramps
13836
13837         * khtml/css/cssstyleselector.cpp:
13838
13839 2003-01-25  Darin Adler  <darin@apple.com>
13840
13841         Reviewed by Maciej.
13842
13843         - fixed 3126211 -- "go back" buttons that use "history.go(-1)" doesn't work (verizonwireless.com is an example)
13844         - fixed 2950618 -- JavaScript window.history object name prints blank
13845
13846         * khtml/ecma/kjs_window.cpp:
13847         (FrameArray::toString): Added. Returns "[object FrameArray]".
13848         (History::getValueProperty): Removed #if APPLE_CHANGES to turn more code on.
13849         (History::toString): Added. Returns "[object History]".
13850
13851         * kwq/KWQKPartsBrowserExtension.h: Make browserInterface a pure virtual function
13852         instead of always returning 0.
13853         * kwq/KWQKHTMLPartBrowserExtension.h: Added browserInterface() function.
13854         Also replaced m_part with a _part that is a KWQKHTMLPart to simplify code.
13855         * kwq/KWQKHTMLPartBrowserExtension.mm:
13856         (KHTMLPartBrowserExtension::KHTMLPartBrowserExtension): Create the browser
13857         interface object when the browser extension object is created.
13858         (KHTMLPartBrowserExtension::openURLRequest): Use _part instead of KWQ(m_part).
13859         (KHTMLPartBrowserExtension::createNewWindow): Use _part instead of KWQ(m_part).
13860         (KHTMLPartBrowserExtension::setIconURL): Use _part instead of KWQ(m_part).
13861         (KHTMLPartBrowserExtension::setTypedIconURL): Use _part instead of KWQ(m_part).
13862
13863         * kwq/KWQKPartsBrowserInterface.h: Add a constructor, property() function, and
13864         _part data member.
13865         * kwq/KWQKPartsBrowserInterface.mm:
13866         (BrowserInterface::property): Added. Handles historyLength property by calling
13867         the historyLength method on the bridge.
13868         (BrowserInterface::callMethod): Handles goHistory(int) by calling the
13869         goBackOrForward: method on the bridge.
13870
13871         * kwq/WebCoreBridge.h: Added historyLength and goBackOrForward: methods.
13872
13873         * kwq/KWQVariant.h: Added Int to the variant enum, added int and uint contructors,
13874         and added toInt() member function.
13875         * kwq/KWQVariant.mm:
13876         (QVariant::QVariant): Implemented int and uint constructors.
13877         (QVariant::toBool): Added Int case, sorted alphabetically.
13878         (QVariant::toInt): Added.
13879         (QVariant::toUInt): Added Int case, sorted alphabetically.
13880         (QVariant::asString): Added Int case, sorted alphabetically.
13881
13882 2003-01-25  Chris Blumenberg  <cblu@apple.com>
13883
13884         Fixed: 3153605 - Drag image when dragging text should be the actual text
13885
13886         Reviewed by darin.
13887
13888         * khtml/rendering/font.cpp:
13889         (Font::drawLineForText): take a "from" and "to" so only selected portions of text draw lines
13890         * khtml/rendering/font.h:
13891         * khtml/rendering/render_layer.cpp:
13892         (RenderLayer::paint): handle the selection-only case
13893         * khtml/rendering/render_layer.h:
13894         * khtml/rendering/render_root.cpp:
13895         (RenderRoot::selectionRect): new, computes bounding box of the selection
13896         * khtml/rendering/render_root.h:
13897         * khtml/rendering/render_text.cpp:
13898         (TextSlave::paintDecoration): take a "from" and "to" so only selected portions of text draw lines
13899         (RenderText::paintObject): when only drawing the selection, only draw selected text and no selection background
13900         (RenderText::paint): handle the selection-only case
13901         * khtml/rendering/render_text.h:
13902         * kwq/KWQKHTMLPart.h:
13903         * kwq/KWQKHTMLPart.mm:
13904         (KWQKHTMLPart::paint): handle the selection-only case
13905         (KWQKHTMLPart::selectionRect): new, returns the bounding box of the selection
13906         * kwq/KWQPainter.h:
13907         * kwq/KWQPainter.mm:
13908         (QPainter::drawLineForText): take a "from" and "to" so only selected portions of text draw lines
13909         * kwq/WebCoreBridge.h:
13910         * kwq/WebCoreBridge.mm:
13911         (-[WebCoreBridge drawRect:withPainter:]): handle the selection-only case
13912         (-[WebCoreBridge selectionRect]): new, returns the bounding box of the selection clipped to visible 
13913         (-[WebCoreBridge selectionImage]): new, returns the image of the selection
13914
13915 2003-01-24  David Hyatt  <hyatt@apple.com>
13916
13917         Fix for 3153260, tables used as height spacers don't get the
13918         specified height.
13919         
13920         Reviewed by rjw
13921
13922         * khtml/rendering/render_table.cpp:
13923         (RenderTableSection::layoutRows):
13924
13925 2003-01-24  Trey Matteson  <trey@apple.com>
13926
13927         Chris pointed out a FIXME that led to a more contained way to make sure the cursor
13928         is correct during and after image/text/URL dragging.
13929
13930         Reviewed by Chris.
13931
13932         * kwq/KWQKHTMLPart.h: Back out just-added resetCursor method.
13933         * kwq/KWQKHTMLPart.mm:
13934         (KWQKHTMLPart::khtmlMouseMoveEvent):  Reset cursor to arrow when image drag starts.
13935         * kwq/WebCoreBridge.h:
13936         * kwq/WebCoreBridge.mm:  Back out just-added resetCursor method, which is no
13937         longer needed by WebKit.
13938
13939 2003-01-24  Darin Adler  <darin@apple.com>
13940
13941         Reviewed by Maciej.
13942
13943         - fixed 3058229 -- two failures in DOM test page for HTMLSelectElement
13944         - fixed 3138938 -- choose another member name on .Mac signup not working as expected
13945         - fixed 3155763 -- Safari autoselects first item in a WOBrowser/<select>
13946
13947         * khtml/html/html_formimpl.cpp:
13948         (HTMLSelectElementImpl::value): Return "" rather than null when nothing is selected.
13949         (HTMLSelectElementImpl::recalcListItems): Don't automatically select a first item
13950         in the single selection case.
13951
13952 2003-01-24  David Hyatt  <hyatt@apple.com>
13953
13954         Fix for 3146066, messed up lists on dictionary.com.  Make
13955         sure that a marker in an anonymous box with no other line box
13956         parent available just stays where it is, rather than removing
13957         itself from the anonymous box (causing that box to be deleted
13958         and recreated ad infinitum).
13959         
13960         Reviewed by darin
13961
13962         * khtml/rendering/render_list.cpp:
13963         (RenderListItem::updateMarkerLocation):
13964
13965 2003-01-24  Darin Adler  <darin@apple.com>
13966
13967         Reviewed by Dave.
13968
13969         - fixed 3142852 -- frame content repeatedly requested
13970
13971         The bug was that JavaScript document.referrer was totally wrong.
13972
13973         * khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::referrer):
13974         Use the new incomingReferrer() rather than referrer(), because referrer()
13975         is the referrer to use for new loads in the part, not the one that was
13976         used to load the document.
13977
13978         * kwq/KWQKHTMLPart.h: Added incomingReferrer(). Also removed referrer()
13979         which has been totally redundant since we made KWQKHTMLPart a subclass of KHTMLPart.
13980         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::incomingReferrer): Added. Uses the bridge.
13981
13982         * kwq/WebCoreBridge.h: Added incomingReferrer.
13983
13984 2003-01-24  Trey Matteson  <trey@apple.com>
13985
13986         3155162 - cursor changes to I-beam after dragging image 
13987         3154468 - no mouseup event comes through after text snippet drag
13988
13989         Export a means to reset the cursor to WebKit, which is used to fix these bugs.
13990
13991         Reviewed by Darin.
13992
13993         * kwq/KWQKHTMLPart.h:
13994         * kwq/KWQKHTMLPart.mm:
13995         (KWQKHTMLPart::resetCursor):  New method that just calls through to khtmlview's
13996         private resetCursor method.
13997         * kwq/WebCoreBridge.h:  Add new method.
13998         * kwq/WebCoreBridge.mm:
13999         (-[WebCoreBridge resetCursor]):  Call view's reset cursor.
14000
14001 2003-01-23  Trey Matteson  <trey@apple.com>
14002
14003         I ran our KURL tests and found that my previous fix for "localhost" urls, fixed too much.
14004         This now passes all the tests.
14005
14006         Reviewed by Darin.
14007
14008         * kwq/KWQKURL.mm:
14009         (KURL::parse):  Use different logic for deciding to add //authority to the URL
14010         and stripping localhost off of file URLs.
14011
14012 2003-01-24  Darin Adler  <darin@apple.com>
14013
14014         Reviewed by John.
14015
14016         - fixed null view and hang part of 3153612 -- REGRESSION: null view and hang loading cycleworld.com
14017
14018         * khtml/xml/xml_tokenizer.cpp: (XMLHandler::XMLHandler): Initialize the line number
14019         to 0 so we can detect the case where we didn't get a fatal error callback.
14020         (XMLTokenizer::finish): Construct an error page without an XML excerpt if the line
14021         number if 0.
14022
14023 2003-01-24  Darin Adler  <darin@apple.com>
14024
14025         Reviewed by John.
14026
14027         - fixed 3140945 -- crash viewing www.nextthing.org
14028
14029         * khtml/rendering/render_container.cpp: (RenderContainer::removeLeftoverAnonymousBoxes):
14030         Change this function so it will never remove a table cell. Although a table cell that is
14031         created automatically is anonymous, it is not an anonymous box in the sense that this
14032         function is trying to deal with. Maybe there will be a better way to fix this some day,
14033         but this is the best Dave and I could come up with.
14034
14035         - fixed 3155700 -- nil-dereference in khtml::RenderTableRow::detach shortly after visiting www.alltheweb.com
14036
14037         * khtml/rendering/render_table.cpp: (RenderTableRow::detach):
14038         Check for nil before calling setNeedCellRecalc in case we are being detached after our
14039         parent is already nil.
14040
14041 2003-01-23  Richard Williamson   <rjw@apple.com>
14042
14043         Fix for 3152494.  Set the default iframe width to 300 and
14044         height to 150.  This copies the behavior of mozilla and IE.
14045         
14046         Reviewed by hyatt.
14047
14048         * khtml/css/html4.css:
14049
14050 2003-01-23  Richard Williamson   <rjw@apple.com>
14051
14052         Fixed whitespace exclusion code.  Fixes many sites
14053         that have problems that were exposed after
14054         fixing 3119777.
14055         
14056         Reviewed by hyatt.
14057
14058         * khtml/rendering/bidi.cpp:
14059         (RenderFlow::bidiReorderLine):
14060         (RenderFlow::findNextLineBreak):
14061         * khtml/rendering/break_lines.cpp:
14062         * khtml/rendering/render_text.cpp:
14063         (RenderText::calcMinMaxWidth):
14064
14065 2003-01-23  David Hyatt  <hyatt@apple.com>
14066
14067         Dump textslaves in the regression tests.
14068         
14069         Reviewed by rjw.
14070
14071         * kwq/KWQRenderTreeDebug.cpp:
14072         (operator<<):
14073         (write):
14074
14075 2003-01-23  David Hyatt  <hyatt@apple.com>
14076
14077         Fix for 3144763, inlines clear too many floats, and jump all the
14078         way to the end of the lowest float instead of only moving as far
14079         down as they have to in order to fit.
14080         
14081         Reviewed by darin
14082
14083         * khtml/rendering/bidi.cpp:
14084         (RenderFlow::findNextLineBreak):
14085         * khtml/rendering/render_flow.cpp:
14086         (RenderFlow::nearestFloatBottom):
14087         * khtml/rendering/render_flow.h:
14088
14089 2003-01-23  Darin Adler  <darin@apple.com>
14090
14091         Reviewed by John.
14092
14093         - fixed 3144560 -- non-reproducible nil-dereference in HTMLFrameElementImpl::updateForNewURL at macfixit
14094
14095         * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::updateForNewURL): Add check for nil view.
14096
14097 2003-01-23  Darin Adler  <darin@apple.com>
14098
14099         Reviewed by John.
14100
14101         - fixed 3154647 -- Triple clicked on a line of text (to select entire line), crashola
14102
14103         * khtml/khtml_part.cpp:
14104         (firstSlaveAt): Loop instead of using recursion for siblings.
14105         (lastSlaveAt): Ditto, only backwards.
14106
14107 2003-01-23  David Hyatt  <hyatt@apple.com>
14108
14109         Fix for 3142124.  
14110
14111         When pseudo-elements have display:none, they should not generate
14112         rendering objects.
14113         
14114         Reviewed by rjw, kocienda.
14115
14116         * khtml/rendering/render_container.cpp:
14117         (RenderContainer::insertPseudoChild):
14118
14119 2003-01-23  Darin Adler  <darin@apple.com>
14120
14121         Reviewed by Maciej.
14122
14123         - fixed 3129556 -- can't search on japanese string at yahoo.co.jp
14124
14125         The key to fixing this was to look up character sets in a way that does not
14126         pay attention to punctuation. Only alphanumeric characters count. Also did
14127         a little belt tightening and speeding up while I was at it.
14128
14129         * kwq/KWQCharsets.h: Use const char * instead of CFStringRef.
14130         * kwq/KWQCharsets.mm:
14131         (buildDictionaries): Store const char * in the dictionaries instead of CFStringRef,
14132         and use the key compare and hash functions that obey only alphanumeric characters.
14133         (KWQCFStringEncodingFromIANACharsetName): Use const char * directly.
14134         (KWQCFStringEncodingFromMIB): Tweak code a bit.
14135         (KWQCFStringEncodingToIANACharsetName): Use const char * directly.
14136         (KWQCFStringEncodingToMIB): Tweak code a bit.
14137         (encodingNamesEqual): Added. Compares two names, ignoring non-alphanumeric characters.
14138         (encodingNameHash): Added.
14139
14140         * kwq/KWQKCharsets.h: Take a const char * instead of a QString. Also overload for QCString.
14141         This fixes conversion back and forth from QString that was happening before.
14142         * kwq/KWQKCharsets.mm: (KCharsets::codecForName): Update for above parameter change.
14143
14144         * kwq/KWQTextCodec.mm:
14145         (codecForCFStringEncoding): Add check for kCFStringEncodingInvalidId.
14146         (QTextCodec::codecForMib): Simplify because of above check.
14147         (QTextCodec::codecForName): Simplify because we don't need to make a CFStringRef, and
14148         because of above check.
14149         (QTextCodec::name): No need to convert the CFStringRef back to a const char * now.
14150
14151         * kwq/WebCoreBridge.mm:
14152         (-[WebCoreBridge textEncoding]): Convert character set name to a const char * to pass in.
14153         (+[WebCoreBridge stringWithData:textEncodingName:]): Ditto.
14154         * kwq/WebCoreEncodings.mm:
14155         (+[WebCoreEncodings charsetNameForEncoding:]): Convert character set name to an NSString
14156         to use as a return value.
14157         (+[WebCoreEncodings encodingForCharsetName:]): Convert character set name to a const char *
14158         to pass in.
14159
14160 2003-01-23  Chris Blumenberg  <cblu@apple.com>
14161         
14162         Fixed a divide by zero problem.
14163
14164         Reviewed by darin.
14165
14166         * WebCore.pbproj/project.pbxproj:
14167         * khtml/rendering/render_image.cpp:
14168         (RenderImage::calcReplacedWidth):
14169         (RenderImage::calcReplacedHeight):
14170
14171 2003-01-23  Maciej Stachowiak  <mjs@apple.com>
14172
14173         Reviewed by Darin.
14174
14175         - fixed last minute screwup in my last patch fixing onchange
14176         
14177         * kwq/KWQTextField.mm:
14178         (-[KWQTextField fieldEditorWillBecomeFirstResponder]): Renamed
14179         from fieldWillBecomeFirstResponder.
14180         (-[KWQTextField fieldEditorWillResignFirstResponder]): Renamed
14181         from fieldWillResignFirstResponder.
14182
14183 2003-01-23  Maciej Stachowiak  <mjs@apple.com>
14184
14185         Reviewed by Trey.
14186
14187         - fixed 3151442 - mac.com homepage editing - selection and clicking with mouse don't work
14188         
14189         * khtml/ecma/kjs_events.cpp:
14190         (JSEventListener::handleEvent): Only allow a false return value to
14191         prevent default if this is an html event handler, rather than one
14192         set with addEventListener or the like.
14193
14194 2003-01-23  Chris Blumenberg  <cblu@apple.com>
14195
14196         Replaced the paint phase constants with the PaintAction enum. Added PaintActionSelection as a paint action. This will eventually allow us to only paint selected objects. This is needed for the text dragging image.
14197
14198         Reviewed by dave.
14199
14200         * khtml/rendering/render_box.cpp:
14201         (RenderBox::paint):
14202         * khtml/rendering/render_box.h:
14203         * khtml/rendering/render_flow.cpp:
14204         (RenderFlow::paint):
14205         (RenderFlow::paintObject):
14206         (RenderFlow::paintFloats):
14207         * khtml/rendering/render_flow.h:
14208         * khtml/rendering/render_html.cpp:
14209         (RenderHtml::paint):
14210         * khtml/rendering/render_html.h:
14211         * khtml/rendering/render_image.cpp:
14212         (RenderImage::paintObject):
14213         * khtml/rendering/render_image.h:
14214         * khtml/rendering/render_layer.cpp:
14215         (RenderLayer::paint):
14216         * khtml/rendering/render_list.cpp:
14217         (RenderListItem::paint):
14218         (RenderListItem::paintObject):
14219         (RenderListMarker::paint):
14220         (RenderListMarker::paintObject):
14221         * khtml/rendering/render_list.h:
14222         * khtml/rendering/render_object.cpp:
14223         (RenderObject::paint):
14224         * khtml/rendering/render_object.h:
14225         * khtml/rendering/render_replaced.cpp:
14226         (RenderReplaced::paint):
14227         (RenderWidget::paintObject):
14228         * khtml/rendering/render_replaced.h:
14229         * khtml/rendering/render_root.cpp:
14230         (RenderRoot::paint):
14231         (RenderRoot::paintObject):
14232         * khtml/rendering/render_root.h:
14233         * khtml/rendering/render_table.cpp:
14234         (RenderTable::paint):
14235         (RenderTableSection::paint):
14236         (RenderTableCell::paint):
14237         * khtml/rendering/render_table.h:
14238         * khtml/rendering/render_text.cpp:
14239         (RenderText::paintObject):
14240         (RenderText::paint):
14241         * khtml/rendering/render_text.h:
14242
14243 2003-01-23  David Hyatt  <hyatt@apple.com>
14244
14245         Fix for 3147995, empty <li> tags don't render bullets.
14246         
14247         Reviewed by john.
14248
14249         * khtml/rendering/render_list.cpp:
14250         (RenderListItem::layout):
14251         * khtml/rendering/render_list.h:
14252
14253 2003-01-23  David Hyatt  <hyatt@apple.com>
14254
14255         Fix for 3134613, bullets overlapping text on weather.com.  Make
14256         sure min/max widths get updated when the marker moves around.
14257         
14258         Reviewed by john
14259
14260         * khtml/rendering/render_list.cpp:
14261         (RenderListItem::updateMarkerLocation):
14262         (RenderListItem::calcMinMaxWidth):
14263         (RenderListItem::layout):
14264         * khtml/rendering/render_list.h:
14265
14266 === Safari-54 ===
14267
14268 2003-01-23  Darin Adler  <darin@apple.com>
14269
14270         Reviewed by Dave.
14271
14272         - fixed 3154575 -- REGRESSION: Right sidebar on Yahoo! page in base PLT renders incorrectly
14273
14274         * khtml/rendering/break_lines.cpp: (isBreakable): Pass kUCTextBreakLineMask to the
14275         UC calls, which looks for places where line breaks are allowed, instead of kUCTextBreakWordMask,
14276         which finds all word breaks instead. We still pass all the layout tests, so I think this means
14277         Japanese word breaking is still OK.
14278
14279         - fixed 3154416 -- images that specify width but not height should keep aspect ratio (example at thegods.org.uk)
14280
14281         * khtml/rendering/render_image.h: Declared new member functions.
14282         * khtml/rendering/render_image.cpp:
14283         (RenderImage::widthSpecified): Added helper function.
14284         (RenderImage::heightSpecified): Added helper function.
14285         (RenderImage::calcReplacedWidth): Added. Derives width from height keeping aspect ratio if we
14286         have a specified height and no width.
14287         (RenderImage::calcReplacedHeight): Added. Same thing in the opposite direction.
14288
14289 2003-01-22  Trey Matteson  <trey@apple.com>
14290
14291         3153313 cursor changes during text selection when we cross links
14292
14293         Reviewed by Dave.
14294
14295         * khtml/khtmlview.cpp:
14296         (KHTMLView::viewportMousePressEvent):  Remember mouse is down.
14297         (KHTMLView::viewportMouseMoveEvent):  Use ibeam while mouse down.
14298         (KHTMLView::viewportMouseReleaseEvent):  Remember that it's up.
14299
14300 2003-01-22  David Hyatt  <hyatt@apple.com>
14301
14302         Fix first-line regression caused by my removal of a local variable.
14303         
14304         Reviewed by mjs
14305
14306         * khtml/css/cssstyleselector.cpp:
14307
14308 2003-01-22  Richard Williamson   <rjw@apple.com>
14309
14310         Fix the fix to 3119777 to scan for break over entire string
14311         instead of trying to optimize.
14312         
14313         Reviewed by hyatt.
14314
14315         * khtml/rendering/break_lines.cpp:
14316         Pass offset into entire string, rather than try to optimize
14317         by passing a shorter string.
14318
14319 2003-01-22  David Hyatt  <hyatt@apple.com>
14320
14321         Fix the CSS parser so that it disallows class names beginning
14322         with a digit even in quirks mode.
14323         
14324         Reviewed by rjw
14325
14326         * khtml/css/cssparser.cpp:
14327         (StyleBaseImpl::parseSelector2):
14328
14329 2003-01-22  Richard Williamson   <rjw@apple.com>
14330
14331         Fix 3119777 (and a host of other international bugs).  Word break
14332         was broken.  Use unicode services to detect work breaks
14333         for non basic latin1.  We may want to go further and
14334         always use unicode services so we get correct hyphenation
14335         breaking.
14336         
14337         Reviewed by hyatt.
14338
14339         * khtml/rendering/break_lines.cpp:
14340
14341 2003-01-22  David Hyatt  <hyatt@apple.com>
14342
14343         Fix word-spacing bugs in text measurement calculations.  This
14344         fixes our issues on the CSS1 test suite.  Regression tests have
14345         been added for both positive and negative word-spacing.
14346         
14347         Reviewed by rjw
14348
14349         * khtml/rendering/bidi.cpp:
14350         (RenderFlow::findNextLineBreak):
14351         * khtml/rendering/render_text.cpp:
14352         (RenderText::calcMinMaxWidth):
14353         (RenderText::containsOnlyWhitespace):
14354         * khtml/rendering/render_text.h:
14355
14356 2003-01-22  Chris Blumenberg  <cblu@apple.com>
14357
14358         Fixed: 3153969 - Should not be able drag text while double or triple-click selecting it
14359         Fixed: 3154153 - Can drag an empty selection
14360
14361         Reviewed by rjw.
14362
14363         * khtml/khtml_part.cpp:
14364         (KHTMLPart::isPointInsideSelection): consider an empty selection like no selection
14365         * kwq/KWQKHTMLPart.mm:
14366         (KWQKHTMLPart::khtmlMouseMoveEvent): don't allow dragging after selection has started using double or triple click
14367
14368 2003-01-22  David Hyatt  <hyatt@apple.com>
14369
14370         Fix absolute positioning problem for bottom-positioned elements.  
14371         This is a fix from the KHTML trunk.
14372         
14373         Reviewed by john
14374
14375         * khtml/rendering/render_box.cpp:
14376         (RenderBox::calcAbsoluteVertical):
14377
14378 2003-01-22  Darin Adler  <darin@apple.com>
14379
14380         Reviewed by Maciej.
14381
14382         - fixed 3141566 -- non-reproducible nil-dereference in HTMLGenericFormElementImpl at firstdirect.com
14383
14384         * khtml/html/html_formimpl.cpp: (HTMLGenericFormElementImpl::defaultEventHandler):
14385         Check for the case where the view is 0.
14386
14387 2003-01-22  Darin Adler  <darin@apple.com>
14388
14389         Reviewed by Maciej.
14390
14391         - fixed two-day-old regression where we get nil-dereferences with text areas
14392
14393         * kwq/KWQTextArea.mm:
14394         (-[KWQTextArea _createTextView]): Don't do the setWidget: here because widget is always nil at this point.
14395         (-[KWQTextArea initWithQTextEdit:]): Do it here instead.
14396
14397 2003-01-22  David Hyatt  <hyatt@apple.com>
14398
14399         Fix for 3126927, don't let absolute positioned blocks grow
14400         to accommodate content.  They overflow instead.
14401         
14402         Reviewed by mjs
14403
14404         * khtml/rendering/render_box.cpp:
14405         (RenderBox::calcAbsoluteVertical):
14406         * khtml/rendering/render_flow.h:
14407         * khtml/rendering/render_object.h:
14408
14409 2003-01-22  David Hyatt  <hyatt@apple.com>
14410
14411         Fix for 3153316, selection busted on google.com.  For now keep
14412         mouse events grabbing the absolutePosition of elements, and don't
14413         ever let them grab the absolutePosition of text nodes.
14414         
14415         Reviewed by john.
14416
14417         * khtml/khtml_events.cpp:
14418         (khtml::MouseEvent::MouseEvent):
14419         
14420 2003-01-22  Chris Blumenberg  <cblu@apple.com>
14421
14422         Renamed isPointSelected to isPointInsideSelection because it's a better name.
14423
14424         Reviewed by darin.
14425
14426         * khtml/khtml_part.cpp:
14427         (KHTMLPart::isPointInsideSelection): 
14428         (KHTMLPart::khtmlMousePressEvent):
14429         * khtml/khtml_part.h:
14430         * kwq/WebCoreBridge.mm:
14431         (-[WebCoreBridge elementAtPoint:]):
14432
14433 2003-01-21  Chris Blumenberg  <cblu@apple.com>
14434
14435         Added support for text dragging.
14436
14437         Reviewed by dave.
14438
14439         * khtml/khtml_events.cpp:
14440         (khtml::MouseEvent::offset): made checkSelectionPoint take x,y coords, passing the whole event is unnecessary
14441         * khtml/khtml_part.cpp:
14442         (KHTMLPart::isPointSelected): new
14443         (KHTMLPart::khtmlMousePressEvent): don't restart the selection when click was on the selection
14444         (KHTMLPart::khtmlMouseMoveEvent): restart the selection since we may not do it in khtmlMousePressEvent
14445         (KHTMLPart::khtmlMouseReleaseEvent): clear the selection if no selection took place
14446         * khtml/khtml_part.h:
14447         * khtml/khtmlpart_p.h:
14448         * khtml/rendering/render_object.cpp:
14449         (RenderObject::checkSelectionPoint): made checkSelectionPoint take x,y coords, passing the whole event is unnecessary
14450         * khtml/rendering/render_object.h:
14451         * khtml/rendering/render_text.cpp:
14452         (RenderText::checkSelectionPoint): made checkSelectionPoint take x,y coords, passing the whole event is unnecessary
14453         * khtml/rendering/render_text.h:
14454         * kwq/KWQKHTMLPart.mm:
14455         (KWQKHTMLPart::khtmlMousePressEvent): set booleans indicating that it is OK to drag or select
14456         (KWQKHTMLPart::khtmlMouseMoveEvent): ask WebKit if we can drag. Make this decision here instead of in khtmlMousePressEvent because WebKit needs the drag hysteresis to make the decision. 
14457         * kwq/WebCoreBridge.h:
14458         * kwq/WebCoreBridge.mm:
14459         (-[WebCoreBridge elementAtPoint:]): set the selection bit
14460
14461 2003-01-21  Trey Matteson  <trey@apple.com>
14462
14463         3032718 - I-beam cursor behavior different between web view and text view
14464
14465         Now that the innerNode is the real text element instead of an enclosing
14466         tag element, it's a piece of cake to test for a text node and set the ibeam cursor.
14467
14468         Reviewed by Chris
14469
14470         * khtml/khtmlview.cpp:
14471         (KHTMLView::viewportMouseMoveEvent):  Set iBeam if over text.
14472         * kwq/KWQKCursor.mm:
14473         (KCursor::ibeamCursor):  Make this cursor have the Cocoa ibeam instead of arrow.
14474
14475 2003-01-21  David Hyatt  <hyatt@apple.com>
14476
14477         Fix selection so that it will go up to the parent node
14478         if the innerNode is text, preserving the old behavior for
14479         now until we can rewrite selection to not require this.
14480         
14481         Reviewed by cblu.
14482
14483         * khtml/khtml_events.cpp:
14484         (khtml::MouseEvent::offset):
14485         * khtml/khtml_part.cpp:
14486         (KHTMLPart::khtmlMousePressEvent):
14487         (KHTMLPart::khtmlMouseMoveEvent):
14488
14489 2003-01-21  Trey Matteson  <trey@apple.com>
14490
14491         3121681 - "localhost" part of link is lost with relative links
14492
14493         Was broken for abs links with localhost too.  Solution is to tighten up the test
14494         for "localhost" removal to only apply to file urls.
14495         canonical result.
14496
14497         Reviewed by Maciej.
14498
14499         * kwq/KWQKURL.mm:
14500         (KURL::parse):  Allow the authority processing even for links with
14501         localhost.  Only cut out the addition of host for locahost file links.
14502
14503 2003-01-21  David Hyatt  <hyatt@apple.com>
14504
14505         Fix nodeAtPoint to return text nodes if the mouse is over them.
14506         Make :active fully hierarchical so that e.g., <a><b>Foo</b></a>
14507         gets an outline when clicked.
14508         
14509         Reviewed by trey
14510
14511         * khtml/rendering/render_object.cpp:
14512         (RenderObject::setHoverAndActive):
14513         * khtml/rendering/render_text.cpp:
14514         (RenderText::nodeAtPoint):
14515
14516 2003-01-21  David Hyatt  <hyatt@apple.com>
14517
14518         Fix for regressions on layout-tests caused by new table code.
14519         Make sure cell's padding is used and not just the table's cellpadding.
14520
14521         Also make sure cell padding can be changed dynamically.
14522         
14523         Reviewed by darin.
14524
14525         * khtml/rendering/table_layout.cpp:
14526         (AutoTableLayout::recalcColumn):
14527
14528 2003-01-21  Darin Adler  <darin@apple.com>
14529
14530         - correct our copyrights to 2003; copyright is based on year of publication, not year worked on
14531
14532 2003-01-21  David Hyatt  <hyatt@apple.com>
14533
14534         Fix for the 2.5% perf regression from the descendant rules
14535         changes.  This patch does 3 things:
14536         (1) Fix the descendant rule check in the CSS parser. It
14537         was incorrect.
14538         (2) Fix DOM insertion/removal from setting the parent as needing
14539         a style re-resolve.
14540         (3) Fix whitespace inside <html> so that it doesn't make a premature
14541         <body>.
14542         
14543         Reviewed by mjs
14544
14545         * khtml/css/cssparser.cpp:
14546         (StyleBaseImpl::parseSelector):
14547         * khtml/html/htmlparser.cpp:
14548         (KHTMLParser::insertNode):
14549         * khtml/xml/dom_elementimpl.cpp:
14550         (ElementImpl::recalcStyle):
14551         * khtml/xml/dom_nodeimpl.cpp:
14552         (NodeBaseImpl::insertBefore):
14553         (NodeBaseImpl::replaceChild):
14554         (NodeBaseImpl::removeChild):
14555         (NodeBaseImpl::appendChild):
14556
14557 2003-01-21  Darin Adler  <darin@apple.com>
14558
14559         Reviewed by Richard.
14560
14561         - clean room rewrite of QCString
14562
14563         * kwq/KWQCString.mm: Replaced functions that needed rewrite.
14564
14565 2003-01-21  Richard Williamson   <rjw@apple.com>
14566
14567         Added support to pause and resume javascript timers.  This allows pages 
14568         that have javascript timers to be added to the page cache.
14569         
14570         Fixes 3126138.
14571         
14572         Reviewed by trey and maciej.
14573
14574         * khtml/ecma/kjs_window.cpp:
14575         (Window::pauseTimeouts):
14576         (Window::resumeTimeouts):
14577         (WindowQObject::pauseTimeouts):
14578         (WindowQObject::resumeTimeouts):
14579         (WindowQObject::timerEvent):
14580         * khtml/ecma/kjs_window.h:
14581         * kwq/KWQKHTMLPart.h:
14582         * kwq/KWQKHTMLPart.mm:
14583         (KWQKHTMLPart::pauseActions):
14584         (KWQKHTMLPart::resumeActions):
14585         (KWQKHTMLPart::canCachePage):
14586         (KWQKHTMLPart::openURLFromPageCache):
14587         * kwq/KWQObject.h:
14588         * kwq/KWQObject.mm:
14589         (QObject::pauseTimer):
14590         (QObject::_addTimer):
14591         (QObject::clearPausedTimers):
14592         (QObject::resumeTimers):
14593         (QObject::startTimer):
14594         * kwq/KWQPageState.h:
14595         * kwq/KWQPageState.mm:
14596         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
14597         (-[KWQPageState setPausedActions:int::]):
14598         (-[KWQPageState int::]):
14599         (-[KWQPageState _cleanupPausedActions]):
14600         (-[KWQPageState invalidate]):
14601         (-[KWQPageState dealloc]):
14602         * kwq/WebCoreBridge.mm:
14603         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
14604         (-[WebCoreBridge saveDocumentToPageCache]):
14605
14606 2003-01-21  Darin Adler  <darin@apple.com>
14607
14608         * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::createRenderer):
14609         Add return statements to fix compile on deployment build.
14610
14611 2003-01-21  Darin Adler  <darin@apple.com>
14612
14613         * khtml/html/html_formimpl.cpp:
14614         (HTMLInputElementImpl::rendererIsNeeded):
14615         (HTMLInputElementImpl::attach):
14616         Add return statements to fix compile on deployment build.
14617
14618 2003-01-21  Maciej Stachowiak  <mjs@apple.com>
14619
14620         Reviewed by Nobody, fixing an accidental commit.
14621
14622         * khtml/khtml_part.cpp:
14623         * khtml/html/html_documentimpl.cpp:
14624         * khtml/xml/dom_docimpl.h:
14625
14626 2003-01-21  Darin Adler  <darin@apple.com>
14627
14628         Everything else reviewed by Maciej, dtd.cpp and htmlparser.cpp changes reviewed by Dave.
14629
14630         - fixed 3151098 -- REGRESSION: Frequent assert about renderer in DOM code
14631
14632         * khtml/html/dtd.cpp: (DOM::checkChild): Disallow text inside colgroup so it can be handled as a special case
14633         inside the parser.
14634         * khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Discard text inside colgroup and don't pop the colgroup.
14635
14636         - fixed 3149792 -- memory trasher at robinlionheart.com
14637         - fixed 3150664 -- failed assertion in HTMLFrameSetElementImpl::attach on page with frameset inside frameset
14638
14639         The key to fixing the 3149792 memory trasher was to avoid constructing trees where there
14640         is a render object nested inside an object that is not a suitable container. In particular,
14641         the code assumed that RenderFlow objects would only be inside other RenderFlow objects, and
14642         this does not happen if you have an <object> that is an image, with objects inside it that
14643         are intended to be used if the image fails to load.
14644
14645         The key to fixing the 3150664 assertion was to handle the case where a frame set's parent
14646         didn't have a renderer, rather than just asserting about it.
14647
14648         * khtml/rendering/render_flow.cpp:
14649         (RenderFlow::layout): Added an assertion and a FIXME from Dave's and my review of this code.
14650         (RenderFlow::splitInlines): Add assertions that we have actual RenderFlow objects. Casting
14651         non-RenderFlow objects was the cause of the memory trashing. The other parts of this change
14652         assure we never hit these assertions by not creating any render objects for DOM objects
14653         that are inside non-RenderFlow.
14654         (RenderFlow::addChildWithContinuation): Add a similar assertion here.
14655
14656         * khtml/rendering/render_object.h: Declare new member function.
14657         * khtml/rendering/render_object.cpp: (RenderObject::canHaveChildren): Return false.
14658         * khtml/rendering/render_container.h: Declare new member function.
14659         * khtml/rendering/render_container.cpp: (RenderContainer::canHaveChildren): Return true.
14660         * khtml/rendering/render_replaced.h: Declare new member function.
14661         * khtml/rendering/render_replaced.cpp: (RenderReplaced::canHaveChildren): Return false.
14662
14663         * khtml/xml/dom_nodeimpl.h: Declare new member functions.
14664         * khtml/xml/dom_nodeimpl.cpp:
14665         (NodeImpl::createRendererIfNeeded): Added. Checks to see if a renderer should be created,
14666         and creates it if so. The bug fix is checking canHaveChildren() here. This also reduces
14667         the amount of repeated code in various attach() methods.
14668         (NodeImpl::styleForRenderer): Added. Default is parent style.
14669         (NodeImpl::rendererIsNeeded): Added. Default is to create only if display is not none.
14670         (NodeImpl::createRenderer): Added. Must never reach this function, but I didn't make it a pure
14671         virtual because of subclasses like AttrImpl that don't ever call createRendererIfNeeded.
14672         Could rethink this and improve it even more.
14673
14674         * khtml/xml/dom_elementimpl.h: Declare new member functions.
14675         * khtml/xml/dom_elementimpl.cpp:
14676         (ElementImpl::styleForRenderer): Override to get the style from the style selector rather
14677         than from the parent renderer.
14678         (ElementImpl::createRenderer): Call RenderObject::createObject to create the right type of renderer.
14679         (ElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14680
14681         * khtml/html/html_baseimpl.h: Declare new member functions.
14682         * khtml/html/html_baseimpl.cpp:
14683         (HTMLBodyElementImpl::createRenderer): Create a RenderBody.
14684         (HTMLBodyElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14685         (HTMLFrameElementImpl::rendererIsNeeded): Override to implement the different policy
14686         this element uses to decide whether to make a renderer (same as old code).
14687         (HTMLFrameElementImpl::createRenderer): Create a RenderFrame.
14688         (HTMLFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14689         (HTMLFrameSetElementImpl::rendererIsNeeded): Override to implement the different policy
14690         this element uses to decide whether to make a renderer (same as old code).
14691         (HTMLFrameSetElementImpl::createRenderer): Create a RenderFrameSet.
14692         (HTMLFrameSetElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14693         This fixes a bug where the parent doesn't have a renderer; we were asserting in
14694         that case rather than just not creating a renderer ourselves, which was wrong.
14695         (HTMLHtmlElementImpl::rendererIsNeeded): Override to implement the different policy
14696         this element uses to decide whether to make a renderer (same as old code).
14697         (HTMLHtmlElementImpl::createRenderer): Create a RenderHtml.
14698         (HTMLHtmlElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14699         (HTMLIFrameElementImpl::createRenderer): Create a RenderPartObject.
14700         (HTMLIFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14701
14702         * khtml/html/html_formimpl.h: Declare new member functions.
14703         * khtml/html/html_formimpl.cpp:
14704         (HTMLGenericFormElementImpl::attach): Remove now-unneeded code that is handled by
14705         createRendererIfNeeded now.
14706         (HTMLInputElementImpl::rendererIsNeeded): Return false for HIDDEN, otherwise call base.
14707         (HTMLInputElementImpl::createRenderer): Create the appropriate type of RenderObject.
14708         (HTMLInputElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14709         Determined that we don't need the special case for image buttons any more.
14710         (HTMLSelectElementImpl::createRenderer): Create a RenderSelect.
14711         (HTMLSelectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14712         (HTMLTextAreaElementImpl::createRenderer): Create a RenderTextArea.
14713         (HTMLTextAreaElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14714
14715         * khtml/html/html_imageimpl.h: Declare new member function.
14716         * khtml/html/html_imageimpl.cpp:
14717         (HTMLImageElementImpl::createRenderer): Create a RenderImage.
14718         (HTMLImageElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14719
14720         * khtml/html/html_inlineimpl.h: Declare new member function.
14721         * khtml/html/html_inlineimpl.cpp:
14722         (HTMLBRElementImpl::createRenderer): Create a RenderBR.
14723         (HTMLBRElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14724
14725         * khtml/html/html_objectimpl.h: Declare new member functions.
14726         * khtml/html/html_objectimpl.cpp:
14727         (HTMLAppletElementImpl::rendererIsNeeded): Override to implement the different policy
14728         this element uses to decide whether to make a renderer (same as old code).
14729         (HTMLAppletElementImpl::createRenderer): Create either a RenderApplet or RenderEmptyApplet.
14730         (HTMLAppletElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14731         (HTMLEmbedElementImpl::rendererIsNeeded): Override to implement the different policy
14732         this element uses to decide whether to make a renderer (same as old code).
14733         (HTMLEmbedElementImpl::createRenderer): Create a RenderPartObject.
14734         (HTMLEmbedElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14735         (HTMLObjectElementImpl::rendererIsNeeded): Override to implement the different policy
14736         this element uses to decide whether to make a renderer (same as old code).
14737         (HTMLObjectElementImpl::createRenderer): Create either a RenderImage or a RenderPartObject.
14738         (HTMLObjectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
14739
14740         * khtml/xml/dom_textimpl.h: Declare new member functions.
14741         * khtml/xml/dom_textimpl.cpp:
14742         (TextImpl::rendererIsNeeded): Moved logic about not making renderers for only-whitespace
14743         elements here. Left out the special case for textarea, since the fact that RenderReplaced
14744         returns false from the canHaveChildren function now takes care of that of that case.
14745         (TextImpl::createRenderer): Create a RenderText.
14746         (TextImpl::attach): Call createRendererIfNeeded to do most of the work.
14747
14748         - fixed a buffer overrun that libgmalloc detected
14749
14750         * khtml/misc/decoder.cpp:
14751         (KanjiCode::judge): Pass in a size parameter instead of using strlen.
14752         (Decoder::decode): Pass in a size parameter.
14753
14754         - a little housekeeping
14755
14756         * WebCore.pbproj/project.pbxproj: Remove a bunch of the .moc files
14757         from the project. I'm not sure why I put them in originally, but they
14758         do no good in there.
14759         * khtml/khtmlview.moc: Empty out this file.
14760
14761 2003-01-21  Maciej Stachowiak  <mjs@apple.com>
14762
14763         Reviewed by Trey.
14764
14765         - fixed 3145317 - Unable to add or remove menu items on Site Menu page using Safari Beta
14766
14767         This turned out to be a problem with event.layerX / event.layerY.
14768         
14769         * khtml/xml/dom2_eventsimpl.cpp:
14770         (MouseEventImpl::computeLayerPos): Since layer position is
14771         relative to parent layer, go up the layer tree adjusting for layer
14772         offset to compute true layer position.
14773  
14774 2003-01-21  Maciej Stachowiak  <mjs@apple.com>
14775
14776         Reviewed by Ken.
14777
14778         - fixed 3151982 - missing content at debka.com after iframe is written using document.write
14779         - fixed 3000234 - javascript problem writing iframe at cycleworld.com
14780
14781         * khtml/html/htmltokenizer.cpp:
14782         (HTMLTokenizer::scriptHandler): If we come out of the script with
14783         the parser in skip mode, don't throw away the whole rest of the
14784         document - instead, parse it as usual. The parser's skip mode will
14785         take care of skipping stuff as needed and will detect close tags
14786         for special tags like <iframe>.
14787
14788 2003-01-20  David Hyatt  <hyatt@apple.com>
14789
14790         Fix :hover performance regression on wsj.com.  Moving my
14791         <a name="foo"> quirk down into the :hover rule  matching code,
14792         so that we'll know never to apply :hover to anchorless <a>s.
14793         
14794         Reviewed by gramps
14795
14796         * khtml/css/cssstyleselector.cpp:
14797         * khtml/rendering/render_object.cpp:
14798         (RenderObject::setHoverAndActive):
14799
14800 2003-01-20  Maciej Stachowiak  <mjs@apple.com>
14801
14802         Reviewed by Trey.
14803
14804         - fixed 3132120 - onchange handler not firing on mac.com webmail
14805
14806         * khtml/rendering/render_form.h:
14807         * khtml/rendering/render_replaced.cpp:
14808         (RenderWidget::handleFocusOut): Moved empty virtual method here from render_form.
14809         (RenderWidget::eventFilter): Uncomment call to handleFocusOut - we
14810         need it to send onChange properly.
14811         * khtml/rendering/render_replaced.h:
14812         * kwq/KWQObject.h: Add empty eventFilter virtual method.
14813         * kwq/KWQComboBox.h: Remove no longer needed empty eventFilter.
14814         * kwq/KWQEvent.h: Implement a bit more of QFocusEvent.
14815         * kwq/KWQTextArea.mm:
14816         (-[KWQTextArea _createTextView]): Tell the text view its widget.
14817         (-[KWQTextAreaTextView setWidget:]): New method to set widget.
14818         (-[KWQTextAreaTextView becomeFirstResponder]): In addition to the usual stuff,
14819         call the widget's event filter with a focus in event.
14820         (-[KWQTextAreaTextView resignFirstResponder]): In addition to the usual stuff,
14821         call the widget's event filter with a focus out event.
14822         * kwq/KWQTextField.mm:
14823         (-[KWQTextField becomeFirstResponder]): Cleaned up a bit.
14824         (-[KWQTextField fieldWillBecomeFirstResponder]): Call the widget's event filter with a focus in event.
14825         (-[KWQTextField fieldWillResignFirstResponder]): Call the widget's event filter with a focus out event.
14826         * kwq/KWQView.mm:
14827
14828 2003-01-20  David Hyatt  <hyatt@apple.com>
14829
14830         Fix for 3147213.  <nobr> is treated like other inlines now,
14831         so it can contain blocks.  <wbr> is also fixed.  This fixes
14832         tvguide.com.
14833         
14834         Reviewed by john
14835
14836         * khtml/html/dtd.cpp:
14837         (DOM::checkChild):
14838
14839 2003-01-20  David Hyatt  <hyatt@apple.com>
14840
14841         Gah. Fix positioned objects and floating objects so that they
14842         don't append themselves to the list of runs in normal flow.
14843         An astoundingly basic bug. :(
14844         
14845         Reviewed by john
14846
14847         * khtml/rendering/bidi.cpp:
14848         (appendRunsForObject):
14849         * khtml/rendering/render_flow.cpp:
14850         (RenderFlow::addChildToFlow):
14851
14852 2003-01-19  David Hyatt  <hyatt@apple.com>
14853
14854         Fixes for 3150561 (blog articles vanish on stylesheet switch) and
14855         and 3150560 (crash changing fixed positioned element to normal
14856         positioning dynamically).
14857
14858         This change makes layers able to deal with dynamic changes in
14859         position that cause you to have to either remove a layer from
14860         the hierarchy while preserving the children or to insert a
14861         layer into the hierarchy in between a parent and its descendants.
14862
14863         This patch also rewrites :hover/:active so that they can actually
14864         be used in selectors other than the rightmost selector (e.g., so you
14865         can write a rule like "li:hover > a").  
14866
14867         Also, layers will now properly clear out their hover/active state
14868         when the mouse is no longer inside them.
14869
14870         With these fixes, Eric Meyer's "Pure CSS Menus" work (perfectly)
14871         and the repainting problems on sites like brainjar.com and
14872         diveintomark.org and wired.com are fixed.
14873         
14874         Reviewed by mjs and john.
14875
14876         * khtml/css/css_stylesheetimpl.h:
14877         * khtml/css/cssparser.cpp:
14878         (StyleBaseImpl::parseSelector):
14879         * khtml/css/cssparser.h:
14880         * khtml/css/cssstyleselector.cpp:
14881         * khtml/css/cssstyleselector.h:
14882         * khtml/dom/html_head.cpp:
14883         (HTMLLinkElement::setDisabled):
14884         * khtml/rendering/render_box.cpp:
14885         (RenderBox::setStyle):
14886         * khtml/rendering/render_box.h:
14887         * khtml/rendering/render_container.cpp:
14888         (RenderContainer::appendChildNode):
14889         (RenderContainer::insertChildNode):
14890         * khtml/rendering/render_flow.cpp:
14891         (RenderFlow::setStyle):
14892         * khtml/rendering/render_flow.h:
14893         * khtml/rendering/render_layer.cpp:
14894         (RenderLayer::addChild):
14895         (RenderLayer::removeOnlyThisLayer):
14896         (RenderLayer::insertOnlyThisLayer):
14897         (RenderLayer::clearOtherLayersHoverActiveState):
14898         (RenderLayer::clearHoverAndActiveState):
14899         (RenderLayer::nodeAtPoint):
14900         (RenderLayer::constructZTree):
14901         * khtml/rendering/render_layer.h:
14902         * khtml/rendering/render_object.cpp:
14903         (RenderObject::addLayers):
14904         (RenderObject::moveLayers):
14905         (RenderObject::findNextLayer):
14906         (RenderObject::setStyle):
14907         (RenderObject::setHoverAndActive):
14908         * khtml/rendering/render_object.h:
14909         * khtml/rendering/render_style.cpp:
14910         (RenderStyle::diff):
14911         * khtml/rendering/render_style.h:
14912         * khtml/xml/dom_docimpl.cpp:
14913         (DocumentImpl::DocumentImpl):
14914         * khtml/xml/dom_docimpl.h:
14915         * khtml/xml/dom_elementimpl.cpp:
14916         (ElementImpl::recalcStyle):
14917         * khtml/xml/dom_nodeimpl.cpp:
14918         (NodeBaseImpl::setActive):
14919
14920 2003-01-17  Maciej Stachowiak  <mjs@apple.com>
14921
14922         Reviewed by John.
14923
14924         - fixed 3149511 - Blogger.com window closes after update is posted
14925         
14926         * khtml/ecma/kjs_window.cpp:
14927         (WindowFunc::tryCall): For now, don't allow closing the window at
14928         all if it wasn't opened by JavaScript, since we don't support the
14929         history object and so can't tell if the window has only one
14930         history item.
14931
14932 2003-01-17  Darin Adler  <darin@apple.com>
14933
14934         Reviewed by Dave.
14935
14936         - fixed the crashing so the layout tests work
14937
14938         * khtml/rendering/render_layer.h: Add a node pointer result.
14939         * khtml/rendering/render_layer.cpp: (RenderLayer::elementList):
14940         Return the node pointer so we can destroy it when done with it.
14941
14942         * khtml/rendering/render_object.h: Make renderArena() const.
14943         * khtml/rendering/render_object.cpp: (RenderObject::renderArena): Make it const.
14944
14945         * kwq/KWQRenderTreeDebug.cpp: (writeLayers): Free the Z layer list when done.
14946         Without this things just crashed.
14947
14948 2003-01-17  Richard Williamson   <rjw@apple.com>
14949
14950         Fixed 3126141. Allow pages with plugins to be cached.  This is safe
14951         because plugins are cleanly started/stopped when their containing views are
14952         added/removed from the view hierarchy.
14953         
14954         Reviewed by trey.
14955
14956         * kwq/KWQKHTMLPart.mm:
14957         (KWQKHTMLPart::canCachePage):
14958
14959 2003-01-17  David Hyatt  <hyatt@apple.com>
14960
14961         The new table code from Lars.  Also includes bug fixes for
14962         percentage height children in table cells, for positioning
14963         of tables, and for width distribution of percentage width
14964         cells.
14965         
14966         Reviewed by darin
14967
14968         * ForwardingHeaders/rendering/table_layout.h: Added.
14969         * WebCore.pbproj/project.pbxproj:
14970         * khtml/css/cssparser.cpp:
14971         (StyleBaseImpl::parseValue):
14972         * khtml/css/cssstyleselector.cpp:
14973         * khtml/css/cssvalues.c:
14974         (findValue):
14975         * khtml/css/cssvalues.h:
14976         * khtml/css/cssvalues.in:
14977         * khtml/css/html4.css:
14978         * khtml/dom/html_table.cpp:
14979         (HTMLTableElement::insertRow):
14980         (HTMLTableElement::deleteRow):
14981         (HTMLTableRowElement::insertCell):
14982         (HTMLTableRowElement::deleteCell):
14983         (HTMLTableSectionElement::insertRow):
14984         (HTMLTableSectionElement::deleteRow):
14985         * khtml/html/html_tableimpl.cpp:
14986         (HTMLTableElementImpl::HTMLTableElementImpl):
14987         (HTMLTableElementImpl::setTFoot):
14988         (HTMLTableElementImpl::setTBody):
14989         (HTMLTableElementImpl::createTHead):
14990         (HTMLTableElementImpl::createTFoot):
14991         (HTMLTableElementImpl::insertRow):
14992         (HTMLTableElementImpl::deleteRow):
14993         (HTMLTableElementImpl::addChild):
14994         (HTMLTableElementImpl::parseAttribute):
14995         (HTMLTableElementImpl::attach):
14996         (HTMLTablePartElementImpl::parseAttribute):
14997         (HTMLTableSectionElementImpl::HTMLTableSectionElementImpl):
14998         (HTMLTableSectionElementImpl::~HTMLTableSectionElementImpl):
14999         (HTMLTableSectionElementImpl::insertRow):
15000         (HTMLTableSectionElementImpl::deleteRow):
15001         (HTMLTableSectionElementImpl::numRows):
15002         (HTMLTableRowElementImpl::rowIndex):
15003         (HTMLTableRowElementImpl::insertCell):
15004         (HTMLTableRowElementImpl::deleteCell):
15005         (HTMLTableCellElementImpl::HTMLTableCellElementImpl):
15006         (HTMLTableCellElementImpl::parseAttribute):
15007         (HTMLTableCellElementImpl::attach):
15008         (HTMLTableColElementImpl::HTMLTableColElementImpl):
15009         (HTMLTableColElementImpl::parseAttribute):
15010         * khtml/html/html_tableimpl.h:
15011         * khtml/html/htmlparser.cpp:
15012         (KHTMLParser::insertNode):
15013         (KHTMLParser::getElement):
15014         * khtml/rendering/bidi.cpp:
15015         (RenderFlow::layoutInlineChildren):
15016         * khtml/rendering/render_body.cpp:
15017         (RenderBody::availableHeight):
15018         * khtml/rendering/render_body.h:
15019         * khtml/rendering/render_box.cpp:
15020         (RenderBox::contentWidth):
15021         (RenderBox::contentHeight):
15022         (RenderBox::calcReplacedWidth):
15023         (RenderBox::calcReplacedHeight):
15024         (RenderBox::availableHeight):
15025         (RenderBox::calcAbsoluteVertical):
15026         * khtml/rendering/render_box.h:
15027         * khtml/rendering/render_flow.cpp:
15028         (RenderFlow::layoutBlockChildren):
15029         (RenderFlow::leftOffset):
15030         (RenderFlow::rightOffset):
15031         (RenderFlow::addOverHangingFloats):
15032         (RenderFlow::calcBlockMinMaxWidth):
15033         (RenderFlow::calcMinMaxWidth):
15034         * khtml/rendering/render_form.cpp:
15035         * khtml/rendering/render_form.h:
15036         * khtml/rendering/render_frames.cpp:
15037         * khtml/rendering/render_frames.h:
15038         * khtml/rendering/render_object.cpp:
15039         (RenderObject::createObject):
15040         (RenderObject::paddingTop):
15041         (RenderObject::paddingBottom):
15042         (RenderObject::paddingLeft):
15043         (RenderObject::paddingRight):
15044         * khtml/rendering/render_object.h:
15045         * khtml/rendering/render_replaced.cpp:
15046         (RenderReplaced::calcMinMaxWidth):
15047         * khtml/rendering/render_root.cpp:
15048         (RenderRoot::RenderRoot):
15049         (RenderRoot::layout):
15050         (RenderRoot::paintObject):
15051         * khtml/rendering/render_root.h:
15052         * khtml/rendering/render_style.cpp:
15053         (StyleSurroundData::StyleSurroundData):
15054         * khtml/rendering/render_style.h:
15055         * khtml/rendering/render_table.cpp:
15056         (RenderTable::RenderTable):
15057         (RenderTable::~RenderTable):
15058         (RenderTable::setStyle):
15059         (RenderTable::position):
15060         (RenderTable::addChild):
15061         (RenderTable::calcWidth):
15062         (RenderTable::layout):
15063         (RenderTable::setCellWidths):
15064         (RenderTable::paint):
15065         (RenderTable::calcMinMaxWidth):
15066         (RenderTable::splitColumn):
15067         (RenderTable::appendColumn):
15068         (RenderTable::colElement):
15069         (RenderTable::recalcSections):
15070         (RenderTable::removeChildNode):
15071         (RenderTable::dump):
15072         (RenderTableSection::RenderTableSection):
15073         (RenderTableSection::~RenderTableSection):
15074         (RenderTableSection::detach):
15075         (RenderTableSection::setStyle):
15076         (RenderTableSection::addChild):
15077         (RenderTableSection::ensureRows):
15078         (RenderTableSection::addCell):
15079         (RenderTableSection::setCellWidths):
15080         (RenderTableSection::calcRowHeight):
15081         (RenderTableSection::layoutRows):
15082         (RenderTableSection::paint):
15083         (RenderTableSection::recalcCells):
15084         (RenderTableSection::clearGrid):
15085         (RenderTableSection::removeChildNode):
15086         (RenderTableSection::dump):
15087         (RenderTableRow::RenderTableRow):
15088         (RenderTableRow::detach):
15089         (RenderTableRow::setStyle):
15090         (RenderTableRow::addChild):
15091         (RenderTableRow::removeChildNode):
15092         (RenderTableRow::dump):
15093         (RenderTableRow::layout):
15094         (RenderTableCell::RenderTableCell):
15095         (RenderTableCell::detach):
15096         (RenderTableCell::updateFromElement):
15097         (RenderTableCell::getCellPercentageHeight):
15098         (RenderTableCell::setCellPercentageHeight):
15099         (RenderTableCell::calcMinMaxWidth):
15100         (RenderTableCell::baselinePosition):
15101         (RenderTableCell::setStyle):
15102         (RenderTableCell::paint):
15103         (RenderTableCell::paintBoxDecorations):
15104         (RenderTableCell::dump):
15105         (RenderTableCol::RenderTableCol):
15106         (RenderTableCol::updateFromElement):
15107         (RenderTableCol::addChild):
15108         (RenderTableCol::dump):
15109         * khtml/rendering/render_table.h:
15110         * khtml/rendering/table_layout.cpp: Added.
15111         (FixedTableLayout::FixedTableLayout):
15112         (FixedTableLayout::~FixedTableLayout):
15113         (FixedTableLayout::calcWidthArray):
15114         (FixedTableLayout::calcMinMaxWidth):
15115         (FixedTableLayout::layout):
15116         (AutoTableLayout::AutoTableLayout):
15117         (AutoTableLayout::~AutoTableLayout):
15118         (AutoTableLayout::recalcColumn):
15119         (AutoTableLayout::fullRecalc):
15120         (AutoTableLayout::calcMinMaxWidth):
15121         (AutoTableLayout::calcEffectiveWidth):
15122         (AutoTableLayout::insertSpanCell):
15123         (AutoTableLayout::layout):
15124         (AutoTableLayout::calcPercentages):
15125         * khtml/rendering/table_layout.h: Added.
15126         * khtml/xml/dom_docimpl.cpp:
15127         (DocumentImpl::createHTMLElement):
15128         * khtml/xml/dom_nodeimpl.cpp:
15129         (NodeImpl::NodeImpl):
15130         (NodeImpl::dump):
15131         * khtml/xml/dom_nodeimpl.h:
15132
15133 2003-01-17  Darin Adler  <darin@apple.com>
15134
15135         Reviewed by Dave.
15136
15137         - clean room rewrite of QCString::operator<<.
15138
15139         * kwq/KWQCString.mm: (operator<<): Rewrote it.
15140
15141         - update format of render tree dumping for real use
15142
15143         * khtml/rendering/render_layer.h: Added elementList().
15144         * khtml/rendering/render_layer.cpp: (RenderLayer::elementList): Added.
15145
15146         * kwq/KWQRenderTreeDebug.cpp:
15147         (operator<<): Added an overload for writing out QRect.
15148         (writeIndent): Added.
15149         (write): Use the overload for QRect, also reorganize to dump layers.
15150         (writeLayers): Use this to dump the layers.
15151         (externalRepresentation): Call writeLayers instead of write.
15152
15153 2003-01-17  Darin Adler  <darin@apple.com>
15154
15155         Reviewed by Ken.
15156
15157         - removed unused KWQDrawUtil code
15158
15159         * ForwardingHeaders/qdrawutil.h: Emptied this file out.
15160
15161         * kwq/KWQDrawUtil.h: Removed.
15162         * kwq/KWQDrawUtil.mm: Removed.
15163         * WebCore.pbproj/project.pbxproj: Removed KWQDrawUtil.
15164
15165 2003-01-17  Darin Adler  <darin@apple.com>
15166
15167         Reviewed by John.
15168
15169         - updated copyright to include expat copyrights
15170
15171         * WebCore.pbproj/project.pbxproj: Added expat copyrights on the end.
15172         Got text of copyrights from Acknowledgments.rtf in WebBrowser.
15173
15174 2003-01-16  Maciej Stachowiak  <mjs@apple.com>
15175
15176         Reviewed by Dave.
15177
15178         - fixed 3148141 - crash in KJS::WindowFunc::tryCall leaving certain site
15179         
15180         * kwq/KWQKHTMLPart.mm:
15181         (KWQKHTMLPart::setView): If setting the view to nil and we have a
15182         document, detach the document. This means that we are removing a
15183         frame from the tree, so we want to run it's onUnload handler now,
15184         rather than later when things are no longer fully hooked up.
15185
15186 2003-01-16  Richard Williamson   <rjw@apple.com>
15187
15188         Fixed 3148932.  Account for zero width characters
15189         in <pre> fixed-width optimization.
15190         
15191         Reviewed by hyatt.
15192
15193         * khtml/rendering/render_text.cpp:
15194         (RenderText::widthFromCache):
15195         
15196         Reviewed by Richard (written by Mike S.)  'Clean' implementations of these
15197         functions that were too similar to the Qt implementations.
15198         
15199         * kwq/KWQString.mm:
15200         (QString::left):
15201         (QString::right):
15202         (QString::mid):
15203
15204 2003-01-16  Maciej Stachowiak  <mjs@apple.com>
15205
15206         Reviewed by Darin.
15207
15208         - fixed 3144771 - Crash in KJS::WindowFunc::tryCall leaving www.smogcheck.org
15209
15210         I fixed this by making sure we couldn't send the unload event twice, which was
15211         happening before in certain circumstances.
15212         
15213         * khtml/khtml_part.cpp:
15214         (KHTMLPart::closeURL): When emitting load event, note that unload
15215         event has not yet been sent.
15216         (KHTMLPart::checkEmitLoadEvent): Note when unload event has been
15217         sent to avoid sending it twice.
15218         * khtml/khtmlpart_p.h:
15219
15220 2003-01-16  Darin Adler  <darin@apple.com>
15221
15222         Reviewed by John.
15223
15224         - added an API for dumping the external representation of the render tree for testing
15225
15226         * kwq/KWQRenderTreeDebug.h: Added.
15227         * kwq/KWQRenderTreeDebug.cpp: Added.
15228
15229         * kwq/KWQTextStream.h: Added more overloads for operator<<.
15230         * kwq/KWQTextStream.mm: (QTextStream::operator<<): Implemented them.
15231
15232         * kwq/WebCoreBridge.h: Added renderTreeAsExternalRepresentation.
15233         * kwq/WebCoreBridge.mm: (-[WebCoreBridge renderTreeAsExternalRepresentation]): Added.
15234
15235         - removed remnants of an earlier more-naive cut at this same sort of thing
15236         - removed ForwardingHeaders from the project since that doesn't really help Project Builder
15237
15238         * kwq/WebCoreTestController.h: Removed.
15239         * kwq/WebCoreTestController.m: Removed.
15240         * WebCore.exp: Removed WebCoreTestController.
15241         * WebCore-combined.exp: Re-generated.
15242         * WebCore.pbproj/project.pbxproj: Removed WebCoreTestController and ForwardingHeaders.
15243
15244 === Safari-52 ===
15245
15246 2003-01-15  Trey Matteson  <trey@apple.com>
15247
15248         3144458 - user's credentials are present in a form that is revisited via b/f or history
15249
15250         We now never save/restore password fields.  Also if the page has a form with a password
15251         field that would be submitted securely, we do not save anything on that page.
15252
15253         Reviewed by Darin.
15254
15255         * force-clean-timestamp:  PB isn't smart enough to know what to rebuild.
15256         * khtml/html/html_formimpl.cpp:
15257         (HTMLFormElementImpl::formWouldHaveSecureSubmission):  Utility function.
15258         (HTMLFormElementImpl::attach):  Tell doc if we've added a secure form.
15259         (HTMLFormElementImpl::parseAttribute):  Tell doc if form became secure.
15260         (HTMLInputElementImpl::state):  Assert that we never save password fields.
15261         (HTMLInputElementImpl::restoreState):  Assert that we never restore password fields.
15262         (HTMLInputElementImpl::attach):  Tell doc if we've added a password field.
15263         * khtml/html/html_formimpl.h:
15264         * khtml/xml/dom_docimpl.cpp:
15265         (DocumentImpl::DocumentImpl):  Init count of secure forms, password fields.
15266         (DocumentImpl::passwordFieldAdded):
15267         (DocumentImpl::passwordFieldRemoved):
15268         (DocumentImpl::hasPasswordField):  New methods to count password fields.
15269         (DocumentImpl::secureFormAdded):
15270         (DocumentImpl::secureFormRemoved):
15271         (DocumentImpl::hasSecureForm):  New methods to count secure forms.
15272         * khtml/xml/dom_docimpl.h:
15273         * kwq/KWQKHTMLPart.mm:
15274         (KWQKHTMLPart::canCachePage):   Never let pages with password fields in the page cache.
15275         (KWQKHTMLPart::saveDocumentState):  Do not save form state if page has a form with
15276         a password field that would be submitted securely
15277
15278 2003-01-15  Darin Adler  <darin@apple.com>
15279
15280         Reviewed by Ken.
15281
15282         - fixed problem where Content-Type was coming in with suffixes like "charset"
15283
15284         * kwq/WebCoreBridge.h: Add contentType and refresh parameters, and remove "headers"
15285         parameter, from openURL method.
15286         * kwq/WebCoreBridge.mm:
15287         (-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]): Get the
15288         content type from a parameter, and the refresh header from a separate parameter rather
15289         than extracting both from a headers dictionary.
15290
15291 2003-01-14  Darin Adler  <darin@apple.com>
15292
15293         Reviewed by Maciej.
15294
15295         - fixed 3147036 -- words separated only by newlines are getting rammed together on XML page
15296         - fixed 3147032 -- preformatted text is missing much whitespace on XML page
15297
15298         * khtml/xml/xml_tokenizer.cpp: (XMLHandler::characters): Don't try to strip whitespace at all,
15299         because it needs to be in the DOM.
15300
15301         - add support for more MIME types
15302
15303         * khtml/khtml_part.cpp: (KHTMLPart::begin): Add "application/xml" and "application/xhtml+xml".
15304
15305 2003-01-14  David Hyatt  <hyatt@apple.com>
15306
15307         Make FOUC work with XML.
15308         
15309         Reviewed by darin.
15310
15311         * khtml/html/html_baseimpl.cpp:
15312         (HTMLBodyElementImpl::attach):
15313         * khtml/xml/dom_xmlimpl.cpp:
15314         (ProcessingInstructionImpl::ProcessingInstructionImpl):
15315         (ProcessingInstructionImpl::checkStyleSheet):
15316         (ProcessingInstructionImpl::isLoading):
15317         (ProcessingInstructionImpl::sheetLoaded):
15318         (ProcessingInstructionImpl::setStyleSheet):
15319         * khtml/xml/dom_xmlimpl.h:
15320
15321 2003-01-14  Darin Adler  <darin@apple.com>
15322
15323         Reviewed by Maciej.
15324
15325         - first cut at XML parsing with expat
15326
15327         * khtml/khtml_part.cpp: (KHTMLPart::begin): Remove APPLE_CHANGES and use the XML
15328         code for text/xml documents.
15329
15330         * WebCore.pbproj/project.pbxproj: Added the ForwardingHeaders to the project.
15331         Added new QXml files, removed old ones.
15332
15333         * kwq/KWQXml.h: Removed.
15334         * kwq/KWQXml.mm: Removed.
15335
15336         * kwq/KWQXmlAttributes.h: Added.
15337         * kwq/KWQXmlAttributes.mm: Added.
15338         * kwq/KWQXmlDefaultHandler.h: Added.
15339         * kwq/KWQXmlDefaultHandler.mm: Added.
15340         * kwq/KWQXmlSimpleReader.h: Added.
15341         * kwq/KWQXmlSimpleReader.mm: Added.
15342
15343         * kwq/KWQString.h: Add fromUtf8 functions.
15344         * kwq/KWQString.mm: (QString::fromUtf8): Added. Simple implementation just
15345         calls fromStringWithEncoding. We may need something more efficient later,
15346         at least for all-ASCII text.
15347
15348         - other changes
15349
15350         * khtml/khtml_part.h: Fix spelling of occurrence.
15351
15352         * khtml/misc/decoder.cpp: (Decoder::decode): Turn on Japanese auto-detect.
15353         It doesn't seem to work yet, but this does no harm.
15354
15355 2003-01-13  Richard Williamson   <rjw@apple.com>
15356
15357         Fix for 3139120.  This patch was contributed by Mitz Pettel.  It correctly
15358         handles the visually ordered encodings.  The patch also picks up changes
15359         from kde that accounts for european numbers correctly in bidiReorderLine().
15360         
15361         Reviewed by Dave.
15362
15363         * khtml/html/html_formimpl.cpp:
15364         (HTMLFormElementImpl::formData):
15365         * khtml/misc/decoder.cpp:
15366         (Decoder::setEncoding):
15367         * khtml/rendering/bidi.cpp:
15368         (RenderFlow::bidiReorderLine):
15369         * khtml/rendering/bidi.h:
15370
15371 2003-01-13  Darin Adler  <darin@apple.com>
15372
15373         Reviewed by Ken.
15374
15375         - fixed 3143781 -- submitting the same form twice doesn't work properly
15376         (example at directory.apple.com)
15377
15378         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Only run the "don't submit the same
15379         form twice" logic when the form is one that affects the frame that the form is in.
15380
15381 2003-01-12  Darin Adler  <darin@apple.com>
15382
15383         * WebCorePrefix.h: Needed to touch this file since we now have plain C source (expat).
15384         * kwq/KWQKHTMLPart.cpp: Reformatted a bit.
15385
15386 2003-01-12  Darin Adler  <darin@apple.com>
15387
15388         Reviewed by Maciej.
15389
15390         - first step towards integrating expat for XML support: make it compile and link
15391
15392         * kwq/KWQXml.mm: (QXmlSimpleReader::parse): Put in a placeholder that calls expat.
15393         Mainly just used to make sure we link.
15394
15395         * WebCore.pbproj/project.pbxproj: Added expat files.
15396
15397         * expat/COPYING: Added.
15398         * expat/Changes: Added.
15399         * expat/MANIFEST: Added.
15400         * expat/README: Added.
15401         * expat/expat_config.h: Added.
15402         * expat/lib/ascii.h: Added.
15403         * expat/lib/asciitab.h: Added.
15404         * expat/lib/expat.h: Added.
15405         * expat/lib/iasciitab.h: Added.
15406         * expat/lib/internal.h: Added.
15407         * expat/lib/latin1tab.h: Added.
15408         * expat/lib/nametab.h: Added.
15409         * expat/lib/utf8tab.h: Added.
15410         * expat/lib/xmlparse.c: Added.
15411         * expat/lib/xmlrole.c: Added.
15412         * expat/lib/xmlrole.h: Added.
15413         * expat/lib/xmltok.c: Added.
15414         * expat/lib/xmltok.h: Added.
15415         * expat/lib/xmltok_impl.c: Added.
15416         * expat/lib/xmltok_impl.h: Added.
15417         * expat/lib/xmltok_ns.c: Added.
15418
15419 2003-01-12  Darin Adler  <darin@apple.com>
15420
15421         Reviewed by Dave.
15422
15423         - minor cleanup of plug-in-related classes in ECMA directory
15424
15425         * khtml/ecma/kjs_navigator.cpp: Remove unneeded PluginBase member functions
15426         ref() and deref(). Instead just make Plugin and MimeType both derive from
15427         PluginBase and remove APPLE_CHANGES.
15428         (Navigator::getValueProperty): Don't use "Konqueror" for the fallback.
15429         Just return Undefined() for that case since we will never reach it anyway.
15430
15431         - simplify the logic in khtmlMoveMouseEvent so it's easier to decipher
15432
15433         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMouseMoveEvent): By merging two
15434         identical if statements, the logic of this function becomes much clearer.
15435
15436 2003-01-12  Darin Adler  <darin@apple.com>
15437
15438         Reviewed by Dave.
15439
15440         - fixed a bunch of places where KHTML did !x == y instead of !(x == y) or x != y.
15441
15442         * khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule):
15443         * khtml/html/htmlparser.cpp: (KHTMLParser::insertNode):
15444         * khtml/misc/loader.cpp: (Cache::requestImage), (Cache::requestStyleSheet):
15445         * khtml/rendering/render_flow.cpp: (RenderFlow::setStyle):
15446         Changed !x == y to x != y. In each case, there's a reason that this does not create
15447         any problem in practice, which is why we didn't rush to get this in for beta 1.
15448
15449 2003-01-11  Darin Adler  <darin@apple.com>
15450
15451         Reviewed by John.
15452
15453         - fixed 3144789 -- reproducible crash in KHTMLParser::freeBlock on a page at www.library.arizona.edu
15454
15455         * khtml/html/htmlparser.cpp: (KHTMLParser::finished): Call freeBlock here rather than
15456         waiting until the parser is destroyed. This fixes the bug because when the parser is
15457         destroyed, the document is already destroyed, so we have a dangling current pointer to an
15458         already-destroyed node.
15459
15460         - fixed 3142024 -- crash/hang/assert on java.sun.com in HTMLTokenizer
15461
15462         The bug was caused by an erroneous clicked signal that was being emitted by
15463         QListBox at just the wrong time.
15464
15465         * kwq/KWQListBox.h: Added _changingSelection boolean.
15466         * kwq/KWQListBox.mm: (QListBox::QListBox): Set _changingSelection to false.
15467         (QListBox::setSelected): Set _changingSelection to true.
15468         (-[KWQListBoxTableViewDelegate tableViewSelectionDidChange:]): Only emit the "clicked"
15469         signal if _changingSelection is false.
15470
15471         * khtml/html/htmltokenizer.h: Add debug-only boolean inWrite.
15472         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::HTMLTokenizer): Set inWrite to false.
15473         (HTMLTokenizer::write): Set inWrite to true.
15474         (HTMLTokenizer::~HTMLTokenizer): Assert that inWrite is not true.
15475
15476 2003-01-11  Darin Adler  <darin@apple.com>
15477
15478         Reviewed by Dave.
15479
15480         - fixed 3136944 -- mouseover feedback over non-mapped part of image map claims
15481         link to current page
15482
15483         * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]):
15484         Change code so we won't call completeURL and complete a null ATTR_HREF (which is distinct
15485         from an empty ATTR_HREF). Did a similar cleanup on the image code.
15486
15487 2003-01-09  Darin Adler  <darin@apple.com>
15488
15489         * WebCore.pbproj/project.pbxproj: Add the year 2003, remove CFBundleIconFile,
15490         bump marketing version to 0.8.1 and version to 52u to keep up with the branch,
15491         remove NSHumanReadableCopyright, remove NSPrincipalClass, remove SKIP_INSTALL
15492         that was in the Info plist instead of project settings.
15493
15494         * English.lproj/InfoPlist.strings: Update to match above.
15495
15496 2003-01-09  Maciej Stachowiak  <mjs@apple.com>
15497
15498         Reviewed by Dave.
15499
15500         - fixed Radar 3143013 - hang trying to load spiny.com/software
15501         
15502         * khtml/rendering/render_table.cpp:
15503         (RenderTable::layoutRows): Check for the render root as a loop
15504         termination condition, to avoid an infinite loop for an absolute
15505         but non-fixed table cell.
15506
15507 2003-01-09  David Hyatt  <hyatt@apple.com>
15508
15509         The "flow-mode" quirk for lists is just that - a quirk, and should
15510         not be applied when in strict mode.
15511
15512         Fixes diveintomark.org's navigation bar on the front page (issue #2
15513         on his list).
15514         
15515         Reviewed by darin and maciej
15516
15517         * khtml/css/html4.css:
15518
15519 2003-01-08  David Hyatt  <hyatt@apple.com>
15520
15521         Finish the KONQBLOCK removal and make sure that table rows and
15522         cells encountered inside stray content cause the stray content to
15523         close so that the rows and cells can be part of the table.
15524
15525         This fixes the versiontracker bug.  #3142319.
15526         
15527         Reviewed by darin.
15528
15529         * khtml/html/htmlparser.cpp:
15530         (KHTMLParser::reset):
15531         (isTableRelatedTag):
15532         (KHTMLParser::insertNode):
15533         (KHTMLParser::popOneBlock):
15534         * khtml/html/htmlparser.h:
15535
15536 2003-01-08  David Hyatt  <hyatt@apple.com>
15537
15538         Revert the redundancy that dirk noticed.
15539
15540         Fixing issue #3 on diveintomark.org's list, which actually involved
15541         merging calcAbsoluteVertical to KHTML's trunk and then fixing
15542         a math error in the bottom computation.
15543         
15544         * khtml/html/html_baseimpl.cpp:
15545         (HTMLBodyElementImpl::parseAttribute):
15546         * khtml/rendering/render_box.cpp:
15547         (RenderBox::calcAbsoluteVertical):
15548
15549 2003-01-08  Chris Blumenberg  <cblu@apple.com>
15550
15551         Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html
15552
15553         Reviewed by dave.
15554
15555         * kwq/KWQKHTMLPart.mm:
15556         (KWQKHTMLPart::createPart): call [_bridge frameRequiredForMIMEType:] to determine if we should create a plug-in view or iframe 
15557         * kwq/WebCoreBridge.h: add frameRequiredForMIMEType:
15558
15559 2003-01-08  Trey Matteson  <trey@apple.com>
15560
15561         3136213 - Page loads stopped by backtracking don't finish when moving forward
15562
15563         We need to remove the entry from the KHTML image cache when a load
15564         has an error, so it will be reloaded next time we try.  
15565
15566         Reviewed by Darin,
15567
15568         * khtml/misc/loader.cpp:
15569         (Loader::slotFinished):  Remove cache entry on job error.
15570
15571 2003-01-08  Darin Adler  <darin@apple.com>
15572
15573         Reviewed by Dave.
15574
15575         - fixed 96/72 dpi snafu; no need to do something different for AppKit,
15576           because it always uses pixel sizes, not font size
15577
15578         * khtml/css/css_valueimpl.cpp:
15579         * khtml/css/css_valueimpl.h:
15580         * khtml/css/cssstyleselector.cpp:
15581         * kwq/KWQPaintDeviceMetrics.mm:
15582         Rolled out change from 2002-12-05
15583
15584         - a cut at implementing heretofore unimplemented QTextStream classes
15585
15586         * kwq/KWQTextStream.h:
15587         * kwq/KWQTextStream.mm:
15588         First cut implementation.
15589
15590 2003-01-05  Maciej Stachowiak  <mjs@apple.com>
15591
15592         Reviewed by no one cause I'm just changing copyright strings.
15593
15594         * WebCore.pbproj/project.pbxproj: Added non-Apple copyrights to
15595         copyright strings.
15596         * English.lproj/InfoPlist.strings: Likewise.
15597
15598 2003-01-05  Darin Adler  <darin@apple.com>
15599
15600         * Resources/Info.plist: Fix "Apple Compupter" typo.
15601
15602 2003-01-04  Trey Matteson  <trey@apple.com>
15603
15604         3098388 - Pressing the back button goes back two levels at allmusic.com 
15605
15606         When processing an assignment to document.location, allow items to be added
15607         to history.  This parallels the existing treatment of window.location.href.
15608
15609         Reviewed by Richard, Darin
15610
15611         * khtml/ecma/kjs_html.cpp:
15612         (KJS::HTMLDocument::putValue):  Pass false for lockHistory arg of scheduleRedirection()
15613
15614 2003-01-04  Richard Williamson   <rjw@apple.com>
15615
15616         I checked in kjs_window.cpp by accident.  The only change
15617         was a logging printf.  Back out that change.
15618         
15619         Reviewed by me.
15620
15621         * khtml/ecma/kjs_window.cpp:
15622         (WindowFunc::tryCall):
15623
15624 2003-01-03  Richard Williamson   <rjw@apple.com>
15625
15626         Fix for 3138425. Don't open a new window when document.open() is called
15627         with < 2 parameters.
15628         
15629         Reviewed by darin.
15630
15631         * khtml/ecma/kjs_html.cpp:
15632         (KJS::HTMLDocFunction::tryCall):
15633         * khtml/ecma/kjs_window.cpp:
15634         (WindowFunc::tryCall):
15635
15636 2003-01-03  Richard Williamson   <rjw@apple.com>
15637
15638         Fixed 3138743, 3138678, and 3138854.  Removed the RenderText
15639         widths cache, replaced it with a much simply monospace character
15640         cache.  Should be much faster for covered cases too!  Also fixed
15641         buffer overrun problem causing the crash in 3138854.
15642         
15643         Reviewed by darin.
15644
15645         * khtml/rendering/font.cpp:
15646         (Font::isFixedPitch):
15647         * khtml/rendering/font.h:
15648         * khtml/rendering/render_text.cpp:
15649         (TextSlave::checkSelectionPoint):
15650         (RenderText::RenderText):
15651         (RenderText::setStyle):
15652         (RenderText::~RenderText):
15653         (RenderText::shouldUseMonospaceCache):
15654         (RenderText::cacheWidths):
15655         (RenderText::widthFromCache):
15656         (RenderText::trimmedMinMaxWidth):
15657         (RenderText::calcMinMaxWidth):
15658         (RenderText::setText):
15659         (RenderText::width):
15660         * khtml/rendering/render_text.h:
15661         * kwq/KWQFont.h:
15662         * kwq/KWQFont.mm:
15663         (QFont::isFixedPitch):
15664         * kwq/WebCoreTextRendererFactory.h:
15665         * kwq/WebCoreTextRendererFactory.m:
15666         (-[WebCoreTextRendererFactory isFontFixedPitch:]):
15667
15668 2003-01-03  John Sullivan  <sullivan@apple.com>
15669         
15670         - fixed 3138673 -- reproducible crash in JavaScript
15671
15672         Reviewed by Darin, OK'ed by Don.
15673
15674         * khtml/xml/dom_docimpl.cpp:
15675         (DocumentImpl::setTitle):
15676         Check for nil view or nil part before dereferencing.
15677
15678 2003-01-03  David Hyatt  <hyatt@apple.com>
15679
15680         Fix for percentage table heights.  A check was missing to
15681         look for a fixed height on the containing block.
15682         
15683         Reviewed by darin
15684
15685         * khtml/rendering/render_table.cpp:
15686         (RenderTable::layoutRows):
15687
15688 === Alexander-48 ===
15689
15690 2003-01-02  David Hyatt  <hyatt@apple.com>
15691
15692         Fix for 3136473.  <object>s with no specified size should be
15693         0x0.  They should not be 300x200.  Fixes thinker.org.
15694         
15695         Reviewed by john and darin.
15696
15697         * khtml/rendering/render_frames.cpp:
15698         (RenderPart::intrinsicWidth):
15699         (RenderPart::intrinsicHeight):
15700
15701 2003-01-02  Darin Adler  <darin@apple.com>
15702
15703         Reviewed by Maciej and Trey.
15704
15705         - fixed 3138063 -- REGRESSION: JavaScript-submitted form activates input type=image (webmail.mac.com)
15706
15707         JavaScript-submitted forms must not get a submit button activated as return-key-submitted ones do.
15708
15709         * khtml/html/html_formimpl.h: Add boolean activateSubmitButton parameter to submit.
15710         * khtml/html/html_formimpl.cpp:
15711         (HTMLFormElementImpl::prepareSubmit): Pass true for activateSubmitButton.
15712         (HTMLFormElementImpl::submit): Only activate a button if activateSubmitButton is true.
15713
15714         * khtml/dom/html_form.cpp: (HTMLFormElement::submit): Pass false for activateSubmitButton.
15715
15716 2003-01-02  David Hyatt  <hyatt@apple.com>
15717
15718         Fix for the 3137790.   This patch passes the mouse event x and y as 
15719         distinct arguments to constructZTree, so that the damageRect can 
15720         really reflect your clip rect.  
15721         This allows me to prune out layers that are clipped so
15722         that if x,y aren't inside the clip rect, the layer doesn't get added to
15723         the list.
15724
15725         This patch also makes the "clip" property apply to the element that specifies the clip instead of to the element's kids.  This is ambiguous in the spec, but it turns out other browsers do it this way, so there really is an interpretation that must be fol
15726
15727
15728 lowed. :)
15729         
15730         Reviewed by darin
15731
15732         * khtml/rendering/render_layer.cpp:
15733         (RenderLayer::nodeAtPoint):
15734         (RenderLayer::constructZTree):
15735         * khtml/rendering/render_layer.h:
15736
15737 2003-01-02  David Hyatt  <hyatt@apple.com>
15738
15739         Fix for bug #3137935.  When a float causes a line to get
15740         moved down past the float, the line would incorrectly break
15741         rather than expanding to use the newly-available width.
15742         
15743         Reviewed by darin.
15744
15745         * khtml/rendering/bidi.cpp:
15746         (RenderFlow::findNextLineBreak):
15747
15748 2003-01-02  Darin Adler  <darin@apple.com>
15749
15750         Reviewed by John.
15751
15752         - fixed 3131190 -- <textarea wrap="hard"> eats text on blur
15753
15754         * kwq/KWQTextArea.mm: (-[KWQTextArea paragraphs]): Add missing parentheses so we don't
15755         always return 0 or 1 for the number of paragraphs.
15756
15757 2002-12-31  Maciej Stachowiak  <mjs@apple.com>
15758
15759         Reviewed by Darin.
15760
15761         - fixed 3130831 - HOMEPAGE: JavaScript that tries to intercept onmousedown fails, image gets dragged instead
15762         - fixed 3125554 - while dragging to select text in a nested frame, you can start dragging a link or image
15763         
15764         * kwq/KWQKHTMLPart.h:
15765         * kwq/KWQKHTMLPart.mm:
15766         (KWQKHTMLPart::KWQKHTMLPart): Initialize new mouseDownMayStartDrag
15767         and mouseDownMayStartSelect methods.
15768         (KWQKHTMLPart::khtmlMousePressEvent): Make sure a mouse down
15769         won't be used to start a drag or selection if the default action
15770         is prevented on the mouse down event.
15771         (KWQKHTMLPart::mouseDown): Since the default action wasn't
15772         prevented, decide if this might be the start of a drag or
15773         selection.
15774         (KWQKHTMLPart::khtmlMouseMoveEvent): On a drag or selection, call
15775         back to the bridge to handle selection or autoscrolling
15776         appropriately.
15777         * kwq/WebCoreBridge.h: Prototype new methods.
15778
15779 2003-01-01  Darin Adler  <darin@apple.com>
15780
15781         Reviewed by Don.
15782
15783         - fixed 3137566 -- non-reproducible nil-dereference in KHTMLView::clearPart
15784         deallocating KWQPageState
15785
15786         * kwq/KWQPageState.mm: (-[KWQPageState dealloc]): Add nil check.
15787
15788 2003-01-01  David Hyatt  <hyatt@apple.com>
15789
15790         Fix tables so that malformations inside them are properly pulled
15791         out of the table without being flattened. 
15792
15793         Fixes 3131480.
15794         
15795         Reviewed by gramps
15796
15797         * khtml/html/dtd.cpp:
15798         (DOM::checkChild):
15799         * khtml/html/htmlparser.cpp:
15800         (KHTMLParser::insertNode):
15801
15802 === Alexander-47 ===
15803
15804 2002-12-30  Darin Adler  <darin@apple.com>
15805
15806         Reviewed by Trey.
15807
15808         - fixed 3132141 -- enter key does not work with input type=image
15809
15810         Made the logic handle image and submit type inputs in the same way.
15811
15812         * khtml/html/html_formimpl.h: Remove unused m_clicked flags.
15813         * khtml/html/html_formimpl.cpp:
15814         (HTMLButtonElementImpl::HTMLButtonElementImpl): Remove code to set the m_clicked flag.
15815         The only place this flag was looked at is better handled by the m_activeSubmit flag.
15816         (HTMLButtonElementImpl::defaultEventHandler): Remove more m_clicked flag code.
15817         (HTMLInputElementImpl::HTMLInputElementImpl): Remove more m_clicked flag code.
15818         (HTMLInputElementImpl::isSuccessfulSubmitButton): An image is also a successful submit
15819         button, and unlike a submit element, it doesn't require a name because it will just submit
15820         x and y with no name in that case. I suppose we could rename this function, but I think it's
15821         still a pretty clear name even if not 100% accurate.
15822         (HTMLInputElementImpl::encoding): Remove use of m_clicked and use m_activeSubmit instead.
15823         This was the only place using m_clicked at all. Also remove bogus check for a -1 coordinate.
15824         The coordinate defaults to 0, not -1, and it was never happening.
15825         (HTMLInputElementImpl::defaultEventHandler): Remove more m_clicked flag code.
15826
15827 2002-12-30  David Hyatt  <hyatt@apple.com>
15828
15829         Fix for 3129016, make sure that zero-height tables and lists
15830         will be skipped in a search for floats that occur before
15831         them.  Makes usatoday work.
15832         
15833         Reviewed by gramps
15834
15835         * khtml/rendering/render_flow.cpp:
15836         (RenderFlow::clearFloats):
15837
15838 2002-12-30  Darin Adler  <darin@apple.com>
15839
15840         Reviewed by Maciej.
15841
15842         - fixed 3135642 -- ad frames are missing at channels.netscape.com
15843
15844         * khtml/rendering/render_frames.cpp: (RenderPartObject::updateWidget): Updated to use the
15845         same rule as Mozilla: Empty URL for an iframe means "about:blank".
15846
15847         * khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Loosen things so that it's safe for
15848         a frame to manipulate an empty child frame, as well as an empty opened window. Also remove
15849         the useless check for an empty document -- it never happens in practice.
15850
15851 2002-12-30  Ken Kocienda  <kocienda@apple.com>
15852
15853         Reviewed by Darin and Gramps
15854
15855         Fix for this bug:
15856
15857         Radar 3136795 (type URL with ../ in it, get assertion)
15858
15859         The code to remove relative portions from URLs was eating leading slashes on
15860         URL paths. This caused absolute paths with relative portions to get mangled,
15861         resulting in a URL that the engine could not use. Now, leading slashes are no
15862         longer removed from URL paths, resulting in usuable URLs.
15863
15864         * kwq/KWQKURL.mm:
15865         (copyPathRemovingDots)
15866
15867 2002-12-29  Darin Adler  <darin@apple.com>
15868
15869         Reviewed by Don.
15870
15871         - fixed 3103287 -- body of page not rendered (page uses JavaScript trick to be both a frameset and a frame)
15872
15873         Our self-reference protection prevented this page from working.
15874         To fix the bug, I did three things:
15875
15876             1) fixed the hole in the WebCore self-reference protection, so we could remove the WebKit one
15877                (the hole was that it didn't ignore #xxx suffixes)
15878             2) moved the self-reference protection into a single function so it wasn't copied and pasted all over
15879             3) allowed one level of self-reference; still enough to prevent infinite recursion
15880
15881         Then I tested with the site from bug 3103287 and the one from bug 3083732 to make sure that was still OK.
15882
15883         * khtml/html/html_baseimpl.h: Added isURLAllowed().
15884         * khtml/html/html_baseimpl.cpp:
15885         (HTMLFrameElementImpl::isURLAllowed): Added. Does the self-reference check and the "local only" check.
15886         This logic was repeated in three different places before. Note that since we don't use the "local only"
15887         feature, it's not too risky to slightly change how it works.
15888         (HTMLFrameElementImpl::updateForNewURL): Use isURLAllowed.
15889         (HTMLFrameElementImpl::attach): Ditto.
15890         (HTMLIFrameElementImpl::attach): Ditto.
15891
15892 2002-12-29  Darin Adler  <darin@apple.com>
15893
15894         Reviewed by Don.
15895
15896         - fixed 3130566 -- REGRESSION: list item numbers are overlapping the text of the list items
15897
15898         Moved the hack that handles list items that are not in lists out of the parser and into
15899         the DOM and Render tree code itself. This fixes the issue where the parser doesn't know which
15900         will be the parent node of the list item, and other problems with the old hack.
15901
15902         * khtml/html/html_listimpl.cpp: (HTMLLIElementImpl::attach): Find the parent list (OL or UL).
15903         If there is no parent list, set a "not in list" flag on the render object so it knows to render
15904         "inside" no matter what the style says. Also use this parent and a safer check to make the
15905         start attribute work even when there is an intervening DOM element in the hierarchy.
15906
15907         * khtml/html/htmlparser.cpp: (KHTMLParser::getElement): Remove the code that tries to set
15908         the style of an LI based on the current node at the time it's parsed, because the current node
15909         is now often not the OL or the UL due to our DTD fix to allow other nodes in lists.
15910
15911         * khtml/rendering/render_list.h: Add isInside() to RenderListMarker, setNotInList(), notInList(),
15912         and _notInList to RenderListItem.
15913
15914         * khtml/rendering/render_list.cpp:
15915         (RenderListItem::RenderListItem): Initialize _notInList to false.
15916         (RenderListMarker::paintObject): Use isInside() instead of checking listStylePosition().
15917         (RenderListMarker::calcMinMaxWidth): Ditto.
15918         (RenderListMarker::baselinePosition): Ditto.
15919         (RenderListMarker::isInside): Return true if we are not in a list, or if "inside" style is requested.
15920
15921 2002-12-29  Darin Adler  <darin@apple.com>
15922
15923         Reviewed by Don.
15924
15925         - fixed 3134346 -- country menu at www.apple.com does not work when you go back to that page
15926
15927         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::openURLFromPageCache): Add call to checkCompleted().
15928
15929 2002-12-29  Darin Adler  <darin@apple.com>
15930
15931         Reviewed by Maciej.
15932
15933         - fixed 3136391 -- PianoNanny.com screens turn to garbage when resized
15934
15935         Turns out browsers pass open calls to the window object if they show up at the document
15936         with parameters. We now emulate that too.
15937
15938         * khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): If we get an open call with
15939         parameters, pass it on to the window.
15940
15941 2002-12-29  Darin Adler  <darin@apple.com>
15942
15943         Reviewed by Ken.
15944
15945         - fixed 3134560 -- Lord of the Rings desktops don't load
15946
15947         * khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Removed the APPLE_CHANGES here.
15948         The comment claims that we don't need the code because "JavaScript will do the work
15949         below on demand", but that's not true for setting the base URL. Also, the comment
15950         claims that this "adds an extra entry to the back/forward list", but testing does not
15951         bear that out.
15952
15953 === Alexander-46 ===
15954
15955 2002-12-28  Ken Kocienda  <kocienda@apple.com>
15956
15957         Reviewed by Gramps and Richard.
15958
15959         Fix for this bug:
15960
15961         Radar 3112233 (400 response when attaching files at mail.yahoo.com)
15962
15963         KHTML multipart form code called into KMimeType class to determine
15964         the mime type for file attachments, however, our implementation of
15965         KMimeType has only stubs which call ERROR.
15966
15967         I added some code into KWQKHTMLPart and WebCoreBridge so that the
15968         code in html_formimpl can call through to the WebFoundation mime
15969         file map we maintain.
15970
15971         * khtml/html/html_formimpl.cpp:
15972         (HTMLFormElementImpl::formData)
15973         * kwq/KWQKHTMLPart.h:
15974         * kwq/KWQKHTMLPart.mm:
15975         (KWQKHTMLPart::mimeTypeForFileName)
15976         * kwq/WebCoreBridge.h:
15977
15978 2002-12-26  Darin Adler  <darin@apple.com>
15979
15980         Reviewed by Don.
15981
15982         - fixed 3136262 -- Shockwave Flash at movies.yahoo.com does not work
15983
15984         * khtml/rendering/render_frames.cpp: (RenderPartObject::updateWidget):
15985         Moved the class ID special case MIME types out of the if statement so they can be shared
15986         in the case where we have an embed tag but no MIME type.
15987
15988 2002-12-26  Darin Adler  <darin@apple.com>
15989
15990         Reviewed by Don.
15991
15992         * kwq/KWQAssertions.h: Fixed CRASH macro to use 0xbbadbeef instead of 0xbadbeef
15993         to reduce the chance that the address will be valid once we have allocated a lot of memory.
15994
15995 2002-12-24  Richard Williamson   <rjw@apple.com>
15996
15997         Fix for 3134543 (and widely reported dupes).  Don't use render_text
15998         widths cache except for whitespace == PRE.  The problem was that additional
15999         spaces in the RenderText's string were being inappropiately measured.
16000         An alternate, more complex and risky, fix would account for the whitespace
16001         properties during scanning of the RenderText width buffer.  Considering 
16002         the scenario for which this optimization was added (3133261), this
16003         simpler fix is adequate.
16004         
16005         Reviewed by Darin and Don.
16006
16007         * khtml/rendering/render_text.cpp:
16008         (RenderText::computeWidths):
16009
16010 2002-12-24  Darin Adler  <darin@apple.com>
16011
16012         Reviewed by Don.
16013
16014         - fixed 3135010 -- nil-dereference in KHTMLPart::xmlDocImpl() at channels.netscape.com
16015
16016         * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::contentDocument):
16017         Add missing nil check. Also added lots of FIXME comments about problems I observed here.
16018
16019 2002-12-24  Darin Adler  <darin@apple.com>
16020
16021         Reviewed by Richard and Don.
16022
16023         - fixed 3133207 -- crash in HTMLFrameElementImpl updateForNewURL at home.real.com
16024
16025         My previous attempt to fix this dealt with the case where a RenderFrame object was
16026         not yet created, but not with the case where a RenderFrame object was created without
16027         a corresponding part. Somehow I overlooked this last time when I was doing testing.
16028         Testing this time confirms this takes care of the remaining problem at movies.real.com.
16029
16030         * khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::updateForNewURL):
16031         Use the same kind of requestFrame call here as in attach when there's a RenderFrame,
16032         but no corresponding part. Maybe we can fix this an even more elegant way later.
16033
16034 === Alexander-45 ===
16035
16036 2002-12-23  Darin Adler  <darin@apple.com>
16037
16038         Reviewed by John.
16039
16040         - fixed 3134558 -- REGRESSION: Lord of the Rings site problems
16041
16042         This regression was caused when we fixed the abcnews.com problem (3124933).
16043
16044         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::createEmptyDocument):
16045         Despite its name, this function was never intended to overwrite an existing document with
16046         an empty document. When we changed it do do the creation in a better way, we lost the
16047         check that prevents it from doing anything at all if we already have a document.
16048
16049 2002-12-22  Darin Adler  <darin@apple.com>
16050
16051         Reviewed by Don.
16052
16053         - fixed 3134383 -- crash in KWQKHTMLPart::canCachePage at www.apple.com
16054
16055         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::canCachePage):
16056         Check for nil in the result of Window::retrieveWindow.
16057
16058 === Alexander-44 ===
16059
16060 2002-12-20  Darin Adler  <darin@apple.com>
16061
16062         Reviewed by Trey and Don.
16063
16064         - fixed 3132160 -- meta refresh does not work if there's a space after the refresh interval value
16065
16066         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::processHttpEquiv):
16067         Added a call to stripWhiteSpace here. The other places that processes delays for
16068         meta refresh already had the stripWhiteSpace call, but this was missing it.
16069
16070 2002-12-20  David Hyatt  <hyatt@apple.com>
16071
16072         Fix for 3134163, a regression from the reduction of
16073         styleForElement calls.  Make sure image buttons
16074         get the width attribute and add it to style info
16075         before styleForElement gets called.
16076         
16077         Reviewed by rjw
16078
16079         * khtml/html/html_formimpl.cpp:
16080         (HTMLInputElementImpl::attach):
16081
16082 2002-12-20  David Hyatt  <hyatt@apple.com>
16083
16084         Fix for 3134133. Back out the render_text code I gave to rjw
16085         to check in.  It wasn't filling in a value for hasBreak, so it
16086         became random whether or not you'd break or not.
16087         
16088         Reviewed by rjw
16089
16090         * khtml/rendering/render_text.cpp:
16091         (RenderText::trimmedMinMaxWidth):
16092         (RenderText::calcMinMaxWidth):
16093         * khtml/rendering/render_text.h:
16094
16095 2002-12-20  Darin Adler  <darin@apple.com>
16096
16097         Reviewed by Trey.
16098
16099         - fixed 3133801 -- REGRESSION: Japanese page comes up hash
16100
16101         * khtml/khtml_part.cpp: (KHTMLPart::write): Roll back to original KHTML code here,
16102         removing the "all ASCII" optimization.
16103
16104 2002-12-20  David Hyatt  <hyatt@apple.com>
16105
16106         Fix for 3133081, slashdot messed up when changing font sizes.
16107         setStyle in RenderFlow was messed up for continuations.  A
16108         block in the middle of a continuation incorrectly propagated
16109         its style to the following inlines.
16110         
16111         Reviewed by darin
16112
16113         * khtml/rendering/render_flow.cpp:
16114         (RenderFlow::setStyle):
16115
16116 2002-12-20  Richard Williamson   <rjw@apple.com>
16117
16118         Fix for 3133601.  Play the same trick we do in
16119         KHTMLPartBrowserExtension::openURLRequest to create an empty
16120         document if necessary.
16121         
16122         Reviewed by darin.
16123
16124         * khtml/ecma/kjs_window.cpp:
16125         (Window::get):
16126
16127 2002-12-19  David Hyatt  <hyatt@apple.com>
16128
16129         Remove the clip hack from setLayout and make it
16130         asynchronous instead.  This fixes the crasher
16131         on autosite.com, which had a sync layout occur
16132         while in the middle of making a block box's
16133         children get wrapped in anonymous boxes.  It
16134         was only half done when the layout got
16135         triggered, which is what caused the assert to fire.
16136
16137         The bug # is 3129534.
16138         
16139         Reviewed by rjw
16140
16141         * khtml/khtmlview.cpp:
16142         (KHTMLView::KHTMLView):
16143         (KHTMLView::timerEvent):
16144         (KHTMLView::scheduleRelayout):
16145         * khtml/khtmlview.h:
16146         * khtml/rendering/render_object.cpp:
16147         (RenderObject::setLayouted):
16148         (RenderObject::scheduleRelayout):
16149         * khtml/rendering/render_object.h:
16150
16151 2002-12-20  Darin Adler  <darin@apple.com>
16152
16153         Reviewed by John.
16154
16155         - fixed 3129387 -- Stopped responding to controls while filling out form (exception in KWQTextArea)
16156
16157         * kwq/KWQTextArea.mm:
16158         (-[KWQTextArea getCursorPositionAsIndex:inParagraph:]): Fix code that was returning the wrong
16159         paragraph number along with the index within the paragraph. Also made it return a paragraph one
16160         past the end with an index of 0 for cases where you are at the end of the text.
16161         (-[KWQTextArea setCursorPositionToIndex:inParagraph:]): Range check the passed-in index. This
16162         would also have prevented the exception.
16163
16164 === Alexander-43 ===
16165
16166 2002-12-20  Darin Adler  <darin@apple.com>
16167
16168         Reviewed by John.
16169
16170         - fixed 3132382 -- crash in khtml::CachedImage
16171
16172         The source of this bug was my long-ago fix to bug 3079499.
16173         I changed the code to copy the clients list. But this doesn't work if
16174         one of the clients is removed while iterating because it's deleted.
16175         So I made a new class, CachedObjectClientWalker, that does the iterating safely.
16176         Now both this new bug and the original are fixed.
16177
16178         * khtml/misc/loader.cpp:
16179         (CachedCSSStyleSheet::checkNotify): Use CachedObjectClientWalker to walk the list.
16180         (CachedScript::checkNotify): Ditto.
16181         (CachedImage::do_notify): Ditto.
16182         (CachedImage::movieStatus): Ditto.
16183         (CachedImage::checkNotify): Ditto.
16184         (CachedObjectClientWalker::next): Walk the list using a list iterator, which is
16185         safe against the current item being removed. But go that safety one better by making
16186         sure you don't miss the item after one that's removed.
16187
16188 2002-12-20  Ken Kocienda  <kocienda@apple.com>
16189
16190         Reviewed by Darin
16191
16192         Fix for this bug:
16193
16194         Radar 3132171 (trying to login at mypage.apple.com gives "Already Connected" message)
16195
16196         The issue is that we submit the login form more than once when the user hits
16197         the return key to submit rather than clicking the submit button. We are also
16198         susceptible to double form submissions from buggy scripts that ask to submit
16199         more than one form.
16200
16201         The fix is to prevent the KWQKHTMLPart from submitting more than one form by
16202         setting and checking a flag.
16203
16204         * kwq/KWQKHTMLPart.h: Add a form submit flag.
16205         * kwq/KWQKHTMLPart.mm:
16206         (KWQKHTMLPart::submitForm): Check form submit flag. Return if a form
16207         has already been submitted.
16208         (KWQKHTMLPart::setView): Reset form flag. This is done since the part 
16209         may have been retrieved for reuse from the bac/forward cache.
16210
16211 2002-12-20  Richard Williamson   <rjw@apple.com>
16212
16213         Fixed 3133261.  This fix really has two parts.  This first part
16214         fixes the stupid stack allocated buffer that caused the crash.
16215         The second part makes any RenderText with a large string perform
16216         much faster.  The page mentioned in the bug used to load and draw
16217         in about 15 minutes.  Now it loads in about 10 seconds and draws in about
16218         2 seconds.  The performance optimization caches a widths array
16219         for the string in the RenderText, and only updates that array if
16220         the font or text for the RenderText change.  
16221         
16222         Reviewed by john.
16223
16224         * khtml/rendering/render_text.cpp:
16225         (RenderText::RenderText):
16226         (RenderText::setStyle):
16227         (RenderText::~RenderText):
16228         (RenderText::computeWidths):
16229         (RenderText::widthFromBuffer):
16230         (RenderText::trimmedMinMaxWidth):
16231         (RenderText::calcMinMaxWidth):
16232         (RenderText::setText):
16233         (RenderText::width):
16234         * khtml/rendering/render_text.h:
16235
16236 2002-12-20  Trey Matteson  <trey@apple.com>
16237
16238         We now build with symbols the B&I.  Deployment builds are without symbols,
16239         so it is easy to generate a non-huge app as a one-off.
16240
16241         Reviewed by Darin
16242
16243         * WebCore.pbproj/project.pbxproj:
16244
16245 2002-12-20  Darin Adler  <darin@apple.com>
16246
16247         Reviewed by John.
16248
16249         - fixed 3129824 -- crash in QWidget::getView in KWQKHTMLPart::passSubframeEventToSubframe
16250
16251         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
16252         Check for a nil QWidget in a RenderWidget, and ERROR and return true in that case.
16253         We don't want to return false because otherwise the KHTML code will try to draw a frame splitter.
16254
16255 2002-12-20  Darin Adler  <darin@apple.com>
16256
16257         Reviewed by John.
16258
16259         - fixed 3131449 -- crash in DOMNamedNodesCollection::tryGet opening a new window from JavaScript
16260
16261         * khtml/ecma/kjs_dom.cpp: (DOMNamedNodesCollection::tryGet):
16262         Add range checking. If the index is out of range fall back to the parent tryGet,
16263         which will eventually just return Undefined().
16264
16265 2002-12-20  Darin Adler  <darin@apple.com>
16266
16267         Reviewed by Richard and John.
16268
16269         - fixed 3133207 -- crash in HTMLFrameElementImpl updateForNewURL at home.real.com
16270
16271         This refines Maciej's fix for 3052113, 3075392, and 3125412.
16272
16273         * khtml/html/html_baseimpl.h: Remove detach() and parentWidget from HTMLFrameElementImpl.
16274         * khtml/html/html_baseimpl.cpp:
16275         (HTMLFrameElementImpl::HTMLFrameElementImpl): Take out initialization of unused parentWidget.
16276         (HTMLFrameElementImpl::updateForNewURL): Add case for when we are attached by did not allocate
16277         a render object. In that case we just detach so we can attach again. Also fix the self-reference
16278         check which was in there but not working.
16279         (HTMLFrameElementImpl::detach): Remove method since all it did was set unused parentWidget. 
16280         (HTMLIFrameElementImpl::attach): Remove unused depth computation.
16281
16282         - fixed more leaks
16283
16284         * khtml/rendering/render_replaced.h: Made the deref method inherited from khtml::Shared
16285         private by using private inheritance. Changed the name of arenaDeref to deref, but it still
16286         takes an arena parameter. Now incorrect deref's are compile-time errors instead of potential leaks.
16287         * khtml/rendering/render_replaced.cpp:
16288         (RenderWidget::detach): Rename arenaDeref to deref.
16289         (RenderWidget::resizeWidget): Ditto.
16290         (RenderWidget::eventFilter): Ditto.
16291         (RenderWidget::deref): Ditto.
16292
16293         * khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked):
16294         Pass the arena when deref'ing the RenderFormElement.
16295         * kwq/WebCoreBridge.h: Add a field for the arena for the RenderPart.
16296         * kwq/WebCoreBridge.mm:
16297         (-[WebCoreBridge dealloc]): Pass the arena when deref'ing the RenderPart.
16298         (-[WebCoreBridge setRenderPart:]): Pass the arena when deref'ing the RenderPart. Store the arena
16299         of the new part when storing the part pointer.
16300
16301         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::~DocumentImpl): Assert that the render object is
16302         not nil, in an attempt to catch a leak I observed yesterday.
16303
16304 2002-12-20  Darin Adler  <darin@apple.com>
16305
16306         Reviewed by Dave.
16307
16308         - fixed 3129129 -- leak of 820 RenderStyle objects each time we run cvs-base
16309
16310         The RenderStyle objects were the tip of an iceberg.
16311         
16312         I fixed a lot of leaks, but there are still some remaining.
16313
16314         Note that these changes will make Development builds slower because they disable
16315         the arena allocator in favor of assertions that check we are using it correctly.
16316         But the changes make Deployment builds slightly faster.
16317
16318         * khtml/html/html_baseimpl.cpp: (HTMLFrameSetElementImpl::attach):
16319         Fix a leak in the !isStyleAvailable() case by ref'ing and deref'ing the style.
16320
16321         * khtml/html/html_formimpl.cpp:
16322         (HTMLFormElementImpl::attach): Fix a leak by getting the style from the render
16323         object instead of calling styleForElement again, which makes a new one.
16324         (HTMLFormElementImpl::parseAttribute): Ditto.
16325         (HTMLInputElementImpl::attach): Fix a leak by using the style in the local
16326         variable rather than calling styleForElement again.
16327
16328         * khtml/html/html_imageimpl.cpp:
16329         (HTMLImageElementImpl::parseAttribute): Fix a leak by getting the style from the render
16330         object instead of calling styleForElement again, which makes a new one.
16331         (HTMLImageElementImpl::attach): Fix a leak by using the style in the local
16332         variable rather than calling styleForElement again.
16333
16334         * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
16335         Fix a leak in the display() == NONE case by ref'ing and deref'ing the style.
16336
16337         * khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach): Fix a leak by using
16338         the style in the local variable rather than calling styleForElement again.
16339
16340         * khtml/rendering/bidi.cpp:
16341         (BidiIterator::detach): Added debugging code to detect if someone does a delete directly,
16342         which will not deallocate the object because it won't run the correct arena code.
16343         (BidiIterator::operator delete): Ditto.
16344         (appendRunsForObject): Fix a leak by detaching bidi iterators when they are removed from
16345         the list. The list can't delete them because it doesn't have the arena pointer.
16346         (deleteMidpoints): Fix a leak by not removing the items from the list until done iterating.
16347         The old code would fail to delete half the items.
16348
16349         * khtml/rendering/render_container.cpp:
16350         (RenderContainer::detach): Detach the continuation here. Before we removed it but did not
16351         detach it, which led to a leak.
16352         (RenderContainer::removeChild): Do not remove the continuation here. If we do, then we can't
16353         detach successfully. No one depends on this removing the continuation.
16354         (RenderContainer::removeLeftoverAnonymousBoxes): Detach the child, don't just delete it.
16355         This fixes a leak.
16356
16357         * khtml/rendering/render_flow.cpp: (RenderFlow::removeChild): Detach the child, don't just
16358         delete it. This fixes a leak.
16359
16360         * khtml/rendering/render_object.h: Added arenaDelete.
16361         * khtml/rendering/render_object.cpp:
16362         (RenderObject::operator delete): Added debugging code to detect if someone does a delete directly,
16363         which will not deallocate the object because it won't run the correct arena code.
16364         (RenderObject::detach): Ditto.
16365         (RenderObject::arenaDelete): Put the low-level delete here, so that subclasses (RenderWidget)
16366         can call it.
16367
16368         * khtml/rendering/render_replaced.h: Add arenaDeref and make deref private so derived classes
16369         won't use it by accident.
16370         * khtml/rendering/render_replaced.cpp:
16371         (RenderWidget::detach): Use the new arenaDeref instead of deref, since we need to pass the
16372         arena pointer in to delete.
16373         (RenderWidget::resizeWidget): Ditto. Store the arena before calling back, since we can't get it
16374         once it's detached from its parent.
16375         (RenderWidget::eventFilter): Ditto.
16376         (RenderWidget::arenaDeref): Added. Calls RenderObject's arenaDelete.
16377
16378         - other changes
16379
16380         * khtml/rendering/render_arena.cpp:
16381         (RenderArena::allocate): Added debugging code that stores a signature, arena pointer, and size,
16382         and uses malloc rather than the arena.
16383         (RenderArena::free): Check the signature, arena pointer, and size, and use free.
16384
16385         * khtml/rendering/render_layer.cpp:
16386         (RenderLayer::operator delete): Added debugging code to detect if someone does a delete directly,
16387         which will not deallocate the object because it won't run the correct arena code.
16388         (RenderLayer::detach): Ditto.
16389         (RenderLayer::RenderLayerElement::operator delete): Ditto.
16390         (RenderLayer::RenderLayerElement::detach): Ditto.
16391         (RenderLayer::RenderZTreeNode::operator delete): Ditto.
16392         (RenderLayer::RenderZTreeNode::detach): Ditto.
16393
16394         * khtml/rendering/render_text.cpp:
16395         (TextSlave::detach): Added debugging code to detect if someone does a delete directly,
16396         which will not deallocate the object because it won't run the correct arena code.
16397         (TextSlave::operator delete): Ditto.
16398
16399         * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
16400         Save one new/delete by using a stack-based HTMLTokenizer and add FIXMEs about
16401         some possible leaks I spotted here.
16402
16403         * khtml/rendering/render_list.cpp: (RenderListItem::setStyle): Took out APPLE_CHANGES from around
16404         a generally useful bug fix.
16405
16406         * WebCore.pbproj/project.pbxproj: Let Electron be Electron. 
16407
16408 === Alexander-42 ===
16409
16410 2002-12-19  David Hyatt  <hyatt@apple.com>
16411
16412         Fix for 3129393, crasher on sundancecatalog.com.  There
16413         are two elements to this fix.  The basic problem was that
16414         sundancecatalog was saying:
16415
16416         <table style="display: inline">
16417
16418         In WinIE, this turns into an inline-table and not an inline.
16419         In Gecko this does not happen.  Like Gecko, we treated this
16420         as an inline, so we triggered a problem in my inline splitting
16421         code.  
16422
16423         The first fix was to bulletproof my inline splitting code to
16424         ensure all new render objects are fully connected before children
16425         are added, so that you can get to renderArenas at all times.
16426
16427         The second fix implements the WinIE quirk and turns the table
16428         into an inline-table so that you avoid a complete garbage
16429         render tree.
16430         
16431         Reviewed by trey
16432
16433         * khtml/css/html4.css:
16434         * khtml/rendering/render_flow.cpp:
16435         (RenderFlow::layout):
16436         (RenderFlow::splitFlow):
16437         (RenderFlow::addChildToFlow):
16438         * khtml/rendering/render_flow.h:
16439         * khtml/rendering/render_list.cpp:
16440         (RenderListMarker::lineHeight):
16441         * khtml/rendering/render_list.h:
16442         * khtml/rendering/render_object.cpp:
16443         (RenderObject::createObject):
16444         * khtml/rendering/render_table.cpp:
16445         (RenderTable::lineHeight):
16446         (RenderTable::baselinePosition):
16447         (RenderTable::setStyle):
16448         * khtml/rendering/render_table.h:
16449
16450 2002-12-19  Darin Adler  <darin@apple.com>
16451
16452         Reviewed by John.
16453
16454         A number of non-reproducible bugs look like they may be due to bad
16455         event objects. I was assuming that callers retained the events until
16456         the functions handling them returned, but that assumption may be wrong.
16457         So I'm retaining/releasing the current event. This is correct in any case.
16458         I'm also adding a new assertion, but since assertions are in Development
16459         builds only that is very low risk.
16460
16461         * kwq/KWQKHTMLPart.mm:
16462         (KWQKHTMLPart::keyEvent): Add retain/release and a new assertion.
16463         (KWQKHTMLPart::mouseDown): Ditto.
16464         (KWQKHTMLPart::mouseDragged): Ditto.
16465         (KWQKHTMLPart::mouseUp): Ditto.
16466         (KWQKHTMLPart::mouseMoved): Ditto.
16467
16468 === Alexander-41 ===
16469
16470 2002-12-18  Richard Williamson   <rjw@apple.com>
16471
16472         Added an ASSERT to ensure that 3127329 isn't still happening.
16473         This bug should have been fixed be earlier changes.
16474         
16475         Reviewed by darin.
16476
16477         * kwq/KWQPageState.mm:
16478         (-[KWQPageState dealloc]):
16479
16480 2002-12-18  Chris Blumenberg  <cblu@apple.com>
16481
16482         Fixed: 3131267 - REGRESSION: Java 1.4.1 Applets Restarted When Window is Resized
16483         Fixed: 3131244 - REGRESSION: Java 1.4.1 Multiple Copies of Applet Started When Window is Resized
16484
16485         Dave recently patched khtml with a fix for media content inside of table cells. The patch causes the java widget to get the layout call more than once. Calling layout more than once is perfectly allowed, but the java widget wasn't prepared for that and w
16486 ould create a new java view for each layout. We now only create a java view when the java view hasn't already been created.
16487
16488         Reviewed by darin.
16489
16490         * kwq/KWQKJavaAppletWidget.mm:
16491         (KJavaAppletWidget::showApplet): If the view of the widget is still a KWQView, we haven't replaced it with the Java view. This stops multiple view from being created.
16492
16493 === Alexander-40 ===
16494
16495 2002-12-18  Trey Matteson  <trey@apple.com>
16496
16497         3098388 - Pressing the back button goes back two levels at allmusic.com
16498
16499         In support of the fix for this bug, WebCore passes khtml's lockHistory setting
16500         up through the bridge.
16501
16502         Reviewed by Darin
16503
16504         * kwq/KWQKHTMLPart.mm:
16505         (KWQKHTMLPart::redirectionTimerStartedOrStopped):  Pass it along.
16506         * kwq/WebCoreBridge.h:
16507
16508 2002-12-18  Maciej Stachowiak  <mjs@apple.com>
16509
16510         Reviewed by John.
16511
16512         - fixed 3131171 - Change Alex versions to satisfy both marketing and B&I requirements
16513         
16514         * English.lproj/InfoPlist.strings:
16515
16516 2002-12-18  Maciej Stachowiak  <mjs@apple.com>
16517
16518         Reviewed by Trey and Darin.
16519
16520         - fixed 3124933 - abcnews.com leads to empty window with sheet complaining about javascript: URL
16521         - fixed 3091248 - picture does not show up in window from epinions
16522         
16523
16524         * khtml/ecma/kjs_window.cpp:
16525         (Window::get): Put back document-creating code that was in #if
16526         !APPLE_CHANGES.
16527         (Window::isSafeScript): Extend access to a window that was opened
16528         to no URL or to about:blank by the active window.
16529         (shouldLoadAsEmptyDocument): Helper for the above.
16530         (WindowFunc::tryCall): Update APPLE_CHANGES comments - now it's
16531         clear we don't need to create a document in a fresh window
16532         (accessing document will take care of that), and that it will be
16533         counter-productive, possibly adding a useless entry to the
16534         back/forward list.
16535         * khtml/khtml_part.cpp:
16536         (KHTMLPart::begin): If we're not loading a URL, make a dummy
16537         document (the call will check if we have a dummy document
16538         already).
16539         * kwq/KWQKHTMLPart.mm:
16540         (KWQKHTMLPart::createEmptyDocument): Isntead of setting up a
16541         half-assed document, ask bridge to synchronously load a fully
16542         assed (but empty) document. Renamed from createDummyDocument.
16543         * kwq/KWQKHTMLPartBrowserExtension.mm:
16544         (KHTMLPartBrowserExtension::openURLRequest): Decode script. Also,
16545         check if return value is a string - if so, write it into the
16546         document. Maybe we want this to be more general.
16547         * kwq/KWQKURL.mm:
16548         (KURL::KURL): Changed to successfully resolve absolute URLs
16549         against an empty base URL.
16550         * kwq/WebCoreBridge.h: prototyped new
16551         loadEmptyDocumentSynchronously method.
16552
16553 2002-12-18  Chris Blumenberg  <cblu@apple.com>
16554
16555         Fixed: 3052731 - qt file complains about lack of active-x handler
16556         Fixed: 3025872 - Black square where lion should be on mgm.com
16557
16558         3052731: The page has a syntax error. Notice the missing ">"? He treat this as an OBJECT without an EMBED. khtml actually has a fallback for this. They check the classid and map a mime type to it. They currently map for  realaudio and flash, but not quic
16559
16560
16561 ktime. I added a quicktime mapping as well as a mapping for shockwave.
16562
16563         3025872: khtml was unable to parse the EMBED tag within the OBJECT tag (similar to 3052731). When this happens, it looks at the classid and maps it to a mime type. This part was successful because it has a classid->mime type mapping for flash. The strang
16564
16565
16566 e thing was that it was setting the main URL of the plug-in to "dummy". The code has this comment:
16567
16568         url = "dummy"; // Not needed, but KHTMLPart aborts the request if empty
16569
16570         It does this even if the url is valid. It even handles the invalid url case before even calling the part. The fix is to disable this line of code.
16571
16572         Reviewed by trey.
16573
16574         * khtml/rendering/render_frames.cpp:
16575         (RenderPartObject::updateWidget):
16576
16577 2002-12-18  Trey Matteson  <trey@apple.com>
16578
16579         3105755 - can't log in to amex
16580
16581         The problem was on c/r khtml would not pick a submit button to add to the
16582         form state that is sent.  We now "activate" the first submit button that meets the
16583         criteria for being a "successful" form element, if no button was already
16584         activated by being clicked on.
16585
16586         Reviewed by Darin.
16587
16588         * khtml/html/html_formimpl.cpp:
16589         (HTMLFormElementImpl::submit):  Pick a submit button to use, if none was already
16590         chosen by virtue of being clicked.
16591         (HTMLButtonElementImpl::isSuccessfulSubmitButton):  New getter to support
16592         submit button selection.
16593         (HTMLButtonElementImpl::isActivatedSubmit):  New getter on existing prop.
16594         (HTMLButtonElementImpl::setActivatedSubmit):  New setter on existing prop.
16595         (HTMLInputElementImpl::isSuccessfulSubmitButton):  New getter to support
16596         submit button selection.
16597         (HTMLInputElementImpl::isActivatedSubmit):  New getter on existing prop.
16598         (HTMLInputElementImpl::setActivatedSubmit):  New setter on existing prop.
16599         * khtml/html/html_formimpl.h:  Add new methods to common superclass.
16600
16601 2002-12-17  Don Melton  <gramps@apple.com>
16602
16603         Reviewed by Joyce Chow.
16604
16605         * khtml/misc/arena.cpp:
16606         * khtml/misc/arena.h:
16607         * khtml/rendering/render_arena.cpp:
16608         * khtml/rendering/render_arena.h:
16609         * khtml/rendering/render_layer.cpp:
16610         * khtml/rendering/render_layer.h:
16611
16612         Changed copyright and licensing.
16613
16614 2002-12-17  David Hyatt  <hyatt@apple.com>
16615
16616         NOWRAP was completely broken.  This fixes the problem
16617         and makes porsche.com look ok again.
16618
16619         Bug #3131287.
16620         
16621         Reviewed by gramps
16622
16623         * khtml/rendering/bidi.cpp:
16624         (RenderFlow::findNextLineBreak):
16625
16626 2002-12-17  Darin Adler  <darin@apple.com>
16627
16628         Reviewed by Trey.
16629
16630         * WebCore.pbproj/project.pbxproj: Remove signature.
16631         * kwq/KWQColor.mm: Turn off inlining so we can build even on the
16632         compiler that warns about static data in inline functions.
16633
16634 2002-12-17  Maciej Stachowiak  <mjs@apple.com>
16635
16636         Reviewed by John.
16637
16638         - fixed 3120729 - HOMEPAGE: Can't set a DIV innerHTML property
16639         with html content starting with <html><head><head/><body>
16640         
16641         * khtml/html/html_elementimpl.cpp:
16642         (HTMLElementImpl::createContextualFragment): Pop <html> and
16643         <body>, and remove <head> to allow a full HTML document to be made
16644         and inserted as a contextual fragment.
16645
16646 === Alexander-39 ===
16647
16648 2002-12-17  David Hyatt  <hyatt@apple.com>
16649
16650         Make sure that anonymous block construction works properly
16651         when you try to insert a block in between two inlines that
16652         have already been wrapped in an anonymous block.
16653         
16654         Reviewed by mjs
16655
16656         * khtml/rendering/render_flow.cpp:
16657         (RenderFlow::addChildToFlow):
16658         (RenderFlow::makeChildrenNonInline):
16659
16660 === Alexander-38 ===
16661
16662 2002-12-16  Darin Adler  <darin@apple.com>
16663
16664         Reviewed by Don and Maciej.
16665
16666         - fixed 3129115 -- need Apple copyright added to open source documents
16667
16668         * tons of files: Added copyright message to files we modified and
16669         standardized format of copyrights too.
16670
16671         - fixed 3129235 -- assert in LRUList visiting apple.com if "Display images" preference is off
16672
16673         * khtml/misc/loader.cpp:
16674         (Cache::getLRUListFor): Use the first list for 0-sized objects.
16675         (Cache::removeFromLRUList): Allow 0-sized objects.
16676
16677         - other changes
16678
16679         * khtml/rendering/render_style.h: Remove bogus unused private constructor.
16680
16681         * kwq/KWQFont.h: Added copy constructor and assignment operator.
16682         * kwq/KWQFont.mm:
16683         (QFont::QFont): Copy constructor now retains the NSFont. The old version didn't which could
16684         cause retain/release problems.
16685         (QFont::operator=): Retain the new NSFont and release the old one.
16686
16687         * WebCore.pbproj/project.pbxproj: Set MACOSX_DEPLOYMENT_TARGET to 10.2.
16688
16689 2002-12-16  Maciej Stachowiak  <mjs@apple.com>
16690
16691         Reviewed by Darin.
16692
16693         - fixed 3125283 - HOMEPAGE: in onload of an IMG, the width and height are equal to zero
16694
16695         There were two problems here. First, the calls to get image width
16696         and height didn't force a layout in all the cases where it was
16697         required. Second, layout wouldn't lay out images at all until
16698         parsing was done, due to a hack to block inline layout until that
16699         point. I'm not sure if this will have other bad consquences, but
16700         nearly every page I tried, including Hebrew and Japanese pages as
16701         well as every page on the base PLT laid out properly.
16702
16703         * khtml/html/html_imageimpl.cpp:
16704         (HTMLImageElementImpl::width): Force a layout if not laid out.
16705         (HTMLImageElementImpl::height): Likewise.
16706         * khtml/html/htmlparser.cpp:
16707         (KHTMLParser::insertNode): Remove setBlockBidi hack - this was
16708         preventing images from getting laid out until the document was
16709         totally done parsing.
16710         * khtml/rendering/render_flow.cpp:
16711         (RenderFlow::RenderFlow): More setBLockBidi removal.
16712         (RenderFlow::layout): Likewise.
16713         (RenderFlow::close): Likewise.
16714         (RenderFlow::addChildToFlow): Likewise.
16715         (RenderFlow::printTree): Likewise.
16716         * khtml/rendering/render_flow.h:
16717         * khtml/rendering/render_object.h:
16718
16719 2002-12-16  David Hyatt  <hyatt@apple.com>
16720
16721         When a clear occurs (thus causing a block to move underneath
16722         a float), make sure the block gets a fresh layout, so that it
16723         can readjust its contents now that they don't have to flow
16724         around the float.
16725         
16726         Reviewed by darin
16727
16728         * khtml/rendering/render_flow.cpp:
16729         (RenderFlow::layoutBlockChildren):
16730
16731 2002-12-16  Richard Williamson   <rjw@apple.com>
16732
16733         Fixed 3128477.  Check KJS::Window before saving js objects.
16734
16735         Reviewed by darin.
16736
16737         * kwq/KWQKHTMLPart.mm:
16738         (KWQKHTMLPart::saveWindowProperties):
16739         (KWQKHTMLPart::saveLocationProperties):
16740         (KWQKHTMLPart::restoreWindowProperties):
16741         (KWQKHTMLPart::restoreLocationProperties):
16742
16743 === Alexander-37 ===
16744
16745 2002-12-16  Maciej Stachowiak  <mjs@apple.com>
16746
16747         Reviewed by Darin.
16748
16749         - fixed 3125412 - HOMEPAGE: 2nd load of html in the same div fails.
16750         - fixed 3052113 - HOMEPAGE: "site menu" part of .mac home page editing doesn't work
16751         - fixed 3075392 - HOMEPAGE: "pages" section of mac.com homepage editing is missing
16752
16753         * khtml/html/html_baseimpl.h:
16754         * khtml/html/html_baseimpl.cpp:
16755         (HTMLFrameElementImpl::updateForNewURL): Function that loads new URL,
16756         to be called if src attribute is set explicitly and the element is already
16757         attached.
16758         (HTMLFrameElementImpl::parseAttribute): Call updateForNewURL when src
16759         attrinute is set.
16760         (HTMLFrameElementImpl::contentDocument): Don't involve render widget
16761         in getting the content document.
16762         * khtml/html/html_elementimpl.cpp:
16763         (HTMLElementImpl::createContextualFragment): Allow contextual
16764         fragments to be created (and therefore innerHTML to be set on) TR
16765         and HTML elements.
16766
16767 2002-12-16  David Hyatt  <hyatt@apple.com>
16768
16769         Use the layer's bounds as the damage rect not the object's.
16770         The layer knows about the overflow out of the object.  The
16771         object does not.  Duh.
16772
16773         Fixes disney.com bustage.
16774         
16775         Reviewed by sullivan
16776
16777         * khtml/rendering/render_layer.cpp:
16778         (RenderLayer::constructZTree):
16779
16780 2002-12-16  David Hyatt  <hyatt@apple.com>
16781
16782         Code needs to go in calcMinMaxWidth instead, so parents computing
16783         their own minmax widths will get the correct value during the ifrst
16784         pass.  With this change weather.com is actually fixed.
16785         
16786         Reviewed by mjs
16787
16788         * khtml/rendering/render_box.cpp:
16789         (RenderBox::calcWidth):
16790         * khtml/rendering/render_flow.cpp:
16791         (RenderFlow::calcMinMaxWidth):
16792
16793 2002-12-16  David Hyatt  <hyatt@apple.com>
16794
16795         Fix for 3128843, horked layout on weather.com.  Ensure that
16796         overflow: hidden elements bounds-check their minwidth and maxwidth
16797         values to ensure that you don't grow the clipped element.
16798         
16799         Reviewed by mjs
16800
16801         * khtml/rendering/render_box.cpp:
16802         (RenderBox::calcWidth):
16803
16804 2002-12-16  Trey Matteson  <trey@apple.com>
16805
16806         3129175 - we're doing needless GETs when using b/f cache
16807
16808         Turns out that an empty UserStyle was causing WebCore to reload the base URL
16809         of the page, since it tried to load the style "".
16810
16811         Reviewed by Darin
16812
16813         * khtml/khtml_part.cpp:
16814         (KHTMLPart::reparseConfiguration):  Of the UserStyle is empty, set it to an
16815         empty string instead of an empty URL.
16816
16817 2002-12-16  Maciej Stachowiak  <mjs@apple.com>
16818
16819         Reviewed by Darin.
16820
16821         - fixed 3129008 - REGRESSION: Successive hot/cached runs of cvs-base PLT are slightly slower
16822
16823         This was due to me reintroducing a leak of the document. Now fixed.
16824         
16825         * khtml/ecma/kjs_dom.cpp:
16826         (DOMDocument::~DOMDocument): forget self from cached DOM object table.
16827         (KJS::getDOMDocumentNode): Instead of storing the document in the
16828         marked per-document table, store it in the unmarked table, and as
16829         a property on the Window object.
16830         (KJS::getDOMNode): use getDocumentNode when appropriate.
16831         * khtml/ecma/kjs_dom.h:
16832
16833
16834 2002-12-15  David Hyatt  <hyatt@apple.com>
16835
16836         Fix for 3128728.  Ensure that list markers get placed into an
16837         existing line box if possible.  This patch also fixes RTL bullets
16838         and line height calculations involving image bullets that are the
16839         biggest thing on the line.  List markers also correctly move
16840         to avoid floats.
16841
16842         Reviewed by mjs
16843
16844         * khtml/rendering/render_list.cpp:
16845         (RenderListItem::setStyle):
16846         (getLineBoxParent):
16847         (RenderListItem::layout):
16848         (RenderListMarker::calcMinMaxWidth):
16849
16850 2002-12-16  Darin Adler  <darin@apple.com>
16851
16852         Reviewed by Maciej.
16853
16854         - fixed 3128766 -- macconnection.com tries to add properties to the navigator DOM object, which fails
16855
16856         * khtml/ecma/kjs_window.cpp: (Window::get): Set up properties named navigator and clientInformation
16857         the first time either is queried. These will hold a persistent shared object rather than making one
16858         every time it's asked for.
16859
16860         * WebCore.pbproj/project.pbxproj: Let Electron undo Maciej's evil.
16861
16862 === WebKit-37u2 ===
16863
16864 2002-12-15  Maciej Stachowiak  <mjs@apple.com>
16865
16866         Reviewed by Darin.
16867
16868         * WebCore.pbproj/project.pbxproj: Updated source version to 37u2.
16869
16870 2002-12-15  Darin Adler  <darin@apple.com>
16871
16872         Reviewed by Trey.
16873
16874         - fixed regression where clicked-on buttons were getting keyboard focus
16875
16876         * kwq/KWQKHTMLPart.mm:
16877         (KWQKHTMLPart::khtmlMousePressEvent): Check clickCount here the way NSWindow does.
16878         See below for rationale.
16879         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): I didn't read the code in
16880         [NSWindow sendEvent:] that I was stealing carefully enough. The old needsPanelToBecomeKey
16881         flag is used to decide whether something should really get first responder, and I need to
16882         do check that too. And while I was in here, did the same clickCount check that NSWindow
16883         does for good measure.
16884
16885 2002-12-15  Maciej Stachowiak  <mjs@apple.com>
16886
16887         Reviewed by Darin.
16888
16889         - fixed 3128383 - DOM nodes should always use the same JS object
16890         
16891         * khtml/ecma/kjs_binding.h:
16892         * khtml/ecma/kjs_binding.cpp:
16893         (ScriptInterpreter::ScriptInterpreter): Set auto-delete to true on
16894         document dictionary.
16895         (ScriptInterpreter::getDOMObjectForDocument): New function - gets
16896         DOM object from per-document dictionary.
16897         (ScriptInterpreter::putDOMObjectForDocument): New function - put
16898         DOM object into per-document dictionary.
16899         (ScriptInterpreter::deleteDOMObjectsForDocument): Clear all
16900         objects from specific per-document dictionary.
16901         (ScriptInterpreter::mark): Mark per-document objects.
16902         (ScriptInterpreter::forgetDOMObjectsForDocument): Clear objects
16903         for this document from all interpreters.
16904         * khtml/ecma/kjs_dom.h:
16905         * khtml/ecma/kjs_dom.cpp:
16906         (KJS::getDOMNode): Use per-document rather than general DOM object
16907         dictionary.
16908         * khtml/xml/dom_docimpl.cpp:
16909         (DocumentImpl::~DocumentImpl): Call forgetDOMObjectsForDocument.
16910
16911 2002-12-15  David Hyatt  <hyatt@apple.com>
16912
16913         Fix for 3057974 and 3128713.  I needed to make frames check to
16914         see if their parentNode had a renderer to complete the FOUC
16915         fix.  Completing the FOUC fix finally solves 3057974.
16916         
16917         Reviewed by darin
16918
16919         * khtml/html/html_baseimpl.cpp:
16920         (HTMLFrameElementImpl::attach):
16921
16922 2002-12-15  David Hyatt  <hyatt@apple.com>
16923
16924         Fix for 3109226, epinions page is mostly blank.  Add a hack
16925         to disallow > but only inside attribute values for which there
16926         is no corresponding attribute name.
16927
16928         Also fix attribute values with no name so that the value is
16929         used as the name so that e.g., <option "selected"> works.
16930         
16931         Reviewed by darin
16932
16933         * khtml/html/htmltokenizer.cpp:
16934         (HTMLTokenizer::HTMLTokenizer):
16935         * khtml/html/htmltokenizer.h:
16936
16937 2002-12-15  Darin Adler  <darin@apple.com>
16938
16939         Reviewed by Dave.
16940
16941         - fixed 3127900 -- REGRESSION: text fields select all their text when clicked on with the mouse
16942
16943         * kwq/KWQKHTMLPart.h: Add _firstResponderAtMouseDownTime.
16944         * kwq/KWQKHTMLPart.mm:
16945         (KWQKHTMLPart::khtmlMousePressEvent): Don't call makeFirstResponder: if it's already set.
16946         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Using _firstResponderAtMouseDownTime, catch the
16947         case where an NSTextField's editor was just created and became first responder. In those cases,
16948         pass the mouseDown: to the text field, not the newly created editor. Even though it shouldn't make
16949         a difference it does. Also don't makeFirstResponder: if it's already set.
16950         (KWQKHTMLPart::mouseDown): Set _firstResponderAtMouseDownTime.
16951
16952         * kwq/KWQWidget.mm: (QWidget::setFocus): Don't call makeFirstResponder: if it's already set.
16953
16954 2002-12-15  David Hyatt  <hyatt@apple.com>
16955
16956         Make sure framesets don't get built twice when FOUC delays
16957         their loading.
16958         
16959         Reviewed by gramps
16960
16961         * khtml/css/cssstyleselector.cpp:
16962         * khtml/css/cssstyleselector.h:
16963         * khtml/html/html_baseimpl.cpp:
16964         (HTMLFrameSetElementImpl::attach):
16965         * khtml/rendering/render_style.cpp:
16966         (RenderStyle::operator==):
16967         (RenderStyle::isStyleAvailable):
16968         * khtml/rendering/render_style.h:
16969
16970 2002-12-15  Darin Adler  <darin@apple.com>
16971
16972         Reviewed by Dave.
16973
16974         - fixed ==/= typo in QFontMetrics that caused a part of my recent speedup to not take effect
16975         - fixed 3128582 -- REGRESSION: Crash on planetquake.com
16976
16977         * kwq/KWQFontMetrics.mm:
16978         (QFontMetricsPrivate::setFont): Fix a horrifying "== instead of =" mistake.
16979         (QFontMetrics::ascent): Give an ERROR message, don't crash, when this is called on a
16980         font metrics object that hasn't been updated to work for a particular font.
16981         (QFontMetrics::descent): Ditto.
16982         (QFontMetrics::lineSpacing): Ditto.
16983         (QFontMetrics::xHeight): Ditto.
16984         (QFontMetrics::width): Ditto.
16985         (QFontMetrics::floatWidth): Ditto.
16986         (QFontMetrics::floatCharacterWidths): Ditto.
16987
16988         * khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
16989         Eliminated what was causing us to hit the above. BR elements need to respect display() == NONE.
16990
16991         - fixed the fix for operator==; needs to work even if the pseudo type was
16992           extracted already for one of the two, and not the other
16993
16994         * khtml/css/cssparser.cpp:
16995         (CSSSelector::extractPseudoType): Only do work when the selector is Pseudo.
16996         (CSSSelector::operator==): Call pseudoType() instead of going right at _pseudoType.
16997
16998 2002-12-15  David Hyatt  <hyatt@apple.com>
16999
17000         Fix for 3128402, missing content on voodooextreme.  Don't allow
17001         object/embed inside the head.
17002         
17003         Reviewed by cblu
17004
17005         * khtml/html/dtd.cpp:
17006
17007 2002-12-15  Darin Adler  <darin@apple.com>
17008
17009         Reviewed by Ken.
17010
17011         - fixed 3127898 -- Crash going to altavista.com after visiting sony.com
17012
17013         * khtml/ecma/kjs_window.cpp: (Window::get): Change lots of properties to return "undefined"
17014         rather than crashing when the view is NULL. I'm not sure that undefined is the perfect thing
17015         to return in this case, but it's better than crashing the program. We can refine later as needed.
17016
17017         - fixed 3127157 -- REGRESSION: applet does not become first responder when clicked-on
17018         - fixed 3127934 -- Crash in KWQKHTMLPart::widgetWillReleaseView scrolling around
17019
17020         * kwq/KWQKHTMLPart.h: Get rid of widgetWillReleaseView(). Add mouseDownViewIfStillGood().
17021         * kwq/KWQKHTMLPart.mm:
17022         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Call makeFirstResponder: in the same way that
17023         the NSWindow does before delivering a mouseDown: message. This oversight caused the applet problem.
17024         (findViewInSubviews): Added.
17025         (KWQKHTMLPart::mouseDownViewIfStillGood): Added. Gets _mouseDownView, but then checks that it's
17026         still a subview before returning it. A little inefficient, but the only way to do it given that
17027         there's no general way to find out that an NSView is being removed from your view hierarchy or deallocated.
17028         This fixes the crash in widgetWillReleaseView.
17029         (KWQKHTMLPart::khtmlMouseMoveEvent): Use mouseDownViewIfStillGood() instead of _mouseDownView directly.
17030         (KWQKHTMLPart::khtmlMouseReleaseEvent): Ditto.
17031         (KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
17032         * kwq/KWQWidget.mm:
17033         (QWidget::~QWidget): Remove call to widgetWillReleaseView().
17034         (QWidget::setView): Ditto.
17035
17036 2002-12-15  David Hyatt  <hyatt@apple.com>
17037
17038         operator== on CSSSelectors needed to be updated to compare
17039         _pseudoTypes.  A nice subtle bug from the mega-patch. 
17040         
17041         Reviewed by mjs
17042
17043         * khtml/css/cssparser.cpp:
17044         (CSSSelector::operator == ):
17045
17046 2002-12-15  David Hyatt  <hyatt@apple.com>
17047
17048         Fix for 3128429, sans-serif font got broken.  Just a typo
17049         from darin's mega-patch.  
17050         
17051         Reviewed by mjs
17052
17053         * khtml/css/cssstyleselector.cpp:
17054
17055 2002-12-14  Darin Adler  <darin@apple.com>
17056
17057         Reviewed by Maciej and Dave.
17058
17059         - optimizations that improve speed; total is 13.8% on cached cvs-base on my machine
17060
17061         * khtml/css/css_valueimpl.h: Add isKonqBody() and genericFamilyType() to find out if
17062         a font is a standard one. This is much faster than doing string comparisons all the time.
17063         * khtml/css/css_valueimpl.cpp: (FontFamilyValueImpl::FontFamilyValueImpl):
17064         Check the font names against the standard ones on time when the FontFamilyValueImpl
17065         object is constructed rather than every time the stuff is matched.
17066         * khtml/css/cssparser.h: Add pseudoType() and extractPseudoType() to CSSSelector so we
17067         don't have to do string compares all the time.
17068         * khtml/css/cssparser.cpp:
17069         (StyleBaseImpl::parseValue): Use QConstString in a way that's effective (with an
17070         object that has a long enough lifetime), or don't use it at all.
17071         (StyleBaseImpl::parseContent): Ditto.
17072         (StyleBaseImpl::preprocess): Preprocess into a buffer, usually on the stack, rather than
17073         using QString += QChar over and over again.
17074         (CSSSelector::extractPseudoType): Convert the value string into a type, and get rid of it.
17075         Saves memory because the string goes away. And doing it once is much faster than string
17076         comparing each time.
17077         * khtml/css/cssstyleselector.cpp:
17078         (cleanPath): Restructure to save one find() in the common case.
17079         (checkPseudoState): Restructure to avoid some DOMString creation/destruction in the case
17080         where the tag is not an <A>. Also use QConstString correctly.
17081         (CSSStyleSelector::checkOneSelector): Use the new pseudoType() instead of string compares.
17082         (CSSStyleSelector::applyRule): Use isKonqBody() and genericFamilyType() instead of string
17083         comparisons.
17084
17085         * khtml/dom/dom_string.h: Make the destructor non-virtual. This was a big win, and a mistake
17086         the way it was before. Also make the DOMString constructor with no parameters inline.
17087         * khtml/dom/dom_string.cpp:
17088         (DOMString::string): Don't use QConstString here, since it does no good.
17089         (DOM::operator==): Rewrite to do things faster and avoid calling strlen.
17090
17091         * khtml/html/html_objectimpl.h: Don't use QConstString in places where it does harm and no good.
17092         * khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::parseAttribute): Use QConstString properly.
17093
17094         * khtml/html/htmltokenizer.cpp:
17095         (tagMatch): Added.
17096         (HTMLTokenizer::parseSpecial): Change tokenizing so it doesn't construct temporary strings (with
17097         QConstString) just to compare small substrings.
17098
17099         * khtml/khtml_part.cpp: (KHTMLPart::write): Don't use a decoder object when source is all ASCII.
17100
17101         * kwq/KWQColor.mm:
17102         (hex2int): Don't bother with uppercase hex since we always lowercase anyway.
17103         (QColor::setNamedColor): Use a new gperf-based table instead of an NSDictionary to look up colors.
17104         * kwq/KWQColorData.c: Added this autogenerated file.
17105         * kwq/KWQColorData.gperf: Added. Source file with list of colors and color values.
17106         * kwq/Makefile.am: Build KWQColorData.c from KWQColorData.gperf.
17107         * WebCore.pbproj/project.pbxproj: Added KWQColorData.gperf.
17108
17109         * khtml/misc/helper.cpp: (khtml::setNamedColor): Don't call setNamedColor again with the lowercased
17110         color name, since our QColor::setNamedColor already has to lowercase the name (because it has to check
17111         all names before checking any hex values).
17112
17113         * khtml/rendering/font.h: Don't initialize the QFontMetrics since in every case we end up changing
17114         the font later anyway. Also remove unused field.
17115         * khtml/rendering/font.cpp: (Font::update): Use the new QFontMetrics::setFont for speed.
17116
17117         * khtml/rendering/render_object.cpp: (RenderObject::enclosingLayer): Change it so it doesn't get
17118         the layer twice. This function showed up on the sample so we know it's hot.
17119
17120         * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::containsOnlyWhitespace): Did a faster implementation
17121         that doesn't call QChar::direction() except for non-ASCII characters.
17122
17123         * kwq/KWQFontMetrics.h: Add empty constructor for use in font.cpp. Add accessor and setter for the
17124         font too. Made baselineOffset() inline since it's trivial.
17125         * kwq/KWQFontMetrics.mm:
17126         (QFontMetricsPrivate::QFontMetricsPrivate): Don't make the renderer until we use it.
17127         (QFontMetricsPrivate::getRenderer): Make it here.
17128         (QFontMetricsPrivate::font): Added.
17129         (QFontMetricsPrivate::setFont): Added. Dumps the renderer if the font is different.
17130         (QFontMetrics::QFontMetrics): Added empty constructor.
17131         (QFontMetrics::setFont): Added.
17132
17133         * kwq/KWQKURL.mm: (KURL::parse): Avoid function call overhead calling strncasecmp and strncmp.
17134         Also made the check for localhost case insensitive.
17135
17136         * kwq/KWQString.h: Remove _isUnicodeInternal and _isAsciiInternal, since they are trivially
17137         computed, and it saves time to not have that extra field to manipulate. Removed private
17138         data() function since it's the same as *dataHandle and not really more clear. Made ascii()
17139         and unicode() simpler and inline. Also made latin1() and getCFString() inline. Renamed
17140         QStringData to KWQStringData.
17141         * kwq/KWQString.mm:
17142         (QStringData::QStringData): Remove initializers for the xxxInternal.
17143         (QStringData::initialize): Removed some unnecessary if statements, and made a slight improvement
17144         in the case of a 0-length string that comes with a pointer for Unicode (can't do it in the
17145         char * case because it's a feature that's used).
17146         (QString::makeSharedNull): No need to set _isUnicodeInternal.
17147         (QStringData::~QStringData): Use the new functions instead of the old bits.
17148         (QStringData::increaseAsciiSize): Grow faster when we get to larger sizes where the "good size"
17149         call doesn't have as much of an effect. Simplified by removing unneeded code.
17150         (QStringData::increaseUnicodeSize): Ditto.
17151         (QStringData::makeAscii): Update for removal of _isAsciiInternal.
17152         (QStringData::makeUnicode): Update for removal of _isUnicodeInternal.
17153         (QString::detachIfInternal): Add this new inline to speed things up for the common case where
17154         there's no detaching needed.
17155         (QString::at): Simplify, there were excess if branches here.
17156         (QString::toDouble): Use kjs_strtod and don't copy the string using QCString for additional speed.
17157         (QString::lower): Don't detach if the string is already all lowercase. Added a FIXME about the
17158         code that assumes all "ASCII" bytes are truly ASCII. This code blurs the distinction between Latin-1
17159         and ASCII in a way that will not work right for Latin-1 characters in an 8-byte character QString.
17160         (QString::detachInternal): Update for removal of _isUnicodeInternal.
17161         (QString::detach): Removed a special case for shared_null that was dead code since shared_null has
17162         the _isUnicodeValid flag set.
17163         (operator==): Rewrote the comparison with char * to avoid the costly call to strlen.
17164
17165         * Makefile.am: Updated the rules here so the force clean timestamp works right.
17166         * force-clean-timestamp: Touched this since the header dependencies don't seem right
17167         for the DOMString constructor change, at least.
17168         * WebCore-tests.exp: Exported a symbol now needed by tests since QString does more inlining.
17169         * WebCore-combined.exp: Re-generated.
17170
17171 2002-12-14  Maciej Stachowiak  <mjs@apple.com>
17172
17173         Reviewed by Darin.
17174
17175         - slightly improved situation with 3124933 (abcnews.com leads to
17176         empty window with sheet complaining about javascript: URL); the
17177         popup window still comes up empty but it doesn't put up a sheet.
17178         
17179         * kwq/KWQKHTMLPartBrowserExtension.mm:
17180         (KHTMLPartBrowserExtension::openURLRequest): Handled "javascript:"
17181         URLs here.
17182
17183 2002-12-14  David Hyatt  <hyatt@apple.com>
17184
17185         Fix insidemacgames.com.  Reinstate rules I removed
17186         and fix other rules to be !important so that the
17187         td[align=right] rules won't affect child tables
17188         with align=center.
17189         
17190         Reviewed by gramps
17191
17192         * khtml/css/html4.css:
17193
17194 2002-12-14  David Hyatt  <hyatt@apple.com>
17195
17196         Fix for 3016385, menus on webreference.com don't show up.
17197         
17198         Fixes to make webreference.com menus show up.  This involved
17199         fixing layers to not clip positioned objects when overflow:hidden
17200         is set, fixing the stupid clip/sync layout hack for livepage
17201         so that it doesn't break webreference, and implementing 
17202         navigator.productSub (right now the date is set to
17203         Christmas 2002).
17204         
17205         Reviewed by gramps/maciej.
17206
17207         * khtml/ecma/kjs_navigator.cpp:
17208         (Navigator::getValueProperty):
17209         * khtml/ecma/kjs_navigator.h:
17210         * khtml/ecma/kjs_navigator.lut.h:
17211         * khtml/rendering/render_box.cpp:
17212         (RenderBox::getOverflowClipRect):
17213         * khtml/rendering/render_box.h:
17214         * khtml/rendering/render_flow.cpp:
17215         (RenderFlow::layout):
17216         * khtml/rendering/render_layer.cpp:
17217         (RenderLayer::paint):
17218         (RenderLayer::nodeAtPoint):
17219         (RenderLayer::constructZTree):
17220         * khtml/rendering/render_layer.h:
17221         * khtml/rendering/render_object.cpp:
17222         (RenderObject::setLayouted):
17223         * khtml/rendering/render_object.h:
17224
17225 2002-12-14  Ken Kocienda  <kocienda@apple.com>
17226
17227         Reviewed by Maciej
17228
17229         Fix for this bug:
17230
17231         Radar 3128159 (Netscape non-standard DOM event attribute "which" unsupported)
17232
17233         * khtml/dom/dom2_events.cpp:
17234         (UIEvent::which): Added which() definition.
17235         * khtml/dom/dom2_events.h: Added declarations for which() functions in UIEvent.
17236         * khtml/ecma/kjs_events.cpp: 
17237         (DOMUIEvent::getValueProperty): Added which property.
17238         * khtml/ecma/kjs_events.h: Ditto.
17239         * khtml/ecma/kjs_events.lut.h: File regenerated.
17240
17241 2002-12-13  Richard Williamson   <rjw@apple.com>
17242     
17243         Fixed 3127310 and 3127920.
17244
17245         Implemented findWordBoundary.  We now correctly detect word boundaries.
17246         This function makes use of carbon unicode utilities.
17247         
17248         With help from hyatt, made selection correctly account for render 
17249         continuations.  This fixes many of the 'unable to select' issues.
17250         
17251         Reviewed by trey and hyatt.
17252
17253         * khtml/khtml_events.cpp:
17254         (khtml::MouseEvent::offset):
17255         * khtml/khtml_part.cpp:
17256         (findWordBoundary):
17257         (KHTMLPart::khtmlMousePressEvent):
17258         (KHTMLPart::khtmlMouseMoveEvent):
17259         * khtml/rendering/render_object.cpp:
17260         (RenderObject::checkSelectionPoint):
17261         * khtml/rendering/render_object.h:
17262         * khtml/rendering/render_text.cpp:
17263         (RenderText::checkSelectionPoint):
17264         * khtml/rendering/render_text.h:
17265
17266 2002-12-13  Maciej Stachowiak  <mjs@apple.com>
17267
17268         Reviewed by Don.
17269
17270         - fixed build.
17271         
17272         * ForwardingHeaders/rendering/render_layer.h: Added.
17273
17274 2002-12-13  Maciej Stachowiak  <mjs@apple.com>
17275
17276         Reviewed by Don.
17277
17278         - fixed 3114737 - DHTML image content mispositioned on lexus.com
17279         
17280         * khtml/dom/dom2_events.cpp:
17281         (UIEvent::layerX): Added to support nonstandard Mozilla
17282         event.layerX property.
17283         (UIEvent::layerY): Added to support nonstandard Mozilla
17284         event.layerY property.
17285         * khtml/dom/dom2_events.h:
17286         * khtml/ecma/kjs_events.cpp:
17287         (DOMUIEvent::getValueProperty): Implemented layerX and layerY
17288         * khtml/ecma/kjs_events.h:
17289         * khtml/ecma/kjs_events.lut.h:
17290         * khtml/xml/dom2_eventsimpl.cpp:
17291         (MouseEventImpl::MouseEventImpl): Added call to computeLayerPos.
17292         (MouseEventImpl::computeLayerPos): Compute layer position.
17293         (MouseEventImpl::layerX): Added.
17294         (MouseEventImpl::layerY): Added.
17295         (MouseEventImpl::initMouseEvent): Added call to computeLayerPos.
17296         * khtml/xml/dom2_eventsimpl.h:
17297
17298 2002-12-13  David Hyatt  <hyatt@apple.com>
17299
17300         Fix for 314799, image at wired.com doesn't show up.  Block
17301         level replaced floating elements were being treated as though
17302         they didn't float.
17303         
17304         Reviewed by gramps
17305
17306         * khtml/rendering/render_flow.cpp:
17307         (RenderFlow::layoutBlockChildren):
17308
17309 2002-12-13  David Hyatt  <hyatt@apple.com>
17310
17311         Fix for 3098045.  
17312
17313         Do not treat XHTML-style tags e.g., <br/> or <table/> as
17314         self-closing.  This is absolutely wrong, and it does not
17315         match the behavior of other browsers.  According to the HTML4
17316         spec for parsing, / is an erroneous character and should simply
17317         be dropped, so <table/> should be treated like <table>.
17318
17319         Fixes for crashes on glazman's blog and on tantek's blog.  Both
17320         still mis-render, but at least they don't crash.
17321         
17322         Reviewed by gramps (and darin too)
17323
17324         * khtml/html/htmltokenizer.cpp:
17325         * khtml/rendering/render_container.cpp:
17326         * khtml/rendering/render_style.cpp:
17327         
17328 === Alexander-37u1 ===
17329
17330 2002-12-13  David Hyatt  <hyatt@apple.com>
17331
17332         Two fixes.  Bugs are 3121024, which had to do with handling
17333         escaped characters in the CSS content property, and 
17334         bug 3127375 (44854 in bugs.kde.org), which had to do with
17335         making sure table cells relayout properly when images load
17336         async.
17337         
17338         Reviewed by darin and john
17339
17340         * khtml/css/cssparser.cpp:
17341         (StyleBaseImpl::parseContent):
17342         (StyleBaseImpl::isHexadecimal):
17343         * khtml/css/cssparser.h:
17344         * khtml/rendering/bidi.cpp:
17345         (RenderFlow::layoutInlineChildren):
17346         * khtml/rendering/render_flow.cpp:
17347         (RenderFlow::layout):
17348         * khtml/rendering/render_flow.h:
17349
17350 2002-12-13  Darin Adler  <darin@apple.com>
17351
17352         Reviewed by Trey.
17353
17354         - moved KWQFontFamily and KWQPageState to new homes
17355
17356         * kwq/KWQFontFamily.h: Added.
17357         * kwq/KWQFontFamily.mm: Added.
17358         * kwq/KWQPageState.h: Added.
17359         * kwq/KWQPageState.mm: Added.
17360         * WebCore.pbproj/project.pbxproj: Added new source files.
17361
17362         * kwq/KWQFont.h: Removed KWQFontFamily.
17363         * kwq/KWQFont.mm:  Removed KWQFontFamily.
17364         * kwq/WebCoreBridge.mm: Removed KWQPageState.
17365
17366 2002-12-13  Maciej Stachowiak  <mjs@apple.com>
17367
17368         Reviewed by Ken.
17369
17370         - fixed 3083814 - dhtml at www.bayarea.com doesn't hide on some mouse movements
17371         
17372         * khtml/ecma/kjs_events.h:
17373         * khtml/ecma/kjs_events.cpp:
17374         (DOMUIEvent::getValueProperty): Implemented pageX and pageY properties.
17375         * khtml/ecma/kjs_events.lut.h: Regenerated.
17376         * khtml/dom/dom2_events.h:
17377         * khtml/dom/dom2_events.cpp:
17378         (UIEvent::pageX): Get x coordinate if a mouse event.
17379         (UIEvent::pageY): Get y coordinate if a mouse event.
17380
17381 2002-12-13  Richard Williamson   <rjw@apple.com>
17382
17383         Fixed 3127225.  Set WebCore object cache size when first bridge is created.
17384
17385         Reviewed by gramps.
17386
17387         * kwq/WebCoreBridge.h:
17388         * kwq/WebCoreBridge.mm:
17389         (-[WebCoreBridge init]):
17390
17391 2002-12-13  Darin Adler  <darin@apple.com>
17392
17393         Reviewed by John.
17394
17395         Overall speedup on cvs-base is about 5%.
17396
17397         - reduce QString use in the tokenizer and tighten up QString implementation for a speedup
17398         - fix up the QFontFamily implementation, using new QString features too, for a speedup
17399
17400         * khtml/html/htmltokenizer.h: Take const QString & instead of QString to avoid an extra copy.
17401         * khtml/html/htmltokenizer.cpp:
17402         (HTMLTokenizer::begin): Use QString::null instead of "" for QString objects; faster.
17403         (HTMLTokenizer::scriptHandler): In APPLE_CHANGES, use new prepend that avoids the need to
17404         create a temporary QString. Use QString::null instead of QString() for a null string, and
17405         also made other small fixes to avoid temporary QStrings.
17406         (HTMLTokenizer::setSrc): Take const QString & instead of QString to avoid an extra copy.
17407
17408         * kwq/KWQFont.h: Rename QFontFamily to KWQFontFamily. Make family() inline, add inline
17409         familyIsEmpty(). Change KWQFontFamily to store both the QString for the family and the
17410         NSString instead of only the NSString to avoid constant conversions back and forth.
17411         Remove type cases in CREATE_FAMILY_ARRAY that could result in copying the font object.
17412         * kwq/KWQFont.mm:
17413         (KWQFontFamily::KWQFontFamily): Fix bug where a copied family object would have a random
17414         ref count instead of a ref count of 0. Also update for NSString change.
17415         (KWQFontFamily::operator=): Use the ref before deref algorithm instead of the check for
17416         self-assignment.
17417         (KWQFontFamily::getNSFamily): Compute the NSString for the family name here. To avoid
17418         making an NSString every time, use a CFDictionary with QString as a key and NSString as
17419         a value instead of using an NSSet.
17420         (KWQFontFamily::setFamily): Invalidate the NSString family when the QString family is
17421         changed. Moved the code to make things unique to getNSFamily.
17422         (KWQFontFamily::operator==): Call getNSFamily rather than
17423
17424         * kwq/KWQString.h: Added a prepend and insert overload that take a QChar pointer and length, for
17425         use in the tokenizer, and a hash function, for use in CFDictionary. Also added a global set of
17426         CFDictionaryKeyCallBacks.
17427         * kwq/KWQString.mm:
17428         (QString::prepend): New overload calls new insert overload.
17429         (QString::insert): Old insert slightly tightened by calling detach() only after the early exit
17430         and removing an extra detach from a function that already does forceUnicode. Added the new insert
17431         that takes a QChar * and a length.
17432         (operator==): Rewrite this so that it is efficient and doesn't involve creating a QString temporary
17433         or doing a function call.
17434         (QString::hash): Wrote this. Used the same hash algorithm I did in my recent KJS work.
17435         (retainQString): Added. For use in CFDictionaryKey callback.
17436         (releaseQString): Added. For use in CFDictionaryKey callback.
17437         (describeQString): Added. For use in CFDictionaryKey callback.
17438         (equalQString): Added. For use in CFDictionaryKey callback.
17439         (hashQString): Added. For use in CFDictionaryKey callback.
17440
17441         * khtml/rendering/font.h: Change name to KWQFontFamily.
17442         * khtml/rendering/font.cpp: (Font::update): Call familyIsEmpty() instead of family().isEmpty()
17443         to avoid making and destroying a QString every time. Also put this batch of KWQFontFamily-specific
17444         changes inside #if APPLE_CHANGES. Much to my dismay, we have others elsewhere that aren't ifdef'd.
17445
17446         * khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): Change name to KWQFontFamily.
17447         Clearly this code needs some #if APPLE_CHANGES, and changing the class name helps make that clear.
17448
17449         - change KHTMLSettings so using it doesn't require copying QStrings for a speedup
17450
17451         * kwq/KWQKHTMLSettings.h: Made all the functions static members to avoid the unnecessary
17452         overhead of passing a this pointer. Added lots of setXXX functions for use by the WebCoreSettings
17453         code that gets called by WebKit when settings are changed. Return objects by reference because we
17454         can and it avoids copying QString objects.
17455         * kwq/KWQKHTMLSettings.mm: Changed all the functions in here to return the same global object
17456         each time, and made the set functions update those globals.
17457         * kwq/WebCoreSettings.mm: All the setters now call through to KHTMLSettings set functions.
17458
17459         - fixed 3126513 -- crash in KWQKHTMLPart::clearTimers() deallocating KWQPageState
17460         - did some cleanup in the bridge and the part; part of the process of moving real work out of the bridge
17461
17462         * kwq/KWQKHTMLPart.h: Rearrange things to be a little more logical. Mark isFrameSet() const.
17463         added an attributedString function here so it's not inside WebCoreBridge. Added an overload
17464         of clearTimers that takes a view parameter.
17465         * kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Mark this const.
17466         * kwq/KWQKHTMLPart.mm:
17467         (KWQKHTMLPart::clearTimers): Add the overload that takes the view parameter.
17468         (KWQKHTMLPart::attributedString): Moved this code in here from the bridge.
17469
17470         * kwq/WebCoreBridge.mm:
17471         (-[WebCoreBridge selectedAttributedString]): Call the attributedString function in its new home in
17472         KWQKHTMLPart.
17473         (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
17474         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
17475         Take a const KURL & instead of a KURL to avoid unnecessary copying.
17476         (-[KWQPageState dealloc]): Call the new clearTimers that takes a view parameter. This should fix the
17477         crash in autorelease pool deallocation mentioned above.
17478
17479 2002-12-13  David Hyatt  <hyatt@apple.com>
17480
17481         Fix for 3121865, content missing at disney.com.  Make
17482         sure blocks track width overflow as well as height
17483         overflow and ensure that a layer's dimensions expand
17484         to encompass both width and height overflow.
17485
17486         Also fixes a bug with line breaking that allowed unbreakable
17487         words to actually be broken up when they were the only word
17488         on a line.  This is wrong and differs from all other
17489         browsers, so the patch in bidi.cpp fixes us to match
17490         other browsers.  (This was required to fix the above bug.)
17491         
17492         Reviewed by mjs.
17493
17494         * khtml/rendering/bidi.cpp:
17495         (RenderFlow::findNextLineBreak):
17496         * khtml/rendering/render_flow.cpp:
17497         (RenderFlow::RenderFlow):
17498         (RenderFlow::layout):
17499         (RenderFlow::layoutBlockChildren):
17500         * khtml/rendering/render_flow.h:
17501         * khtml/rendering/render_layer.cpp:
17502         (RenderLayer::updateLayerPosition):
17503         * khtml/rendering/render_object.cpp:
17504         (RenderObject::nodeAtPoint):
17505         * khtml/rendering/render_object.h:
17506         * khtml/rendering/render_table.h:
17507
17508 2002-12-12  Richard Williamson   <rjw@apple.com>
17509
17510         Fixed 3116584.  Made letter-spacing, word-spacing, and text-decoration play
17511         well together.
17512         Reviewed by hyatt.
17513
17514         Changes made with trey to enable to release of page cache from the
17515         "Empty Cache" menu item in Alex.
17516         Reviewed by trey.
17517         
17518         * khtml/rendering/font.cpp:
17519         (Font::drawLineForText):
17520         (Font::drawText):
17521         * khtml/rendering/font.h:
17522         * khtml/rendering/render_text.cpp:
17523         (TextSlave::paintDecoration):
17524         (RenderText::paintObject):
17525         * khtml/rendering/render_text.h:
17526         * kwq/KWQPainter.h:
17527         * kwq/KWQPainter.mm:
17528         (QPainter::drawLineForText):
17529         * kwq/WebCoreBridge.h:
17530         * kwq/WebCoreBridge.mm:
17531         (-[WebCoreBridge dealloc]):
17532         (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
17533         (-[KWQPageState invalidate]):
17534         (-[KWQPageState dealloc]):
17535         * kwq/WebCoreTextRenderer.h:
17536
17537 2002-12-12  Ken Kocienda  <kocienda@apple.com>
17538
17539         Reviewed by Maciej and Darin
17540
17541         Final fix for this bug:
17542
17543         Radar 3062858 (REGRESSION: failed login at www.usaa.com doesn't return error text)
17544
17545         We were down to a case where submitting the login form with the return key
17546         failed since we did not implement either non-standard keyCode (IE-style) or
17547         which (Netscape-style) UI event extension for getting the value of a key
17548         press. The form submission code depended on sensing the value of the
17549         key press by checking one of these properties.
17550         
17551         Since the "which" property also can be used for mouse events, and fixing
17552         this bug could be done by implementing either keyCode or which, I chose
17553         to implement keyCode only.
17554
17555         * khtml/dom/dom2_events.cpp: Added keyCode function definition.
17556         * khtml/dom/dom2_events.h: Added keyCode function declaration.
17557         * khtml/ecma/kjs_events.cpp:
17558         (DOMUIEvent::getValueProperty): Added new KeyCode attribute.
17559         * khtml/ecma/kjs_events.h: New generated file.
17560         * khtml/ecma/kjs_events.lut.h: Ditto.
17561         * khtml/xml/dom2_eventsimpl.cpp: 
17562         (KeyEventImpl::KeyEventImpl): Fixed a bug in khtml that prevented the        
17563         m_keyVal field on KeyEventImpl from ever being set correctly. 
17564         I guess I am the first person ever to care about that value. :-)
17565
17566 === Alexander-36 ===
17567
17568 2002-12-12  Darin Adler  <darin@apple.com>
17569
17570         Reviewed by Ken.
17571
17572         - fixed 3126042 -- Failure to send onkeypress event on key down causes forms to submit incorrectly
17573
17574         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent): Fixed the code to send the second event with repeat
17575         set equal to true. Before it was constructing the event but never sending it because result was true.
17576         Also fixed a problem where it was considering sending a second mouse up event. What we're doing here
17577         is a bit of a hack and probably should be fixed -- it seems that the behavior in dispatchKeyEvent where
17578         it sends only a down and not a press for the a non-autorepeat event is a KHTML bug that we should fix
17579         instead of work around eventually.
17580         
17581         - fix to something that made this harder to debug
17582
17583         * khtml/xml/dom2_eventsimpl.cpp: (KeyEventImpl::KeyEventImpl): Logging the type was showing the wrong
17584         type, and I narrowed it down to this code here. Changing m_id after the fact doesn't change the type
17585         string, so you need to compute the correct ID and pass it to the constructor.
17586
17587 2002-12-12  Darin Adler  <darin@apple.com>
17588
17589         Reviewed by Ken.
17590
17591         - fixed 3125886 -- Failure to set document onkeypress handler causes return key to submit forms incorrectly
17592
17593         The handler was getting ignored because the property setting code never got to the DOMNode level.
17594
17595         * khtml/ecma/kjs_dom.cpp: (DOMDocument::tryPut): Pass correct parent class, DOMNode, instead
17596         of DOMObject. By passing DOMObject, we skipped all the properties inherited from DOMNode,
17597         including onkeypress.
17598
17599 2002-12-12  Darin Adler  <darin@apple.com>
17600
17601         Reviewed by Trey and Ken.
17602
17603         - fixed 3125613 -- REGRESSION: resizing frames after clicking on scroll bar doesn't work right
17604         
17605         The problem was that the mouse dragged events were going to the scroll bar because the new click
17606         on the frame resizer didn't fall into the code path that sets _mouseDownView.
17607
17608         * kwq/KWQKHTMLPart.h: Add override of khtmlMouseMoveEvent.
17609         * kwq/KWQKHTMLPart.mm:
17610         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Don't set _mouseDownView. This is now handled
17611         at the higher level when the mouseDown comes in.
17612         (KWQKHTMLPart::khtmlMouseMoveEvent): Added. Pass along mouseDragged: events. I didn't have this
17613         before because I don't want or need to pass mouseMoved: events along, but the KHTML mouse move
17614         event corresponds to both AppKit mouseDragged and mouseMoved.
17615         (KWQKHTMLPart::khtmlMouseReleaseEvent): Don't clear _mouseDownView. This is now handled at the
17616         higher level when the mouseUp comes in.
17617         (KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
17618         (KWQKHTMLPart::mouseDown): Set _mouseDownView to nil; it will be set by passWidgetMouseDownEventToWidget
17619         if we end up passing the event down. This is the change that actually fixes the bug mentioned above.
17620         (KWQKHTMLPart::mouseUp): Set _mouseDownView to nil after handling the mouseUp. It's OK if we don't
17621         clear this out in cases where we don't get a mouseUp event -- we'll get a mouseDown later -- but it's
17622         still probably a good idea to clear it when we know the mouse is no longer down.
17623
17624         - used update-kwq-assert to update the code that's a shared copy of WebFoundation code
17625
17626         * kwq/KWQAssertions.m: (vprintf_stderr_objc): Got the UTF-8 fix I did a while back.
17627
17628 2002-12-12  Maciej Stachowiak  <mjs@apple.com>
17629
17630         Reviewed by Darin.
17631
17632         * force-js-clean-timestamp: Update for JavaScriptCore changes.
17633
17634 2002-12-12  Darin Adler  <darin@apple.com>
17635
17636         Reviewed by Maciej.
17637
17638         - fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
17639
17640         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent): Call makeFirstResponder here explicitly,
17641         since we are disabling the makeFirstResponder that normally happens during window event dispatching
17642         in WebKit.
17643
17644         * kwq/KWQScrollView.h: Define getDocumentView().
17645         * kwq/KWQScrollView.mm: Use getDocumentView() everywhere.
17646         (QScrollView::getDocumentView): Define it here.
17647
17648 2002-12-12  Darin Adler  <darin@apple.com>
17649
17650         Reviewed by Maciej and Richard.
17651
17652         - fixed 3125497 -- REGRESSION: Infinite recursion with mouseUp: events
17653
17654         The problem was that events could end up back at the same part due to the responder chain.
17655
17656         * kwq/KWQKHTMLPart.h: Added mouseDown, mouseDragged, mouseUp, mouseMoved, buttonForCurrentEvent,
17657         and stateForCurrentEvent. Remove setCurrentEvent and currentEvent. Renamed handleMouseDownEventForWidget
17658         to passWidgetMouseDownEventToWidget. John and I had agreed to this name change before the last commit,
17659         but I forgot.
17660
17661         * kwq/KWQKHTMLPart.mm:
17662         (KWQKHTMLPart::KWQKHTMLPart): Initialize _sendingEventToSubview to false. No need to initialize
17663         _mouseDownWasInSubframe at all since it's only looked at when _mouseDownView is non-nil.
17664         (KWQKHTMLPart::keyEvent): Save and restore _currentEvent instead of setting to nil.
17665         Use stateForCurrentEvent instead of stateForEvent:.
17666         (KWQKHTMLPart::khtmlMousePressEvent): Name change.
17667         (KWQKHTMLPart::khtmlMouseDoubleClickEvent): Name change.
17668         (KWQKHTMLPart::passWidgetMouseDownEventToWidget): Name change. Set _sendingEventToSubview when
17669         sending event to subview.
17670         (KWQKHTMLPart::khtmlMouseReleaseEvent): Name change. Set _sendingEventToSubview when sending
17671         event to subview.
17672         (KWQKHTMLPart::passSubframeEventToSubframe): Name change. Set _sendingEventToSubview when
17673         sending event to subview.
17674         (KWQKHTMLPart::buttonForCurrentEvent): Added. Similar to code I moved here from WebCoreBridge.
17675         (KWQKHTMLPart::stateForCurrentEvent): Added. Similar to code I moved here from WebCoreBridge.
17676         (KWQKHTMLPart::mouseDown): Added. Similar to code I moved here from WebCoreBridge, except returns
17677         and does nothing if _sendingEventToSubview is set.
17678         (KWQKHTMLPart::mouseDragged): Ditto.
17679         (KWQKHTMLPart::mouseUp): Ditto.
17680         (KWQKHTMLPart::mouseMoved): Added. Similar to code I moved here from WebCoreBridge.
17681
17682         * kwq/WebCoreBridge.mm:
17683         (-[WebCoreBridge mouseDown:]): Just call _part->mouseDown().
17684         (-[WebCoreBridge mouseDragged:]): Just call _part->mouseDragged().
17685         (-[WebCoreBridge mouseUp:]): Just call _part->mouseUp().
17686         (-[WebCoreBridge mouseMoved:]): Just call _part->mouseMoved().
17687
17688         * kwq/WebCoreBridgePrivate.h: Removed.
17689         * WebCore.pbproj/project.pbxproj: Removed WebCoreBridgePrivate.h.
17690
17691 2002-12-12  Richard Williamson   <rjw@apple.com>
17692
17693         Fixed 3125583.  Don't redraw view under resize bar
17694         on mouseup.
17695         
17696         Reviewed by gramps.
17697
17698         * khtml/rendering/render_frames.cpp:
17699         (RenderFrameSet::userResize):
17700
17701 2002-12-11  David Hyatt  <hyatt@apple.com>
17702
17703         Fix hang on monkeyvoodoo.net and on skramkoob.com.  The bugs
17704         are 3105714 and 3045965.  Also fix margin collapsing churn
17705         on thestar by not laying out a second time when collapsing
17706         margins make you move unless you contain floats.
17707         
17708         Reviewed by: gramps
17709
17710         * khtml/rendering/bidi.cpp:
17711         (RenderFlow::findNextLineBreak):
17712         * khtml/rendering/render_flow.cpp:
17713         (RenderFlow::layoutBlockChildren);
17714
17715 2002-12-11  Richard Williamson   <rjw@apple.com>
17716
17717         Fixed 3124121, 3124716 (and other dupes).  Regressions related to b/f crash.
17718         
17719         Reviewed by hyatt.
17720
17721         * kwq/KWQKHTMLPart.h:
17722         * kwq/KWQKHTMLPart.mm:
17723         (KWQKHTMLPart::openURLFromPageCache):
17724         * kwq/WebCoreBridge.h:
17725         * kwq/WebCoreBridge.mm:
17726         (-[WebCoreBridge dealloc]):
17727         (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
17728
17729 2002-12-11  Darin Adler  <darin@apple.com>
17730
17731         Reviewed by Richard.
17732
17733         - fixed 3124263 -- REGRESSION: Crash running development build of PLT
17734
17735         * kwq/KWQWidget.mm:
17736         (QWidget::~QWidget): Don't worry about the outer view here, since we can never hit one of those.
17737         Just pass the view to KWQKHTMLPart::widgetWillReleaseView.
17738         (QWidget::getOuterView): Re-add the assertion I had removed.
17739
17740         - fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
17741
17742         * kwq/KWQKURL.mm: (KURL::decode_string): Made this function return the URL still encoded
17743         rather than a null string (actually, crashing) when CFURLCreateStringByReplacingPercentEscapes
17744         rejects the passed-in string. Also updated the FIXME.
17745         (appendEscapingBadChars): Fixed problem with high-bit-set characters.
17746         * kwq/KWQString.mm: (QString::setBufferFromCFString): Made this tolerant of NULL.
17747
17748 2002-12-11  Darin Adler  <darin@apple.com>
17749
17750         Reviewed by John.
17751
17752         - fixed handling of mouse events so I could turn the mechanism on all the way
17753         - fixed anomalies in the red-painting-for-null-view-detection
17754         - fixed 3123105 -- REGRESSION: Crash in KHTMLView::unscheduleRelayout on exit
17755         - fixed 3124047 -- REGRESSION: crash in KWQKHTMLPart::handleMouseDownEventForWidget at nwa.com
17756
17757         * kwq/KWQKHTMLPart.h: Add setCurrentEvent()/currentEvent()/_currentEvent back, because we can
17758         end up doing a lot of work and processing a lot of events before we get around to handling the
17759         current event, so [NSApp currentEvent] won't cut it. Also add clearTimers, passSubframeEventToSubframe,
17760         an overload for handleMouseDownEventForWidget, and _mouseDownWasInSubframe boolean.
17761
17762         * kwq/KWQKHTMLPart.mm:
17763         (KWQKHTMLPart::submitForm): Use _currentEvent.
17764         (KWQKHTMLPart::urlSelected): Use _currentEvent.
17765         (KWQKHTMLPart::paint): Fixed red-drawing-for-debug code by using KWQPainter instead of going
17766         directly to the AppKit level.
17767         (KWQKHTMLPart::keyEvent): Moved the check for null node up a bit, and set _currentEvent.
17768         (KWQKHTMLPart::handleMouseDownEventForWidget): Break into two pieces, so we can share the
17769         code with the new passSubframeEventToSubframe. Set _mouseDownWasInSubframe to false
17770         when setting _mouseDownView. Use getView() instead of getOuterView() since we really don't
17771         care about the WebView after all. Use _currentEvent. Add a check for nodes that lack a renderer
17772         to fix the crash at nwa.com above.
17773         (KWQKHTMLPart::khtmlMouseReleaseEvent): Use _currentEvent.
17774         (KWQKHTMLPart::clearTimers): Added. Checks for null view, which fixes the crash on exit above.
17775         (KWQKHTMLPart::passSubframeEventToSubframe): Added. Checks for the categories of events that we
17776         can pass to subframes, which are mouse down, up, and dragged events, and passes them along.
17777         This is the main fix that makes subframes work properly.
17778
17779         * khtml/khtmlview.cpp:
17780         (KHTMLView::viewportMousePressEvent): Add call to the new passSubframeEventToSubframe.
17781         (KHTMLView::viewportMouseDoubleClickEvent): Ditto.
17782         (KHTMLView::viewportMouseMoveEvent): Ditto.
17783         (KHTMLView::viewportMouseReleaseEvent): Ditto.
17784
17785         * kwq/WebCoreBridge.mm:
17786         (-[WebCoreBridge saveDocumentToPageCache]): Call clearTimers on the part now, instead of the document.
17787         (-[WebCoreBridge mouseUp:]): Call setCurrentEvent.
17788         (-[WebCoreBridge mouseDown:]): Ditto.
17789         (-[WebCoreBridge mouseMoved:]): Ditto.
17790         (-[WebCoreBridge mouseDragged:]): Ditto.
17791         (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]): Call clearTimers on the
17792         part now, instead of the document.
17793
17794         - other changes
17795
17796         * khtml/ecma/kjs_window.lut.h: Let this be regenerated. I think I accidentally checked
17797         in an obsolete version of this earlier.
17798
17799         * khtml/html/html_documentimpl.h: Remove clearTimers(). We don't need it here in APPLE_CHANGES.
17800         * khtml/html/html_documentimpl.cpp: Ditto.
17801
17802         * khtml/khtmlpart_p.h: Removed unneeded APPLE_CHANGES. We don't use m_frameNameId any more, nor
17803         do we need m_savingPageState or m_restoringPageState.
17804         * khtml/khtml_part.cpp: (KHTMLPart::clear): Removed unneeded APPLE_CHANGES, now that we don't
17805         use m_frameNameId any more.
17806         
17807         * kwq/KWQWidget.mm: (KWQWidget::getOuterView): Tolerate nil for view here, so we can use this from
17808         the QWidget destructor.
17809
17810 2002-12-11  Darin Adler  <darin@apple.com>
17811
17812         Rolled out changes I accidentally checked in last night.
17813
17814 2002-12-10  John Sullivan  <sullivan@apple.com>
17815
17816         Fixed more "Alexander"s that were lurking in places I forgot 
17817         to look before.
17818
17819         Reviewed by Darin
17820
17821         * Makefile.am:
17822         "rm -rf $(SYMROOTS)/Safari.app/Frameworks/WebCore.framework"
17823
17824 2002-12-10  Maciej Stachowiak  <mjs@apple.com>
17825
17826         Reviewed by Don.
17827
17828         - really fixed 3123727 - SJ: Viewmaster arm sometimes doesn't animate on
17829         http://www.pixar.com/howwedoit/
17830
17831         * kwq/KWQKHTMLPart.mm:
17832         (KWQKHTMLPart::KWQKHTMLPart): Call Cache::init before
17833         KHTMLPart::init so we have a loader to connect the signals to.
17834
17835 2002-12-10  Maciej Stachowiak  <mjs@apple.com>
17836
17837         Reviewed by Darin.
17838
17839         - fixed 3123727 - SJ: Viewmaster arm sometimes doesn't animate on
17840         http://www.pixar.com/howwedoit/
17841
17842         * khtml/khtml_part.cpp:
17843         (KHTMLPart::KHTMLPart): Don't call KHTMLPart::init at all...
17844         * kwq/KWQKHTMLPart.mm:
17845         (KWQKHTMLPart::KWQKHTMLPart): Call it here instead so that signal
17846         connections happen properly.
17847
17848 2002-12-10  David Hyatt  <hyatt@apple.com>
17849
17850         Fix for 3116996.  My hack to make selects ignore fixed CSS
17851         widths that are smaller than their intrinsic width was not
17852         good.  Remove the hack.
17853         
17854         Reviewed by darin
17855
17856         * khtml/rendering/render_box.cpp:
17857         (RenderBox::calcReplacedWidth):
17858
17859 2002-12-10  Darin Adler  <darin@apple.com>
17860
17861         Reviewed by John.
17862
17863         - fixed 3108912 -- onclick handlers not supported on form elements
17864
17865         We now pass the events back to the NSView here in WebCore; they pass through all the
17866         machinery in the DOM before getting sent on.
17867
17868         * kwq/KWQKHTMLPart.h: Add widgetWillReleaseView and handleMouseDownEventForWidget functions,
17869         overrides for khtmlMousePressEvent, khtmlMouseDoubleClickEvent, khtmlMouseReleaseEvent, and
17870         a new _mouseDownView field.
17871
17872         * kwq/KWQKHTMLPart.mm:
17873         (KWQKHTMLPart::KWQKHTMLPart): Initialize _mouseDownView to nil.
17874         (KWQKHTMLPart::khtmlMousePressEvent): Call handleMouseDownEventForWidget, but if it returns
17875         false call through to the base class function.
17876         (KWQKHTMLPart::khtmlMouseDoubleClickEvent): Ditto.
17877         (KWQKHTMLPart::handleMouseDownEventForWidget): Do a hit test to find out which view to send
17878         the mouse down event to, and then send it.
17879         (KWQKHTMLPart::khtmlMouseReleaseEvent): Send the mouse up event to the view we sent a mouse
17880         down event to, or call through to the base class otherwise.
17881         (KWQKHTMLPart::widgetWillReleaseView): Clear out the _mouseDownView field if the view is
17882         being released by the QWidget that owns it.
17883
17884         * kwq/KWQWidget.mm:
17885         (QWidget::~QWidget): Call KWQKHTMLPart::widgetWillReleaseView.
17886         (QWidget::setView): Call KWQKHTMLPart::widgetWillReleaseView on the old view.
17887
17888 2002-12-09  Darin Adler  <darin@apple.com>
17889
17890         Reviewed by Maciej.
17891
17892         * WebCore.pbproj/project.pbxproj: Bump versions to 0.8 and 35u.
17893
17894 2002-12-09  Maciej Stachowiak  <mjs@apple.com>
17895
17896         Reviewed by Dave.
17897
17898         - fixed 3117734 - fail at document.releaseEvents in js at rollingstone.com
17899         
17900         * khtml/ecma/kjs_html.cpp:
17901         (KJS::HTMLDocFunction::tryCall): Added no-op implementations of
17902         captureEvents and releaseEvents.
17903         (KJS::HTMLDocument::tryGet):
17904         * khtml/ecma/kjs_html.h:
17905         * khtml/ecma/kjs_window.cpp:
17906         (Window::get, WindowFunc::tryCall): Added no-op implementation of
17907         releaseEvents.
17908         * khtml/ecma/kjs_window.h:
17909         * khtml/ecma/kjs_html.lut.h: Regenerated.
17910         * khtml/ecma/kjs_window.lut.h: Regenerated.
17911
17912 2002-12-09  David Hyatt  <hyatt@apple.com>
17913
17914         Fix for the CSS test suite link.  Need to make sure inlines
17915         that are obscured by blocks are properly considered to be
17916         above the block background.
17917         
17918         * khtml/rendering/render_object.cpp:
17919         (RenderObject::nodeAtPoint):
17920
17921 2002-12-09  Darin Adler  <darin@apple.com>
17922
17923         Reviewed by Trey.
17924
17925         - made KWQKHTMLPart a subclass of KHTMLPart so we can override virtual functions
17926
17927         * khtml/khtml_part.h: Get rid of kwq pointer.
17928         * khtml/khtml_part.cpp:
17929         (KHTMLPart::init): No need to make a KWQKHTMLPart any more.
17930         (KHTMLPart::~KHTMLPart): No need to delete a KWQKHTMLPart any more.
17931         (KHTMLPart::closeURL): KWQKHTMLPart does saveDocumentState in an override now.
17932         (KHTMLPart::begin): KWQ() instead of ->kwq.
17933         (KHTMLPart::checkCompleted): KWQ() instead of ->kwq, and ifdef out some unneeded code.
17934         (KHTMLPart::urlSelected): KWQ() instead of ->kwq.
17935         (KHTMLPart::requestFrameName): KWQ() instead of ->kwq.
17936         (KHTMLPart::processObjectRequest): Just call openURL, since we are now KWQKHTMLPart.
17937         (KHTMLPart::submitForm): KWQ() instead of ->kwq.
17938         (KHTMLPart::popupMenu): Did a bit more ifdef'int out here.
17939
17940         * kwq/KWQKHTMLPart.h: Include "khtml_part.h" and remove includes we don't need any more.
17941         Inherit from KHTMLPart instead of QObject. Remove KHTMLPart parameter from constructor.
17942         Override openURL and closeURL. Remove part and d pointers. Add KWQ() inline to avoid casting.
17943         * kwq/KWQKHTMLPart.mm:
17944         (KHTMLPart::completed): KWQ() instead of ->kwq.
17945         (KHTMLPart::openURL): Never reached now, since we override.
17946         (KHTMLPart::setStatusBarText): KWQ() instead of ->kwq.
17947         (KHTMLPart::started): KWQ() instead of ->kwq.
17948         (KWQKHTMLPart::KWQKHTMLPart): No need to deal with separate part.
17949         (KWQKHTMLPart::bridgeForFrameName): KWQ() instead of ->kwq.
17950         (KWQKHTMLPart::openURL): Add bool return value so we can override the existing openURL.
17951         (KWQKHTMLPart::slotData): Remove unneeded part->.
17952         (KWQKHTMLPart::setView): Remove unneeded part->.
17953         (KWQKHTMLPart::document): Remove unneeded part->.
17954         (KWQKHTMLPart::renderer): Remove unneeded part->.
17955         (KWQKHTMLPart::userAgent): Remove unneeded part->.
17956         (KWQKHTMLPart::nextKeyViewInFrame): KWQ() instead of ->kwq.
17957         (KWQKHTMLPart::nextKeyViewInFrameHierarchy): KWQ() instead of ->kwq.
17958         (KWQKHTMLPart::canCachePage): Remove unneeded part->.
17959         (KWQKHTMLPart::saveWindowProperties): Use this instead of part.
17960         (KWQKHTMLPart::saveLocationProperties): Use this instead of part.
17961         (KWQKHTMLPart::restoreWindowProperties): Use this instead of part.
17962         (KWQKHTMLPart::restoreLocationProperties): Use this instead of part.
17963         (KWQKHTMLPart::openURLFromPageCache): Remove unneeded part->.
17964         (KWQKHTMLPart::partForNode): KWQ() instead of ->kwq.
17965         (KWQKHTMLPart::updatePolicyBaseURL): Remove unneeded part->.
17966         (KWQKHTMLPart::setPolicyBaseURL): Remove unneeded part->.
17967         (KWQKHTMLPart::createDummyDocument): Use this instead of part.
17968         (KWQKHTMLPart::scrollToAnchor): Remove unneeded part->.
17969         (KWQKHTMLPart::closeURL): Added. Calls saveDocumentState().
17970
17971         * kwq/WebCoreBridge.h: Use KWQKHTMLPart instead of KHTMLPart.
17972         * kwq/WebCoreBridge.mm: (-[WebCoreBridge init]): Make a KWQKHTMLPart.
17973         Use _part instead of _part->kwq in the rest of the file.
17974
17975         * kwq/KWQSignal.mm: (KWQSignal::disconnect): Add the names of a few signals that are
17976         disconnected after the KWQKHTMLPart part of the KHTMLPart is destroyed, to avoid noise.
17977
17978         * khtml/ecma/kjs_navigator.cpp: (Navigator::getValueProperty): KWQ() instead of ->kwq.
17979         * khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::initScript): KWQ() instead of ->kwq.
17980         * khtml/ecma/kjs_window.cpp:
17981         (Window::scheduleClose): KWQ() instead of ->kwq.
17982         (WindowFunc::tryCall): KWQ() instead of ->kwq.
17983         * khtml/xml/dom_docimpl.cpp: (DocumentImpl::setTitle): KWQ() instead of ->kwq.
17984         * kwq/KWQKHTMLPartBrowserExtension.mm:
17985         (KHTMLPartBrowserExtension::openURLRequest): KWQ() instead of ->kwq.
17986         (KHTMLPartBrowserExtension::createNewWindow): KWQ() instead of ->kwq.
17987         (KHTMLPartBrowserExtension::setIconURL): KWQ() instead of ->kwq.
17988         (KHTMLPartBrowserExtension::setTypedIconURL): KWQ() instead of ->kwq.
17989         * kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::showApplet): KWQ() instead of ->kwq.
17990         * kwq/KWQLoader.mm:
17991         (KWQServeRequest): Cast to KWQKHTMLPart instead of casting to KHTMLPart and doing ->kwq.
17992         (KWQCheckIfReloading): Ditto.
17993         (KWQCheckCacheObjectStatus): Ditto.
17994
17995         * WebCore.pbproj/project.pbxproj: Let Electron punish the wicked.
17996
17997 2002-12-09  Richard Williamson   <rjw@apple.com>
17998
17999         Many changes for b/f list.
18000         1.  Always attempt to cache snap back items.
18001         2.  Lazily release resources from page cache.  This garners gains on the PLT (and presumably iBench) tests, both for uncached.
18002         3.  Set the page cache size to 4 (+ snap back items).  After releasing resources we hover around 28MB footprint.  Closing windows releases all resources.
18003         4.  Turn on the back/forward cache by default.  The menu item still allows you to toggle b/f on and off.  Useful when conducting speed comparison in the PLT.
18004         5.  Addition of lazy update to PLT memory statistics to show footprint after lazy release of page cache resources.
18005         6.  Delayed to leak detector to account for lazy release of resources.
18006         7.  A change when saving a page to back/forward cache to clear and restore the documents root renderer.  Without this fix pages would appear to 'flicker' more when content arrived.
18007         8.  A change to ensure a layout when restoring a page from the b/f cache.  Without this fix scrollbars wouldn't appear correctly.
18008         9.  A change to ensure that khtmlview layout and paint timers are unscheduled when a page is placed in the b/f cache.
18009         10.  A fix to decouple of khtmlview from it's part when placed in the b/f cache.  This fixed a crash caused by inappropriate deference of the part when a page cache item was released.
18010         11.  A comment in KHTMLPageCache.h explaining the that our page cache is not the same as the khtml page cache.  (Their cache just cached the html source.)
18011         12.  Reapply styles when loading page from cache.  This ensures that visited link get the appropriate style.
18012
18013         Reviewed by kocienda.
18014
18015         * khtml/html/html_documentimpl.cpp:
18016         (HTMLDocumentImpl::clearTimers):
18017         * khtml/html/html_documentimpl.h:
18018         * khtml/khtmlview.cpp:
18019         (KHTMLView::clearPart):
18020         (KHTMLView::timerEvent):
18021         * khtml/khtmlview.h:
18022         * khtml/xml/dom_docimpl.cpp:
18023         (DocumentImpl::restoreRenderer):
18024         (DocumentImpl::detach):
18025         * khtml/xml/dom_docimpl.h:
18026         * kwq/KWQKHTMLPageCache.h:
18027         * kwq/WebCoreBridge.mm:
18028         (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
18029         (-[WebCoreBridge saveDocumentToPageCache]):
18030         (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
18031         (-[KWQPageState dealloc]):
18032         (-[KWQPageState KJS::]):
18033         (-[KWQPageState khtml::]):
18034
18035 2002-12-08  Trey Matteson  <trey@apple.com>
18036
18037         Fixed 3115903 - exchangehomes.com sometimes has form state poorly restored
18038
18039         KHTML is much smarter about restoring form state now, taking into account element names and
18040         types instead of blindly blasting data by simple element ordering.  We encode the name
18041         and type at the front of the "state" strings that previously just held the value of the
18042         element.        
18043
18044         QString::endsWith() was just plain wrong.  Looks like it had some copied code, but was
18045         never really implemented.
18046
18047         Reviewed by: Darin Adler
18048
18049         * WebCore.pbproj/project.pbxproj:  PB is hellbent on adding "shouldUseHeadermap = 0;"
18050         * khtml/html/html_formimpl.cpp:
18051         (encodedElementName):  Utility func to encode an element name, escaping amp and lt
18052         (HTMLGenericFormElementImpl::state):  Build the prefix of an element's state string,
18053         e.g. ELEMENT_NAME&ELEMENT_TYPE&
18054         (HTMLGenericFormElementImpl::findMatchingState):  Find a matching piece of state out of
18055         the list of state strings that were previously saved.
18056         (HTMLFieldSetElementImpl::type):  Return our element type.
18057         (HTMLInputElementImpl::state):  Call super as part of building state string.
18058         (HTMLInputElementImpl::restoreState):  Use findMatchingState.
18059         (HTMLLegendElementImpl::type):  Return our element type.
18060         (HTMLSelectElementImpl::state):  Call super as part of building state string.
18061         (HTMLSelectElementImpl::restoreState):  Use findMatchingState.
18062         (HTMLKeygenElementImpl::type):  Return our element type.
18063         (HTMLOptGroupElementImpl::type):  Return our element type.
18064         (HTMLOptionElementImpl::type):  Return our element type.
18065         (HTMLTextAreaElementImpl::state):  Call super as part of building state string.
18066         (HTMLTextAreaElementImpl::restoreState):  Use findMatchingState.
18067         * khtml/html/html_formimpl.h:  type() is moved up to HTMLGenericFormElementImpl
18068         * khtml/html/htmlparser.cpp:
18069         (KHTMLParser::insertNode):  Pass list of states to restoreState.
18070         (KHTMLParser::popOneBlock):  Pass list of states to restoreState.
18071         * khtml/xml/dom_docimpl.h:  Add method to return the whole list of form states.
18072         * khtml/xml/dom_nodeimpl.cpp:
18073         (NodeImpl::restoreState):    Nodes receive the whole list of form states to restore from,
18074         not just a single state that has already been chosen.
18075         * khtml/xml/dom_nodeimpl.h:
18076         * kwq/KWQString.mm:
18077         (QString::endsWith):  Walk the search string correctly.
18078
18079 2002-12-09  Maciej Stachowiak  <mjs@apple.com>
18080
18081         Reviewed by Darin.
18082
18083         - fixed 3103954 - preferences not displayed properly at excite.com
18084         
18085         * khtml/html/html_formimpl.cpp:
18086         (HTMLInputElementImpl::value): If a radio or checkbox input has a
18087         value, return that rather than something based on the checked
18088         state. Only fall back on the checked state if there is no value.
18089
18090 2002-12-09  Maciej Stachowiak  <mjs@apple.com>
18091
18092         Reviewed by Darin.
18093
18094         - fixed 3103036 - REGRESSION: scripts dropped from DOM tree;
18095         javascript text rendered to screen
18096
18097         The problem here is that we don't allow SCRIPT inside MAP, so the
18098         script tag gets thrown away in the DOM and the text is added
18099         directly to the MAP. I can't see a good reason not to allow SCRIPT
18100         here, so I think the best thing to do is relax the DTD.
18101         
18102         * khtml/html/dtd.cpp:
18103         (DOM::checkChild): Relax the DTD to allow SCRIPT inside MAP.
18104
18105 2002-12-08  David Hyatt  <hyatt@apple.com>
18106
18107         Fix for 3007276, styles do not cascade properly through
18108         tables.  The font was being reset to the default font
18109         (konq_default) when it needed to be reset to the body's font.
18110         I added a new font family value called konq_body and the 
18111         style system resolves that value to be the body's font family list.
18112         
18113         Reviewed by: gramps and mjs
18114
18115         * khtml/css/cssstyleselector.cpp:
18116         * khtml/html/html_tableimpl.cpp:
18117         (HTMLTableElementImpl::attach):
18118
18119 2002-12-08  David Hyatt  <hyatt@apple.com>
18120
18121         Fix for 3121814.  Forms inside table elements (tbody and table
18122         etc.) can be inline.  Just remove the assert and replace it
18123         with a bailout.
18124         
18125         Fix for 3036479.  Tables with specified heights but cells
18126         with no height (or no cells at all) were not honoring
18127         the specified height.
18128         
18129         Reviewed by: gramps
18130
18131         * khtml/rendering/render_table.cpp:
18132         (RenderTable::RenderTable):
18133         (RenderTable::startRow):
18134         (RenderTable::layoutRows):
18135         (RenderTable::paint):
18136         (RenderTable::recalcCells):
18137
18138 2002-12-08  Maciej Stachowiak  <mjs@apple.com>
18139
18140         Reviewed by Dave.
18141
18142         - fixed 2981252 - JavaScript inside <!-- --> comments inside <select> is not executed
18143
18144         This problem is caused by the hack to turn all whitespace into
18145         spaces inside <select>, so that it's collapsed in the DOM. But
18146         this is especially bad for scripts inside select tags, so I
18147         changed the select special case to not apply inside scripts.
18148
18149         * khtml/html/htmltokenizer.cpp:
18150         (HTMLTokenizer::addPending): 
18151         (HTMLTokenizer::write):
18152
18153 2002-12-08  Darin Adler  <darin@apple.com>
18154
18155         Reviewed by Don and Dave.
18156
18157         - fixed 3115845 -- bad-pointer crash destroying DOM tree reproducible at a particular site
18158
18159         All hail libgmalloc, without which this would just be another bug I can't reproduce!
18160
18161         This memory trasher bug was caused bug calling setChildrenLoaded after casting a node to
18162         HTMLObjectElementImpl, when the node wasn't always an object element. It turns out that this
18163         fix was made obsolete a while back when I changed close on renderers to be delivered even for
18164         cases where the renderer is not created yet at close time.
18165
18166         * khtml/html/htmlparser.cpp: (KHTMLParser::processCloseTag): Remove the special case for
18167         </object>. Now that this is fixed another way we don't need this at all.
18168
18169         * khtml/html/html_objectimpl.h: Remove setChildrenLoaded and m_childrenLoaded.
18170         * khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::HTMLObjectElementImpl):
18171         Remove code that sets m_childrenLoaded to false.
18172         (HTMLObjectElementImpl::attach): Remove code that looks at m_childrenLoaded, since we don't
18173         need it any more (and in fact there's no way to set it any more).
18174
18175         - fixed 3120578 -- REGRESSION: going to about:blank creates null view
18176
18177         If no tokens are ever sent to the parser, then we end up without a render tree.
18178
18179         * khtml/html/htmlparser.h: Add finished() function.
18180         * khtml/html/htmlparser.cpp: (KHTMLParser::finished): Make an HTML element if the document is still
18181         empty at this point. This is identical to what KHTMLParser::insertNode does when you insert any kind
18182         of element other than an HTML element.
18183
18184         * khtml/html/htmltokenizer.cpp: (HTMLTokenizer::end): Call finished() to let the parser know.
18185
18186         * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::paint): Turn on the "paint red" feature in development builds.
18187         Null view problems are particularly hard to debug without something like this, and we don't care
18188         if development builds are ever-so-slightly slower. No change in deployment.
18189
18190         - fixed 3121527 -- crash in WebCoreBridge frameBorderStyle
18191
18192         * kwq/WebCoreBridge.mm: (-[WebCoreBridge frameBorderStyle]): Handle case where this is called and
18193         we don't have a KHTMLView yet.
18194
18195         - other changes
18196
18197         * WebCore.pbproj/project.pbxproj: Electron is doing his thing.
18198
18199 2002-12-08  David Hyatt  <hyatt@apple.com>
18200
18201         Fix for image bullets.  They were neglecting to offset
18202         themselves by their own width, and were just relying on
18203         sheer luck (the default margin) to accommodate their
18204         size.  The bug is 3007040 (borkware.com).
18205         
18206         Reviewed by: gramps
18207
18208         * khtml/rendering/render_list.cpp:
18209         (RenderListMarker::paintObject):
18210
18211 2002-12-07  David Hyatt  <hyatt@apple.com>
18212
18213         This change fixes three bugs in list items.  
18214
18215         (1) Stop implementing markers as floats.  This is simply
18216         wrong.  The bullet doesn't affect the height of the line
18217         box if it's a float, and it can also affect other
18218         list items that follow the bullet's enclosing list item
18219         (leading to odd staggered layout of lists).
18220
18221         (2) Relax the DTD.  It was trying to obey strict HTML, which
18222         is hopeless in the case of lists.  Match the behavior of
18223         both Gecko and the IEs (mac and win32)  and allow non-list 
18224         content to be inserted between list items without being
18225         wrapped in its own list item.  Lists were making empty
18226         items for whitespace in between items, and this stops that
18227         and makes our lists behave much more like Gecko and the IEs.
18228
18229         (3) The bullet's min and max width weren't getting set, which
18230         could lead to confused line width calculations when image
18231         bullets were used.
18232         
18233         Reviewed by: gramps
18234
18235         * ChangeLog:
18236         * khtml/html/dtd.cpp:
18237         (DOM::checkChild):
18238         * khtml/rendering/bidi.cpp:
18239         (RenderFlow::findNextLineBreak):
18240         * khtml/rendering/render_list.cpp:
18241         (RenderListItem::setStyle):
18242         (RenderListMarker::calcMinMaxWidth):
18243
18244 2002-12-07  Ken Kocienda  <kocienda@apple.com>
18245
18246         Reviewed by: Maciej
18247
18248         Fix for this bug:
18249
18250         Radar 3073988 (URLs with /../ are not resolved before being sent to the host)
18251
18252         * kwq/KWQKURL.mm:
18253         (KURL::KURL):
18254         (copyPathRemovingDots): New function containing code that was pulled out of 
18255         the existing relative URL resolution code. 
18256         (KURL::parse): Call new copyPathRemovingDots function instead of doing same work
18257         inline.
18258
18259 2002-12-06  David Hyatt  <hyatt@apple.com>
18260
18261         Sigh. I forgot to commit the first layer fix (that has already
18262         been reviewed), so now this is also including that.
18263
18264         The first layer fix was to deal with the yale.edu crasher.
18265         It involved making sure that append/remove of render object
18266         trees drill down into those trees to remove/append corresponding
18267         layers (instead of just checking the root of the trees).
18268
18269         The second fix involves making sure that cliprects are right
18270         for painting backgrounds and borders of clipped objects.
18271         Fixes benoit's bug.
18272         
18273         Reviewed by: mjs and darin (fix 1), mjs and gramps (fix 2)
18274
18275         * khtml/rendering/render_container.cpp:
18276         (RenderContainer::removeChildNode):
18277         (RenderContainer::appendChildNode):
18278         (RenderContainer::insertChildNode):
18279         * khtml/rendering/render_container.h:
18280         * khtml/rendering/render_layer.cpp:
18281         (RenderLayer::paint):
18282         (RenderLayer::constructZTree):
18283         * khtml/rendering/render_layer.h:
18284         * khtml/rendering/render_object.cpp:
18285         (RenderObject::appendLayers):
18286         (RenderObject::removeLayers):
18287         (RenderObject::enclosingLayer):
18288         * khtml/rendering/render_object.h:
18289
18290 2002-12-06  Maciej Stachowiak  <mjs@apple.com>
18291
18292         Reviewed by: Darin
18293
18294         - fixed 3077227 - netflix "top 100" page JavaScript runs so
18295         slowly, it seems like a hang
18296
18297         I fixed this by adding hash tables of image and form elements by
18298         name and id. This allows scans of the whole document to be avoided
18299         in many cases.
18300
18301         This also results in a small speedup (~1%) on cvs-js-ibench.
18302
18303         * khtml/dom/html_document.cpp:
18304         * khtml/ecma/kjs_html.cpp:
18305         (KJS::HTMLDocument::hasProperty):
18306         (KJS::HTMLDocument::tryGet):
18307         * khtml/html/html_documentimpl.cpp:
18308         (HTMLDocumentImpl::addNamedImageOrForm):
18309         (HTMLDocumentImpl::removeNamedImageOrForm):
18310         (HTMLDocumentImpl::haveNamedImageOrForm):
18311         * khtml/html/html_documentimpl.h:
18312         * khtml/html/html_formimpl.cpp:
18313         (HTMLFormElementImpl::attach):
18314         (HTMLFormElementImpl::detach):
18315         (HTMLFormElementImpl::parseAttribute):
18316         * khtml/html/html_formimpl.h:
18317         * khtml/html/html_imageimpl.cpp:
18318         (HTMLImageElementImpl::parseAttribute):
18319         (HTMLImageElementImpl::attach):
18320         (HTMLImageElementImpl::detach):
18321         * khtml/html/html_imageimpl.h:
18322
18323 2002-12-06  David Hyatt  <hyatt@apple.com>
18324
18325         Hack to make i-bench paint every fourth page.  We can tune
18326         this # as needed. 
18327         
18328         Reviewed by: darin
18329
18330         * khtml/html/html_documentimpl.cpp:
18331         (HTMLDocumentImpl::close):
18332         * khtml/rendering/render_flow.h:
18333
18334 2002-12-06  Darin Adler  <darin@apple.com>
18335
18336         Reviewed by Trey.
18337
18338         Update to latest character-sets document.
18339
18340         * kwq/character-sets.txt: Got the newest one and merged in our change.
18341         * kwq/KWQCharsetData.c: Regenerated this. Added just one character set name.
18342
18343 2002-12-06  Darin Adler  <darin@apple.com>
18344
18345         Reviewed by Maciej.
18346
18347         * khtml/ecma/kjs_events.h: Add listenerObjImp() method so we don't have to
18348         ref/unref for speed-critical uses.
18349
18350         * khtml/ecma/kjs_window.cpp: (Window::getJSEventListener): Change this
18351         to work with ObjectImp so we don't ref/unref each listener. This should give
18352         us some extra speed.
18353
18354 2002-12-06  Maciej Stachowiak  <mjs@apple.com>
18355
18356         Reviewed by: Darin Adler
18357
18358         - made framework embedding work correctly with buildit
18359
18360         * WebCore.pbproj/project.pbxproj: Give framework a relative
18361         install path, don't install it the normal way, and copy it
18362         manually to /AppleInternal/Library/Frameworks if installing. Also
18363         look for other frameworks in
18364         ${DSTROOT}/AppleInternal/Library/Frameworks.
18365
18366 2002-12-06  Darin Adler  <darin@apple.com>
18367
18368         Reviewed by Trey.
18369
18370         - fixed 3111903 -- crash in DOM::HTMLDocumentImpl::close
18371
18372         * khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::close):
18373         Check for the case where view() is 0 so we don't do a null-dereference.
18374         Also, remove some of the unneeded redundant isNull/isEmpty checking here.
18375
18376 2002-12-05  Darin Adler  <darin@apple.com>
18377
18378         Reviewed by Don.
18379
18380         - fixed 3116149 -- REGRESSION: assert on invalid encoding trying to show accuweather.com source
18381
18382         The regression was caused when we updated the View Source window to try to get the encoding right.
18383
18384         * kwq/WebCoreBridge.mm: (+[WebCoreBridge stringWithData:textEncoding:]):
18385         Make this function decode the string as Windows Latin-1 if the passed-in encoding is
18386         invalid or ISO Latin-1, since that's what we always want.
18387
18388         * kwq/mac-encodings.txt: Add "8859_1" since we have now seen it "in the wild".
18389         * kwq/KWQCharsetData.c: Check in new version of generated file.
18390
18391 2002-12-05  David Hyatt  <hyatt@apple.com>
18392
18393         Fix for javadoc page.  It specified an invalid unit, and our
18394         unit match was on a substring, so it allowed "pts" when it
18395         shouldn't.  This patch adds some code to help handle this
18396         error case.
18397
18398         Bug # is 3119830.
18399         
18400         Reviewed by: rjw
18401
18402         * khtml/css/cssparser.cpp:
18403         (StyleBaseImpl::parseUnit):
18404
18405 2002-12-05  Chris Blumenberg  <cblu@apple.com>
18406
18407         Reviewed by: rjw
18408
18409         * kwq/WebCoreBridge.h:
18410         * kwq/WebCoreBridge.mm:
18411         (-[WebCoreBridge selectedString]): renamed to reflect WebDocument API change
18412         (-[WebCoreBridge deselectAll]): added
18413         (-[WebCoreBridge elementAtPoint:]): call selectedString
18414
18415 2002-12-05  David Hyatt  <hyatt@apple.com>
18416
18417         Fix relative positioned elements to add in the right offset
18418         when repainting themselves.
18419         
18420         Reviewed by: darin
18421
18422         * khtml/rendering/render_box.cpp:
18423         (RenderBox::repaintRectangle):
18424
18425 2002-12-05  Richard Williamson   <rjw@apple.com>
18426
18427         Fixed two issues relating to font sizes.  Fixes any page
18428         that specifies font size in device independent units, i.e.
18429         www.abcnews.com.
18430          
18431         1.  Change dpi to 72.  Mac OS X does appear to assume 72, not 96!
18432         2.  Don't appply DPI adjustments to font selections, instead
18433         normalize values to points.  OS X takes care of device scaling.
18434         
18435         Reviewed by: gramps
18436
18437         * khtml/css/css_valueimpl.cpp:
18438         (CSSPrimitiveValueImpl::computeLengthFloat):
18439         (CSSPrimitiveValueImpl::computePointFloat):
18440         * khtml/css/css_valueimpl.h:
18441         * khtml/css/cssstyleselector.cpp:
18442         * kwq/KWQPaintDeviceMetrics.mm:
18443         (QPaintDeviceMetrics::logicalDpiY):
18444
18445 2002-12-05  David Hyatt  <hyatt@apple.com>
18446
18447         Make sure that blocks with block children compute their
18448         minwidth and maxwidth correctly.  This fixes 4-5 bugs on my
18449         list, including the becblog.blogspot.com misrender and
18450         the wrapping list item on webstandards.org.
18451
18452         The fix ensures that the margins of a child have been
18453         computed before they are asked for by the parent in
18454         calcBlockMinMaxWidth.
18455
18456         Also fix a bug in collapsing margins that caused the height
18457         of positioned elements that contained only zero-height children
18458         to not compute their heights correctly.  We now pass tests 2
18459         and 3 on the collapsing margin tests with this fix.  
18460         
18461         Reviewed by: trey
18462
18463         * khtml/rendering/render_flow.cpp:
18464         (RenderFlow::layoutBlockChildren):
18465         (RenderFlow::calcBlockMinMaxWidth):
18466         
18467 2002-12-05  David Hyatt  <hyatt@apple.com>
18468
18469         Fix for wsj.com orange underline regression.  In quirks mode
18470         only, don't let anchors without hrefs go into :hover.  This
18471         matches MacIE's behavior.
18472
18473         The bug is 3118643.
18474         
18475         Reviewed by: mjs
18476
18477         * khtml/rendering/render_object.cpp:
18478         (RenderObject::setHoverAndActive):
18479         (RenderObject::nodeAtPoint):
18480         * khtml/rendering/render_object.h:
18481         * khtml/rendering/render_text.h:
18482
18483 2002-12-04  Maciej Stachowiak  <mjs@apple.com>
18484
18485         Reviewed by: David Hyatt
18486
18487         - fixed 3118083 - WebCore includes config.h from Labyrinth top level
18488         
18489         * Makefile.am: Regenerate config.h from top-level version, but
18490         make sure not to alter date if it has not changed.
18491         * config.h: Added (autogenerated but checked in for benefit of B&I).
18492         * ForwardingHeaders/config.h: Include WebCore copy rather than
18493         Labyrinth copy.
18494
18495 2002-12-04  Maciej Stachowiak  <mjs@apple.com>
18496
18497         Reviewed by: David Hyatt
18498
18499         - fixed 3049601 - support the equivalent of
18500         createcontextualfragment(NS6) or insertAdjacentHTML (IE)
18501
18502         - fixed 3108065 - DHTML at expedia.com doesn't work-- lack of
18503         support for createContextualFragment
18504
18505         - fixed 3114627 - DHTML menus used in Yahoo mail don't work-- lack
18506         of support for createContextualFragment
18507
18508         - improvement towards 3052113 - "site menu" part of .mac home page
18509         editing doesn't work
18510         
18511         * khtml/ecma/kjs_range.h:
18512         * khtml/ecma/kjs_range.cpp:
18513         (DOMRangeProtoFunc::tryCall): Added suppor for
18514         createContextualFragment method.
18515         * khtml/ecma/kjs_range.lut.h: Regenerated.
18516         * khtml/dom/dom2_range.h:
18517         * khtml/dom/dom2_range.cpp:
18518         (Range::createContextualFragment): Implemented (calls impl).
18519         * khtml/html/html_elementimpl.h:
18520         * khtml/html/html_elementimpl.cpp:
18521         (HTMLElementImpl::createContextualFragment): Factored out of setInnerHTML.
18522         (HTMLElementImpl::setInnerHTML): Call createContextualFragment to
18523         make the fragment.
18524         * khtml/xml/dom2_rangeimpl.h:
18525         * khtml/xml/dom2_rangeimpl.cpp:
18526         (RangeImpl::createContextualFragment): Implemented (calls start
18527         container element).
18528
18529 2002-12-04  David Hyatt  <hyatt@apple.com>
18530
18531         Fix assert on compuserve page.  <form> under <table> should not
18532         get a layout() call.
18533         
18534         Reviewed by: gramps
18535
18536         * khtml/rendering/render_flow.cpp:
18537         (RenderFlow::layout):
18538         * khtml/rendering/render_table.cpp:
18539         (RenderTable::layout):
18540
18541 2002-12-04  David Hyatt  <hyatt@apple.com>
18542
18543         Fix shroudedisles.com table misalignment by removing more\
18544         bogus rules from html4.css.
18545
18546         Fix forums on macosx.com by implementing support for the align
18547         attribute on the <P> tag.
18548
18549         Implement min-width and max-width for block level floating
18550         and normal flow elements.
18551
18552         Fix event handling so that :hover notifications get through to
18553         objects inside floats.
18554         
18555         Reviewed by: rjw
18556
18557         * khtml/css/html4.css:
18558         * khtml/html/html_blockimpl.cpp:
18559         (HTMLParagraphElementImpl::parseAttribute):
18560         * khtml/html/html_blockimpl.h:
18561         * khtml/rendering/render_box.cpp:
18562         (RenderBox::calcWidth):
18563         (RenderBox::calcWidthUsing):
18564         (RenderBox::calcHeight):
18565         * khtml/rendering/render_box.h:
18566         * khtml/rendering/render_flow.cpp:
18567         (RenderFlow::layoutBlockChildren):
18568         (RenderFlow::nodeAtPoint):
18569         * khtml/rendering/render_flow.h:
18570         * khtml/rendering/render_frames.cpp:
18571         (RenderFrameSet::nodeAtPoint):
18572         * khtml/rendering/render_frames.h:
18573         * khtml/rendering/render_image.cpp:
18574         (RenderImage::nodeAtPoint):
18575         * khtml/rendering/render_image.h:
18576         * khtml/rendering/render_object.cpp:
18577         (RenderObject::nodeAtPoint):
18578         * khtml/rendering/render_object.h:
18579         * khtml/rendering/render_root.cpp:
18580         (RenderRoot::calcHeight):
18581         * khtml/rendering/render_style.cpp:
18582         (StyleBoxData::StyleBoxData):
18583         * khtml/rendering/render_text.cpp:
18584         (RenderText::nodeAtPoint):
18585         * khtml/rendering/render_text.h:
18586
18587 2002-12-04  Darin Adler  <darin@apple.com>
18588
18589         Reviewed by Trey and Maciej.
18590
18591         - fixed 3117558 -- Assertion failure in KWQKHTMLPart::slotData after typing "amazon.com" twice
18592         - got rid of the per-part NSEvent in preparation for NSView mouse event handling going through WebCore
18593
18594         * khtml/khtml_part.h: Added declaration for didOpenURL.
18595         * khtml/khtml_part.cpp: (KHTMLPart::openURL): Changed name to didOpenURL in the APPLE_CHANGES
18596         version because calls to openURL from within KHTML need to make the round trip to WebKit.
18597         Also disabled the "scroll to anchor" part.
18598
18599         * kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Fix to return false when document is 0.
18600
18601         * kwq/KWQKHTMLPart.h: Add scrollToAnchor, remove setCurrentEvent and _currentEvent
18602         * kwq/KWQKHTMLPart.mm:
18603         (KHTMLPart::openURL): Pass the openURL call to the KWQKHTMLPart.
18604         (KWQKHTMLPart::KWQKHTMLPart): Don't initialize _currentEvent.
18605         (KWQKHTMLPart::~KWQKHTMLPart): Don't release _currentEvent.
18606         (KWQKHTMLPart::submitForm): Pass [NSApp currentEvent] instead of _currentEvent.
18607         (KWQKHTMLPart::urlSelected): Pass [NSApp currentEvent] instead of _currentEvent.
18608         (KWQKHTMLPart::scrollToAnchor): Added. Contains the code from the anchor case inside
18609         KHTMLPart::openURL.
18610
18611         * kwq/WebCoreBridge.h: Added scrollToAnchorWithURL:.
18612         * kwq/WebCoreBridge.mm:
18613         (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]): Change around so that we
18614         don't do a bunch of irrelevant stuff in the page cache case. I think we might just want to
18615         make a separate method for the page cache case.
18616         (-[WebCoreBridge scrollToAnchorWithURL:]): Added.
18617         (-[WebCoreBridge mouseUp:]): Simplify check for nil view. Remove calls to setCurrentEvent.
18618         (-[WebCoreBridge mouseDown:]): Simplify check for nil view. Fix event type constants for
18619         right mouse button and other mouse button.
18620         (-[WebCoreBridge mouseMoved:]): Simplify check for nil view.
18621         (-[WebCoreBridge mouseDragged:]): Simplify check for nil view.
18622
18623 2002-12-04  Richard Williamson   <rjw@apple.com>
18624
18625         Cache the NSFont in QFont after doing family based lookup.
18626         Use that cached font to find a text renderer.
18627
18628         Reviewed by: Darin
18629
18630         * kwq/KWQFont.h:
18631         * kwq/KWQFont.mm:
18632         (QFont::QFont):
18633         (QFont::~QFont):
18634         (QFont::setFamily):
18635         (QFont::setFirstFamily):
18636         (QFont::setPixelSize):
18637         (QFont::setWeight):
18638         (QFont::setItalic):
18639         (QFont::getNSFont):
18640         * kwq/KWQFontMetrics.mm:
18641         * kwq/KWQPainter.mm:
18642         (QPainter::_updateRenderer):
18643         * kwq/WebCoreTextRendererFactory.h:
18644         * kwq/WebCoreTextRendererFactory.m:
18645         (-[WebCoreTextRendererFactory rendererWithFont:]):
18646
18647 2002-12-04  Richard Williamson   <rjw@apple.com>
18648
18649         Cache the last used text renderer to avoid expensive lookup
18650         when font hasn't changed.
18651
18652         Reviewed by: maciej
18653
18654         * khtml/rendering/render_flow.cpp:
18655         (RenderFlow::layout):
18656         * kwq/KWQPainter.h:
18657         * kwq/KWQPainter.mm:
18658         (QPainter::_updateRenderer):
18659         (QPainter::drawText):
18660         (QPainter::drawUnderlineForText):
18661
18662 == Rolled over to ChangeLog-2002-12-03 ==