blob: 04d788457f4b2310196cd62438a8b84c5f72bdb5 [file] [log] [blame]
2003-04-29 Darin Adler <darin@apple.com>
Mostly reviewed by Ken, some bits reviewed by John.
- fixed 3188781 -- eliminate globally initialized objects from WebCore
* kwq/KWQString.h: Change QChar::null to be a char constant, and QString::null to be a const char *.
In the cases where the code still compiles after these changes, everything works fine. A few cases
that didn't compile are fixed below.
* kwq/KWQString.mm: Remove QString::null.
(QString::mid): Return QString() instead of null.
* kwq/KWQChar.mm: Remove the definition of QChar::null.
* khtml/css/css_base.cpp: (CSSSelector::extractPseudoType): Use DOMString explicitly in one place
where the code said QString::null. The trick where QString::null is really a const char * does not
work in this case.
* khtml/khtml_part.cpp: (KHTMLPart::reparseConfiguration): Use QString() instead of QString::null
in one place. The trick where QString::null is really a const char * does not work in this case.
* kwq/KWQKHTMLSettings.h: Use QString() for settingsToCSS, the trick where QString::null is really
a const char * does not work in this case.
* khtml/rendering/render_list.cpp: (RenderListMarker::paintObject): Use an isEmpty check here instead
of comparing with QString::null. Not sure this change was strictly required, but it is simpler and
may also make the code slightly faster.
* kwq/KWQKFileDialog.h: Removed. This used QString::null in a way that is incompatible with the new
"0" hack, but was not used any more.
* kwq/KWQKFileDialog.mm: Removed.
* ForwardingHeaders/kfiledialog.h: Empty this out, since there is no KWQKFileDialog.h any more.
* WebCore.pbproj/project.pbxproj: Removed KWQKFileDialog.h and .mm.
* khtml/html/htmltokenizer.cpp: Change the commentStart global array to be an array of char instead
of QChar to avoid the static constructor; the code works fine with char anyway.
* khtml/html/html_formimpl.cpp: Change the global constants in this file to be char instead of QChar.
It works this way (and faster for KWQ), and avoids the static constructor.
* khtml/rendering/bidi.h: Change BidiIterator from a class with constructors into a plain struct.
The copy construct and assignment operator weren't needed anyway since they simply duplicated default
assignment, and if we have a constructor then we can't use it as a global object, since we want to
avoid static constructors. Do the same with BidiStatus, and also stop using bit fields. It's silly to
use bit fields for something when we have only one global instance of it; just makes extra code size
and saves a few bytes.
* khtml/rendering/bidi.cpp:
(BidiIterator::current): Move the non-breaking space global inside this function.
(appendRunsForObject): Initialize BidiIterator object using brace notation.
(buildCompactRuns): Initialize BidiIterator objects using brace notation and assignment.
(RenderBlock::layoutInlineChildren): Initialize BidiStatus fields separately. Initialize BidiIterator
objects using brace notation and assignment.
(RenderBlock::findNextLineBreak): Initialize BidiIterator objects using brace notation and assignment.
* khtml/rendering/render_frames.cpp: Removed an include of <iostream.h>. This pulled the entire
C++ I/O library in, with lots of static constructors. Elsewhere, we are careful not to use the C++
I/O library in WebCore except in Development versions. And this file didn't actually use the library,
just included the header.
* kwq/KWQNamespace.h: Remove all the color globals except for the ones used in KHTML: black, white,
darkGray, gray, and lightGray. And for those, make the globals RGB constants instead of QColor objects.
This gets rid of the global objects with constructors and works without any KHTML code changes.
* kwq/KWQColor.mm: Remove the definition of the QColor constants from the Qt class.
* kwq/KWQPainter.h: Add overloads for setPen and setBrush so they work with the "color" constants
from Qt that are now RGB constants rather than QColor objects.
* kwq/KWQPainter.mm:
(QPainter::setPen): Set style to solid line and width to 0 when the parameter is an RGB constant.
This is just like what you'd get if you constructed a QPen.
(QPainter::setBrush): Set style to solid pattern when the parameter is an RGB constant.
This is just like what you'd get if you constructed a QBrush.
* khtml/misc/loader.h: Change m_LRULists to be a global pointer instead of a global array, so
we don't have to statically construct LRUList objects.
* khtml/misc/loader.cpp: (Cache::getLRUListFor): Allocate the global array the first time we
pass through here.
2003-04-29 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3242460 -- crash in NSPopUpButtonCell at acheter-moins-cher.com
* kwq/KWQComboBox.mm: (-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
Defer QObject timers too as well as loading while tracking a pop-up.
* kwq/KWQObject.h: Add defersTimers and setDefersTimers functions.
* kwq/KWQObject.mm:
(QObject::setDefersTimers): Added. When called with true starts deferring timers. When called
with false schedules a "delay 0" task to deliver all the timers and stop deferring them.
(-[KWQObjectTimerTarget sendTimerEvent]): Added. Contains guts of the old timerFired method.
(-[KWQObjectTimerTarget timerFired]): Puts timer on the deferred timers list or calls sendTimerEvent.
(+[KWQObjectTimerTarget stopDeferringTimers]): Remove timers items from the deferred timers list,
and makes them fire, then stops deferring timers.
* WebCore.pbproj/project.pbxproj: Reorder things a bit.
2003-04-29 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3230885 -- crash loading hixie test page in -[WebSubresourceClient connection:didReceiveData:]
* khtml/rendering/render_style.cpp: (RenderStyle::setContent):
Change code around so we don't deref the text object without checking
the contentType. Also fix the leak of a DOMStringImpl in the case
where we are asked to add a string, but the string pointer is 0.
2003-04-28 Richard Williamson <rjw@apple.com>
API changes from final review meeting.
goBackOrForwardToItem: -> goToBackForwardItem:
drop "Window" from WebUIDelegate method names.
WebElementIsSelectedTextKey -> WebElementIsSelectedKey
Cross-frame searchFor on WebView now public.
Reviewed by Chris.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
2003-04-28 Darin Adler <darin@apple.com>
Reviewed by John.
- re-fixed 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
* khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::attach): Only set the type
if JavaScript hasn't set it explicitly already.
2003-04-25 David Hyatt <hyatt@apple.com>
Part two of the overflow patch. This adds the scrollbars and
patches the layers code, but it doesn't yet turn on the
overflow:auto capability.
Reviewed by mjs/gramps
* ForwardingHeaders/qscrollbar.h: Added.
* WebCore.pbproj/project.pbxproj:
* khtml/ecma/kjs_dom.cpp:
(DOMNode::getValueProperty):
(DOMNode::putValue):
* khtml/ecma/kjs_dom.h:
* khtml/ecma/kjs_dom.lut.h:
* khtml/rendering/render_box.cpp:
(RenderBox::contentWidth):
(RenderBox::repaintRectangle):
(RenderBox::calcAbsoluteHorizontal):
(RenderBox::calcAbsoluteVertical):
(RenderBox::lowestPosition):
* khtml/rendering/render_layer.cpp:
(RenderScrollMediator::slotValueChanged):
(RenderLayer::RenderLayer):
(RenderLayer::~RenderLayer):
(RenderLayer::updateLayerPosition):
(RenderLayer::scrollOffset):
(RenderLayer::subtractScrollOffset):
(RenderLayer::scrollToOffset):
(RenderLayer::updateScrollPositionFromScrollbars):
(RenderLayer::setHasHorizontalScrollbar):
(RenderLayer::setHasVerticalScrollbar):
(RenderLayer::verticalScrollbarWidth):
(RenderLayer::horizontalScrollbarHeight):
(RenderLayer::moveScrollbarsAside):
(RenderLayer::positionScrollbars):
(RenderLayer::checkScrollbarsAfterLayout):
(RenderLayer::paintScrollbars):
(RenderLayer::paint):
(RenderLayer::nodeAtPoint):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.cpp:
(RenderObject::clientWidth):
(RenderObject::clientHeight):
(RenderObject::scrollWidth):
(RenderObject::scrollHeight):
(RenderObject::nodeAtPoint):
* khtml/rendering/render_object.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget):
* kwq/KWQNamespace.h:
* kwq/KWQScrollBar.h: Added.
* kwq/KWQScrollBar.mm: Added.
(-[KWQScrollBar initWithQScrollBar:]):
(-[KWQScrollBar scroll:]):
(:m_valueChanged):
(QScrollBar::~QScrollBar):
(QScrollBar::setValue):
(QScrollBar::setSteps):
(QScrollBar::setKnobProportion):
(QScrollBar::scrollbarHit):
(QScrollBar::valueChanged):
* kwq/KWQSlot.mm:
(KWQSlot::KWQSlot):
(KWQSlot::call):
2003-04-24 David Hyatt <hyatt@apple.com>
Rename inQuirksMode to inCompatMode. Drop uses of it in
the render tree code in favor of style()->htmlHacks().
Remove dead code in the parser dealing with discarded attributes.
Optimize bidi run justification by adding a guard.
Fix :target to not match :root when no fragment ID is specified.
Reviewed by mjs/gramps
* khtml/css/cssstyleselector.cpp:
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
* khtml/html/html_headimpl.cpp:
(HTMLLinkElementImpl::setStyleSheet):
(HTMLStyleElementImpl::childrenChanged):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::createSharedCellDecls):
* khtml/html/htmlparser.cpp:
(KHTMLParser::~KHTMLParser):
(KHTMLParser::reset):
(KHTMLParser::parseToken):
(KHTMLParser::insertNode):
* khtml/html/htmlparser.h:
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::parseTag):
* khtml/khtml_part.cpp:
(KHTMLPart::gotoAnchor):
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paintLineBoxDecorations):
(RenderFlow::repaint):
* khtml/rendering/render_inline.cpp:
* khtml/rendering/render_inline.h:
* khtml/rendering/render_list.cpp:
(getParentOfFirstLineBox):
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
* khtml/rendering/render_text.cpp:
(RenderText::paintObject):
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::recalcStyle):
(DocumentImpl::recalcStyleSelector):
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::createDecl):
2003-04-24 Darin Adler <darin@apple.com>
Reviewed by Chris.
- fixed 3210096 -- server identifies page as UTF-8, page identifies itself as windows-1252, server must win
- fixed 3105796 -- www.thai.com does not display with correct encoding (<body> tag in comment before <meta>)
* khtml/khtml_part.cpp:
(KHTMLPart::write): Pass in an EncodingType rather than just a boolean. This lets us tell
the difference between EncodingFromHTTPHeader (which wins out over an encoding in a meta tag)
and DefaultEncoding (which loses).
(KHTMLPart::setEncoding): Put ifdef around the whole function. We use our own version in
KWQKHTMLPart instead.
* khtml/misc/decoder.h: Defined an EncodingType and changed the parameter to setEncoding to take
it instead of force and 8-bit-only parameters. Store it in m_type and get rid of haveEncoding.
* khtml/misc/decoder.cpp:
(Decoder::Decoder): Set m_type to DefaultEncoding.
(Decoder::setEncoding): Take a type parameter, instead of force and 8-bit-only parameters.
Use "eight-bit-only" mode for EncodingFromMetaTag only. Fix code so we don't clobber an existing
codec if we can't find a new one in a simpler way. Store the type in m_type, rather than using
the confusing "haveEncoding" flag.
(skipComment): Added. Used to skip comments found in the <head> section.
(Decoder::decode): Moved the check for the UTF-16 BOM out and do that check even when we have
an encoding (although not if we have one the user chose). Update check so that we look for a meta
tag when we have nothing except a default encoding. This fixes the bug where we have an encoding
from an HTTP header; in that case we do not want to look at the meta tag. Improve performance a bit
by not constructing a string just so we can append the data. Merged the APPLE_CHANGES case a bit
with the original case better. Added code to skip comments; this fixes the thai.com issue. Improved
the code to handle data after the first buffer full. We now avoid putting data into a QString once
we are past the header. Extended an APPLE_CHANGES ifdef to exclude more code we don't need.
* kwq/KWQKHTMLPart.h: Added setEncoding and addData to replace slotData.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::setEncoding): Added. Needs to be called only once and does the first-time work as
well as setting up the encoding for the page. In practice it is called before each time addData is.
(KWQKHTMLPart::addData): Added. Needs to be called for each run of data. Now just calls write(),
but does some assertions, which is why I have not removed it and changed the bridge to call write().
* kwq/WebCoreBridge.h: Replaced the old addData:withEncoding: and addData:withOverrideEncoding: with
setEncoding:userChosen: and addData:.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge setEncoding:userChosen:]): Call setEncoding on the part.
(-[WebCoreBridge addData:]): Call addData on the part.
2003-04-24 Darin Adler <darin@apple.com>
Reviewed by John.
- improved the text encoding database
* kwq/mac-encodings.txt: Changed to a new format. Now the first encoding name in every list
is the "canonical" one and is in canonical case and punctuation (no longer requiring lowercase).
Since the first is the one that will be used outgoing to send to servers, it's good to have
that one in canonical form. All subsequent aliases in the list are now required to be all
lowercase and not use any punctuation. Since the comparison is done ignoring non-alphanumeric
characters, and ignoring case, this will have no effect on which encodings are recognized.
* kwq/make-charset-table.pl: Updated to enforce the new format rules.
* kwq/KWQCharsetData.c: Regenerated.
* khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::formData): Simplify the "change commas
to spaces" code in a way that lets us get rid of APPLE_CHANGES. Use the official "ISO-8859-1"
here instead of something almost, but not quite, like it.
* kwq/KWQKCharsets.mm: (KCharsets::codecForName): Use the official "ISO-8859-1" here instead
of the unofficial "latin1". Unimportant, but cleaner this way.
- preparation for some text encoding changes to fix some bugs
* kwq/KWQKHTMLSettings.h: Added an encoding value rather than always returning a hardcoded
value. Other minor cleanup.
* kwq/KWQKHTMLSettings.mm: Removed.
* WebCore.pbproj/project.pbxproj: Removed KWQKHTMLSettings.mm.
- other changes
* kwq/KWQKHTMLPart.h: Removed "using" statement. Headers must not pollute the namespace
by doing "using".
* khtml/khtml_part.cpp: Added a "using" here.
* kwq/KWQPageState.mm: Added a "using" here.
* kwq/KWQString.h: Added an append that takes a const char * and length for use by the decoder.
* kwq/KWQString.mm: (QString::append): Implemented it.
* kwq/WebCoreSettings.h: Added default text encoding field and methods.
* kwq/WebCoreSettings.mm:
(-[WebCoreSettings dealloc]): Release defaultTextEncoding.
(-[WebCoreSettings setDefaultTextEncoding:]): Added.
(-[WebCoreSettings defaultTextEncoding]): Added.
=== Safari-75 ===
=== Safari-74 ===
2003-04-24 John Sullivan <sullivan@apple.com>
- fixed 3151501 -- Toggling "Check Spelling As You Type" in a
textarea should affect future textareas
Reviewed by Darin
* kwq/KWQTextArea.mm:
(+[KWQTextAreaTextView _setContinuousSpellCheckingEnabledForNewTextAreas:]):
new method, sets a static variable and an NSUserDefault
(+[KWQTextAreaTextView _isContinuousSpellCheckingEnabledForNewTextAreas]):
new method, checks a static variable, reading it from an NSUserDefault the
first time
(-[KWQTextAreaTextView initWithFrame:textContainer:]):
override designated initializer to set continuous spell checking if appropriate
(-[KWQTextAreaTextView setContinuousSpellCheckingEnabled:]):
call _setContinuousSpellCheckingEnabledForNewTextAreas in addition to
setting the value for this object
2003-04-23 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3237301 -- REGRESSION: text fields with size greater than maxlength are sized according to maxlength
* kwq/KWQLineEdit.mm: (QLineEdit::sizeForCharacterWidth): Override the maximum length
for this operation.
- fixed 3236961 -- setting innerHTML with input elements doesn't set up value properly
To fix this, I rolled in the changes from the trunk of KHTML development that get rid of
the init() function and do the work in either attach() or insertedIntoDocument() instead.
* khtml/html/html_baseimpl.h: Removed init overrides, added insertedIntoDocument override.
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::insertedIntoDocument): Moved HTMLBodyElementImpl::init code here.
(HTMLFrameElementImpl::attach): Moved HTMLFrameElementImpl::init code here.
(HTMLFrameSetElementImpl::attach): Moved HTMLFrameSetElementImpl::init code here.
* khtml/html/html_formimpl.h: Added m_inited flag, removed init overrides, removed unused
m_encCharset field.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formData): Removed code that set m_encCharset.
(HTMLFormElementImpl::setEnctype): Removed code that set m_encCharset.
(HTMLInputElementImpl::HTMLInputElementImpl): Initialize m_inited to false.
(HTMLInputElementImpl::attach): Moved HTMLInputElementImpl::init code here, guarded by
m_inited.
(HTMLSelectElementImpl::attach): Moved HTMLSelectElementImpl::init code here.
(HTMLTextAreaElementImpl::attach): Moved HTMLTextAreaElementImpl::init code here.
* khtml/xml/dom_nodeimpl.h: Removed init.
* khtml/xml/dom_nodeimpl.cpp: Removed init.
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Removed calls to init.
* khtml/xml/xml_tokenizer.cpp:
(XMLHandler::startElement): Removed call to init.
(XMLHandler::startCDATA): Removed call to init.
(XMLHandler::exitText): Removed call to init.
2003-04-22 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3158411 -- radio button groups are per-form in WebCore, per-page in other browsers (flyglobespan.com)
* khtml/html/html_formimpl.h: Removed radioClicked. Made setName virtual and make
HTMLInputElementImpl override it. Added isCheckedRadioButtonForDocument,
addCheckedRadioButtonToDocument, and removeCheckedRadioButtonFromDocument.
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::~HTMLInputElementImpl): Call removeCheckedRadioButtonFromDocument.
(HTMLInputElementImpl::setType): Call removeCheckedRadioButtonFromDocument before changing
the type and addCheckedRadioButtonToDocument after.
(HTMLInputElementImpl::parseAttribute): Call removeCheckedRadioButtonFromDocument before changing
ATTR_NAME and addCheckedRadioButtonToDocument after.
(HTMLInputElementImpl::setChecked): Call removeCheckedRadioButtonFromDocument before changing
the checked state and addCheckedRadioButtonToDocument after.
(HTMLInputElementImpl::setName): Call removeCheckedRadioButtonFromDocument before changing
the name and addCheckedRadioButtonToDocument after.
(HTMLInputElementImpl::isCheckedRadioButtonForDocument): Added. Checks if this element should
be the one known to the document.
(HTMLInputElementImpl::addCheckedRadioButtonToDocument): Call addCheckedRadioButton on the
document if isCheckedRadioButtonForDocument returns true.
(HTMLInputElementImpl::removeCheckedRadioButtonFromDocument): Call
removeCheckedRadioButtonFromDocument on the document if isCheckedRadioButtonForDocument
returns true.
* khtml/xml/dom_docimpl.h: Add addCheckedRadioButton, removeCheckedRadioButton, and
m_checkedRadioButtons.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::addCheckedRadioButton): Uncheck the old radio button with this name, if any.
Store the new radio button in the "checked radio buttons" map.
(DocumentImpl::removeCheckedRadioButton): Remove the radio button from the map.
2003-04-22 Darin Adler <darin@apple.com>
* khtml/html/html_formimpl.h: Remove radioClicked.
* khtml/html/html_formimpl.cpp: (HTMLInputElementImpl::setChecked): When unchecking other
input elements with the same name, traverse the entire document, not just the form.
2003-04-22 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3144966 -- problems typing in form at http://www.mobile.att.net/messagecenter
The bug was that doing a focus would always select the entire contents of the field.
While this behavior does match Mozilla's behavior for text fields, it doesn't match
WinIE; we're going to imitate WinIE and not do it. Also fix the same issue for text areas.
* kwq/KWQTextField.h: Add lastSelectedRange field.
* kwq/KWQTextField.mm:
(-[KWQTextField initWithFrame:]): Initialize lastSelectedRange (to nothing).
(-[KWQTextField initWithQLineEdit:]): Use [self init] instead of [super init]. The same
thing, but you should never call [super xxx] where xxx is a non-designated initializer
of the superclass.
(-[KWQTextField currentEditorForEitherField]): Added. Returns the current editor of either
the text field or the secure text field.
(-[KWQTextField selectedRange]): Added.
(-[KWQTextField setSelectedRange:]): Added.
(-[KWQTextField controlTextDidEndEditing:]): Store the selected text range in the
lastSelectedRange variable, so it can be used later. Also move the code that sends the
FocusOut event here.
(-[KWQTextField control:textShouldBeginEditing:]): Do the "scroll frame into view" here
isntead of in becomeFirstResponder so it can be shared.
(-[KWQTextField control:textShouldEndEditing:]): Moved FocusOut to controlTextDidEndEditing:.
(-[KWQTextField didBecomeFirstResponder]): Added. Sets the selected range back to what it
was in textShouldEndEditing, but only if we are not tabbing into the field. If we don't set
the selected range, then we inherit the behavior from NSTextField, all text selected.
We can't do the selected range work in textDidEndEditing because that's called too early.
(-[KWQTextField becomeFirstResponder]): Call didBecomeFirstResponder.
(-[KWQSecureTextField currentEditorForSecureField]): Added. Factored out of selectText:.
(-[KWQSecureTextField selectText:]): Use currentEditorForSecureField for clarity.
(-[KWQSecureTextField becomeFirstResponder]): Call didBecomeFirstResponder.
* kwq/KWQTextArea.mm:
(-[KWQTextArea _createTextView]): Rearrange a bit.
(-[KWQTextArea setWordWrap:]): Ditto.
(-[KWQTextAreaTextView becomeFirstResponder]): Only do the selectAll: operation here
if we are tabbing into the field. Otherwise keep the selection from last time.
* khtml/rendering/render_form.cpp: (RenderTextArea::updateFromElement): Don't do the
whole "save cursor position, set text, restore cursor position" dance for the case
where the field already has the correct contents. Without this change, selections can be
collapsed to an insertion point at the start of the selection at seemingly random times.
* khtml/khtmlview.cpp: (KHTMLView::dispatchMouseEvent): Don't deselect the currently
focused node on mouse down. This created a symptom where a text field would lose
focus when you clicked on a button.
* kwq/KWQLineEdit.h: Remove unused frame() method.
* kwq/KWQLineEdit.mm: Remove unused, unimplemented frame() method.
2003-04-21 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed bug 3159076 -- turbotax.intuit.com forms have text fields instead of radio buttons
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::setType): Implement; loosen rule about what type changes are allowed.
(HTMLInputElementImpl::parseAttribute): Call setType for ATTR_TYPE.
- unrelated tweak
* kwq/KWQSlot.mm: (KWQSlot::KWQSlot): Use a macro here to make it a little easier to add items.
2003-04-21 Chris Blumenberg <cblu@apple.com>
Use renamed plug-in view methods.
Reviewed by john.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::createPart):
* kwq/KWQKJavaAppletWidget.mm:
(KJavaAppletWidget::showApplet):
* kwq/WebCoreBridge.h:
2003-04-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3191892 - Popup blocking prevents window.open with '_self' as target (superbitdvd.com)
* khtml/ecma/kjs_html.h:
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Don't apply popup blocking if the call
would open something in an existing frame (inlcuding the special
_self, _top and _parent frames.
2003-04-18 David Hyatt <hyatt@apple.com>
Make sure display:table is not accidentally mutated to
display:block.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-04-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3081926 - bookmarklet to count and display mailto links fails
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLElementFunction::tryCall): Implement custom toString JavaScript method
which calls the existing toString C++ custom method.
* khtml/ecma/kjs_html.h: Added AnchorToString.
* khtml/ecma/kjs_html.lut.h: Regenerated.
2003-04-18 Chris Blumenberg <cblu@apple.com>
Fixed: 3172389 - Safari doesn't parse attributes within the OBJECT tag
Reviewed by dave.
* khtml/rendering/render_frames.cpp:
(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.
2003-04-18 David Hyatt <hyatt@apple.com>
Make sure display:none is ignored and not accidentally mutated
to display:block.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-04-17 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed a bug caught by libgmalloc on Vicki's test machine
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::detach): Make sure we don't have a dangling paint device after
detaching from the KTHMLView.
(DocumentImpl::setPaintDevice): Allow a 0 parameter.
* kwq/WebCoreBridge.mm:
(nowPrinting): Handle the case of a 0 paint device.
2003-04-15 David Hyatt <hyatt@apple.com>
Missed a piece of the renaming on lowestPosition/rightmostPosition.
This was already reviewed by darin. Just missed landing one file.
Reviewed by darin
* khtml/rendering/render_box.cpp:
(RenderBox::lowestPosition):
(RenderBox::rightmostPosition):
2003-04-15 Trey Matteson <trey@apple.com>
3210061 - Forms auto-fill ignores maxlength attribute
Reviewed by Maciej.
* kwq/KWQTextField.mm:
(-[KWQTextField setStringValue:]): We now trim down incoming values
to fit the maxlength criteria. Matches the way we enforce this constraint
when maxlength is set.
2003-04-15 David Hyatt <hyatt@apple.com>
Fix 3227983 and 3229592, both the same bug involving a movable type
template:
letter-spacing: .none;
Fix is to make error-handling of exprs more generic.
Reviewed by darin
* khtml/css/parser.y:
2003-04-15 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3056913 -- please add Japanese auto-detect
* khtml/misc/decoder.cpp: (Decoder::decode): Turn on the auto-detect code if the
default encoding is one of the Japanese encodings. Also change things around so
the auto-detection process doesn't clobber the old chosen encoding if it does
not yield a result.
* kwq/KWQCharsets.h: Add a new IsJapanese encoding flag.
* kwq/KWQTextCodec.h: Add a new isJapanese() member function, used by the above.
* kwq/mac-encodings.txt: Add the IsJapanese flag to all Japanese encodings, and
add "jis7" as a synonym for ISO-2022-JP.
* kwq/make-charset-table.pl: Changed to allow flags even for unused encodings.
* kwq/KWQCharsetData.c: Regenerated.
2003-04-15 David Hyatt <hyatt@apple.com>
Fix for 3220809, overflow values other than visible should not
affect the document's height (or document scrollbars). This
fixes squidfingers.com and briefcase.yahoo.com
Also laying a bunch of groundwork for overflow:auto and scroll
by adding them as supported values now.
Fixed overflow so that overflow objects now dodge floats and
don't let them intrude into their space.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_box.cpp:
(RenderBox::containingBlockWidth):
(RenderBox::repaint):
(RenderBox::repaintRectangle):
(RenderBox::calcWidth):
(RenderBox::calcAbsoluteVertical):
(RenderBox::lowestPosition):
(RenderBox::rightmostPosition):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::repaint):
(RenderFlow::lowestPosition):
(RenderFlow::rightmostPosition):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::updateLayerPosition):
(RenderLayer::convertToLayerCoords):
(RenderLayer::scrollOffset):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::detach):
* khtml/rendering/render_object.h:
* khtml/rendering/render_style.h:
2003-04-15 Trey Matteson <trey@apple.com>
3229318 - no back entry created when searching at lonelyplanet.com
Reviewed by Darin.
* khtml/ecma/kjs_binding.cpp:
(ScriptInterpreter::wasRunByUserGesture): Treat blur/focus events as being
user gestures, since they probably were caused by something the user did.
This cues us to not lock history for navigations that are spawned by these events.
2003-04-15 David Hyatt <hyatt@apple.com>
A collection of fixes.
(1) Don't lay out positioned elements so early in
layoutInlineChildren. They need to get a layout only after
all the normal flow kids have gotten a layout (and this happens
already in layoutPositionedObjects).
(2) Fix a mistake with overflow:hidden. I was applying the
overflow-clip for positioned elements only if you had defined
clip using the clip property. This makes iht.com look better
(although it still misrenders pretty badly due to some JS error
we hit in the source).
(3) Patch RenderText's height method to give more accurate
information. This affects all the layout tests. :)
Reviewed by darin
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_layer.cpp:
(RenderLayer::constructZTree):
* khtml/rendering/render_text.cpp:
(RenderText::height):
2003-04-14 Trey Matteson <trey@apple.com>
3009051 - Find on Page stops (once) at end of page, should wrap automatically WebKit
3051546 - Find on Page doesn't work for frameset pages
3058437 - can have a selection in two frames at the same time (problem for finding in frames)
3097498 - Find Previous continues to "Find Next" until end of paragraph
3097507 - Find Next searches from previous find hit instead of current selection
And a commented out fix for:
3121828 - scrollToVisible on find cuts off the left part of the view due to needless horiz. scroll
Various missing pieces are implemented to support better finding. The fix for
3121828 is left out until 3228511 is dealt with.
Reviewed by Maciej.
* WebCore.pbproj/project.pbxproj:
* khtml/khtml_part.cpp:
(KHTMLPart::findTextBegin): Added args to allow starting a find at an arbitrary
places, such as the current selection.
(KHTMLPart::findTextNext): Implement reverse search - only the param was there.
Don't do lame scrolling selection to visible here, do better ourselves later.
* khtml/khtml_part.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::jumpToSelection): Make whole selection rect visible, and only scroll
anything if needed. ***Commented out in lieu of 3228511.
(KWQKHTMLPart::findString): Implement find starting at the right place relative to
the selection, forwards and backwards, and wraparound. This is just setup around
calling findTextNext. Also scroll the result to be visible.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge deselectAll]): Call part instead of doc so its state isn't out of sync.
(-[WebCoreBridge searchFor:direction:caseSensitive:wrap:]): Pass extra wrap arg.
* kwq/WebCoreDOMNode.mm:
(+[WebCoreDOMNode nodeWithImpl:DOM::]):
Return a nil for a null element instead of croaking.
(-[WebCoreDOMNode initWithImpl:DOM::]): Ditto.
>>>>>>> 1.1620
2003-04-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3214900 - iBench JavaScript test times get progressively slower with each test run
The fix is to make sure to always cast NodeImpl * to DocumentImpl
*. Multiple inheritance means the pointer values need not be the
same.
* khtml/ecma/kjs_binding.cpp:
(ScriptInterpreter::getDOMObjectForDocument):
(ScriptInterpreter::putDOMObjectForDocument):
(ScriptInterpreter::deleteDOMObjectsForDocument):
(ScriptInterpreter::forgetDOMObjectsForDocument):
* khtml/ecma/kjs_binding.h:
* khtml/ecma/kjs_dom.cpp:
(KJS::getDOMNode):
2003-04-11 David Hyatt <hyatt@apple.com>
Reviewed by darin
* ChangeLog:
* khtml/css/cssstyleselector.cpp:
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::parseComment):
2003-04-11 David Hyatt <hyatt@apple.com>
Refine the code that sets the display of floating and positioned
elements to block.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-04-14 Chris Blumenberg <cblu@apple.com>
Fixed build failure.
Reviewed by darin.
* khtml/rendering/render_table.cpp:
(RenderTable::cellAbove):
2003-04-12 Chris Blumenberg <cblu@apple.com>
Fixed: 3162338 - Embedding SVG with <object type="image/svg+xml"> doesn't work
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:
http://tantek.com/CSS/Examples/boxmodelhack.html
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.
Reviewed by dave.
* khtml/html/html_objectimpl.cpp:
(HTMLObjectElementImpl::rendererIsNeeded): call canRenderImageType instead of serviceType.startsWith
(HTMLObjectElementImpl::createRenderer): call canRenderImageType instead of serviceType.startsWith
(HTMLObjectElementImpl::attach): call canRenderImageType instead of serviceType.startsWith
* kwq/KWQPixmap.h:
* kwq/KWQPixmap.mm:
(canRenderImageType): new, checks if the MIME type is supported by the image factory
* kwq/WebCoreImageRendererFactory.h: added supportedMIMETypes to the WebCoreImageRendererFactory protocol
2003-04-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3165326 - javascript getSelection not implemented
* khtml/ecma/kjs_window.cpp:
(Window::get):
(WindowFunc::tryCall):
* khtml/ecma/kjs_window.h:
* khtml/ecma/kjs_window.lut.h:
2003-04-13 Trey Matteson <trey@apple.com>
3219720 - autofill mapping confused by tables, worse than MacIE (at store.apple.com)
If in scanning backwards we get to the end of a table row, we take a diversion
and scan the cell that is above the cell we started at.
Big improvement for store.apple.com.
Reviewed by Maciej
* khtml/rendering/render_table.cpp:
(RenderTable::cellAbove): New support routine to find the cell above another
* khtml/rendering/render_table.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::searchForLabelsAboveCell):
Get the cell above, scan its tree for matching text.
(KWQKHTMLPart::searchForLabelsBeforeElement):
Call above routine if we are working within a table
2003-04-12 Chris Blumenberg <cblu@apple.com>
Fixed: 3188070 - 6I32 EMBED tag with no SRC attribute doesn't load the plugin
Reviewed by dave.
* khtml/khtml_part.cpp:
(KHTMLPart::requestObject): allow URL-less parts
2003-04-11 Trey Matteson <trey@apple.com>
3148002 - printing shouldn't depend on the size of the window
The basic strategy is copied from khtmlview's print method: We reset the width
of the document to the paper width minus margins, and relayout before paginating
and printing.
Reviewed by Richard.
* khtml/rendering/render_root.cpp:
(RenderRoot::layout): Always resize our view, even when doing a layout when in
printing mode. It's necessary to change the view size because we rely on the AppKit
built-in pagination, which operates using the view geometry.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::forceLayoutForPageWidth): New method to do a layout given a
specific width.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge _setPrintingMode:]): Helper routine to take the RenderRoot in
and out of printing mode.
(-[WebCoreBridge forceLayout]): Turn printing mode on/off.
(-[WebCoreBridge forceLayoutForPageWidth:]): Turn printing mode on/off.
New glue routine to call part.
(-[WebCoreBridge drawRect:withPainter:]): Turn printing mode on/off.
(-[WebCoreBridge drawRect:]): Test paintDevice type instead of graphics context
to determine printing mode. The latter is still on when we are wrapping up the
job and want to be setting things back to normal.
(-[WebCoreBridge adjustFrames:]): Ditto.
(-[WebCoreBridge adjustPageHeightNew:top:bottom:limit:]): Turn printing mode on/off.
2003-04-11 Darin Adler <darin@apple.com>
Reviewed by Richard.
- fixed 3225472 -- www.sina.com.cn uses A3A0 for full-width space; used to work in Simplified Chinese (Mac OS)
* kwq/KWQTextCodec.mm: (KWQTextDecoder::convertUsingTEC): Work around the problem
in the Text Encoding Converter by changing all U+E5E5 to U+3000.
* kwq/KWQString.h: Added replace(QChar, QChar), since Qt has it and I need it.
* kwq/KWQString.mm:
(QString::find): Fixed a bug where we'd yield a FATAL and return -1 on deployment
if you searched for a non-ASCII character in a string that had ASCII valid and
not Unicode valid.
(QString::replace): Added replace(QChar, QChar).
=== Safari-73 ===
2003-04-10 Trey Matteson <trey@apple.com>
3224973 - Safari sometimes stores data for AUTOCOMPLETE=OFF fields and password fields
New WC support function.
Reviewed by Darin.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge elementWithName:inForm:]): Run through the form's elements
looking for a matching name.
=== Safari-72 ===
2003-04-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin and Ken.
- fixed 3223127 - REGRESSION: windows for PopCap games show scroll bars now, did not in Safari-60
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Re-add scrollbars property, but change it
to default to on even when other properties are specified (unlike
other window properties). This seems to match what Mac IE, Win IE
and Windows Mozilla do.
2003-04-10 Darin Adler <darin@apple.com>
Reviewed by Trey.
- speed up startup by not loading the hand cursor until it's used
* khtml/khtml_part.cpp: (KHTMLPart::urlCursor): Use the hand cursor.
* khtml/khtmlpart_p.h: Don't store the hand cursor in a per-part global.
2003-04-10 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3224077 -- REGRESSION: tables on MacNN forums messed up because we reject %% due to style parser
* khtml/css/tokenizer.flex: Add a + sign after the % in the percentage rule so we allow
any number of extra percent signs. This is a temporary hack.
* khtml/css/Makefile.am: Add make rules to build tokenizer.cpp so we don't have to do it by hand.
* khtml/css/maketokenizer: Added. Script used by the make rules.
* khtml/css/tokenizer.cpp: Regenerated. The only substantive change is in the state tables.
2003-04-09 David Hyatt <hyatt@apple.com>
This first fix is a refinement of the patch I produced to fix <nobr>
on cnn.com recently. It wasn't quite good enough to plug the
regression on other sites. This fix just checks the object
we're currently breaking on (which is what I meant to do) and
not the last object examined (which will always just be the
previous object you looked at).
The code currently in the tree would work if you had two objects
like this:
[Normal Whitespace] [Nowrap Whitespace]
but not if you had three:
[Normal][Nowrap][Nowrap]
Since when you looked at the third object, |last| would be the
previous nowrap object and not the normal object. The line break
properly stays at the normal object as long as nowrap objects are
encountered, so this patch basically does what the original was
intended to do.
This fixes the line break problems on 1800flowers.com, a line break
problem on the bugzilla.mozilla.org layout test, a problem
on the zdnet layout test, and 3207196 a regression on livejournal.
The second fix in this patch is a simple reversal of
containsOnlyWhitespace. The method on RenderText was
backwards! No logical changes have been made... I just inverted
all the callers, and then I patched the method.
The third fix is to make images check for == normal instead of != nowrap
in a few places, thus preventing incorrect line break points from being
set up.
Reviewed by gramps
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_text.cpp:
(RenderText::calcMinMaxWidth):
(RenderText::containsOnlyWhitespace):
2003-04-09 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3223414 -- update text encoding menu and encoding names table
Made changes as suggested by Deborah Goldsmith and Peter Edberg from the International group.
* kwq/mac-encodings.txt:
Moved all Korean character sets that are not explicitly Macintosh from MacKorean to EUC_KR.
Moved Shift JIS character sets that are not explicitly Microsoft from DOSJapanese to ShiftJIS_X0213_00.
Moved cp949 from DOSKorean to EUC_KR (DOSKorean is not implemented in Jaguar).
Moved big5 character sets that are not explicitly Microsoft from DOSChineseTrad to Big5_HKSCS_1999.
Moved all gb2312-80 character sets from GB_2312_80 to GB_18030_2000.
Moved all gbk character sets from GBK_95 to GB_18030_2000.
Moved all euc-cn character sets from EUC_CN to GB_18030_2000.
* kwq/KWQCharsetData.c: Regenerated.
2003-04-09 Darin Adler <darin@apple.com>
Reviewed by Richard.
- fixed 3223126 -- REGRESSION: exception BrowserWindow isDescendantOf:]: selector not recognized
* kwq/KWQWidget.mm: (QWidget::hasFocus): Add missing check of the class of the first
responder before calling an NSView method on it.
2003-04-09 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3222708 -- REGRESSION: repro crash trying to read news at nttdocomo
* khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Make window.open do its location
change with scheduleRedirection like all the other JavaScript calls that change location.
2003-04-08 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3221400 -- REGRESSION: password field with onfocus handler that does select causes focus/typing trouble
* kwq/KWQTextField.mm:
(-[KWQTextField selectText:]): Rearrange slightly.
(-[KWQTextField becomeFirstResponder]): Add code to make the secure field first responder
when in password mode. The old code did this indirectly through the call to setDocumentFocus,
which caused minor trouble.
(-[KWQSecureTextField selectText:]): Correct the current editor check to use a technique
that works even for the secure text field's editor (which does not get returned by currentEditor).
* kwq/KWQWidget.mm: (QWidget::hasFocus): Update the logic here so it works for the secure text
field and the secure text field's editor.
2003-04-08 David Hyatt <hyatt@apple.com>
Fix for 3166374. Making the nudie blog work. My loop for
removing floating objects when they got deleted wasn't catching
all the cases.
Reviewed by darin
* khtml/rendering/render_object.cpp:
(RenderObject::removeFromObjectLists):
2003-04-08 David Hyatt <hyatt@apple.com>
Fix for 3220979. Regression caused by changes to the CSS
parser's error handling. Fix is to narrow my original patch
to handle a specific subtype of error for properties.
Reviewed by darin
* khtml/css/parser.cpp:
* khtml/css/parser.y:
2003-04-08 Richard Williamson <rjw@apple.com>
Fixed 3221353. Added check for nil part.
Reviewed by Darin.
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::detach):
2003-04-07 Richard Williamson <rjw@apple.com>
Fix for 3220988. Cancel frame load if it's detached before
finished loading.
Reviewed by Maciej.
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::detach):
* khtml/khtml_part.h:
* kwq/KWQKHTMLPart.mm:
(KHTMLPart::frameDetached):
* kwq/WebCoreBridge.h:
2003-04-07 David Hyatt <hyatt@apple.com>
Fix for 3220395. nearestFloatBottom() mistakenly returned 0
when it ran out of floats to return.
Reviewed by gramps
* khtml/rendering/render_block.cpp:
2003-04-07 David Hyatt <hyatt@apple.com>
Fix for the scrollbar problem in 3220395. Does not yet fix
the overlap problem. lowest/rightmostPosition got broken by
the RenderFlow split. This patch makes sure that we still crawl
into inlines with overhangingContents.
Reviewed by darin
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_flow.cpp:
(RenderFlow::lowestPosition):
(RenderFlow::rightmostPosition):
* khtml/rendering/render_flow.h:
2003-04-07 David Hyatt <hyatt@apple.com>
* khtml/html/htmlparser.cpp:
(KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
This is a patch to the parser to prevent residual
style from creating illegal constructs according to the DTD.
For now, it will just bail on performing the fixup if an
illegal construct would be created.
This fixes the regression #3219944.
Reviewed by darin
2003-04-07 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3220490 -- REGRESSION: MALLORY horiz scrollbar incorrectly appears with abs positioned content
* khtml/rendering/render_block.cpp: (RenderBlock::rightmostPosition):
Fix a place where I had xPos instead of yPos.
=== Safari-71 ===
2003-04-04 Darin Adler <darin@apple.com>
Reviewed by John and Richard.
- fixed 3218725 -- REGRESSION: reproducible crash in recalcStyle on reload
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::DocumentImpl): Initialize m_paintDevice to 0.
2003-04-04 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3125850 -- VIP: "search by goo" instead of "search by google" at livepage.apple.com
We decided not to fix the general problem right now, but just hack the site.
* khtml/html/html_formimpl.cpp: (HTMLSelectElementImpl::parseAttribute):
Just ignore the style set by livepage.apple.com, so we get a too-big
"Search by Google" rather than a cut off "Search by Goo".
2003-04-04 David Hyatt <hyatt@apple.com>
Fix for the Search button cutoff on livepage.apple.com We
weren't honoring hspace/vspace on input elements.
Reviewed by darin
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::parseAttribute):
2003-04-04 David Hyatt <hyatt@apple.com>
Fix for 3218085. Remove the bogus 2cm print rule for body in the
html4.css sheet.
Reviewed by darin/trey
* khtml/css/html4.css:
2003-04-04 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3217687 -- REGRESSION: printing uses widths from screen fonts, messing up layout
To get the style machinery working for me instead of against me, I had to introduce both
FontDef and QFont to the screen/printer font dichotomy. Just following that through took
care of the bugs we were seeing.
* khtml/rendering/font.h: Add a usePrinterFont field to FontDef (in APPLE_CHANGES).
* khtml/rendering/font.cpp: (Font::update): Set the new "printer font" field on the QFont
(in APPLE_CHANGES).
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyle): Set usePrinterFont field on the
document's fontDef (in APPLE_CHANGES).
* kwq/KWQFont.h: Add isPrinterFont, setter, getter.
* kwq/KWQFont.mm:
(QFont::QFont): Default isPrinterFont to false, copy when copying.
(QFont::operator=): Copy isPrinterFont.
(QFont::setPrinterFont): Added.
(QFont::operator==): Compare isPrinterFont.
* kwq/KWQFontMetrics.mm: Remove the _rendererUsesPrinterFont field and associated code.
This was only needed when the same QFont could be both printer and screen font, but now
the QFont itself is different.
* kwq/KWQPainter.mm: (QPainter::_updateRenderer): Remove textRendererUsesPrinterFont field
and associated code, for same reason as above.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge reapplyStylesForDeviceType:]): Set the document's
paint device.
* kwq/WebCoreTextRendererFactory.h: Remove global setUsingPrinterFonts: and
usingPrinterFonts methods. We now handle this at the document level. Add a usingPrinterFont:
parameter to rendererWithFont:, which is now how KHTML tells the text rendering code which
kind to use.
* kwq/WebCoreTextRendererFactory.m: Removed KWQTextRendererFactoryUsingPrinterFonts.
(-[WebCoreTextRendererFactory rendererWithFont:usingPrinterFont:]): Added parameter.
- other changes
* kwq/KWQPaintDevice.h: Store the device type instead of using a virtual function.
* kwq/KWQPrinter.h: Set device type in constructor instead of overriding devType function.
* kwq/KWQPixmap.h: Changed destructor back to non-virtual (and entire class back to
non-polymorphic), now that QPaintDevice doesn't use virtual functions any more.
* kwq/KWQPaintDeviceMetrics.h: Remove unused width() and height().
* kwq/KWQPaintDeviceMetrics.mm: Ditto.
* WebCore.pbproj/project.pbxproj: Removed KWQTextRendererFactory.h.
* kwq/KWQTextRendererFactory.h: Removed.
2003-04-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3031544 - can't login on secure paytrust page due to lack of onchange handler
* kwq/KWQTextField.mm:
(-[KWQTextField control:textShouldBeginEditing:]): Send FocusIn event
to event filter here.
(-[KWQTextField control:textShouldEndEditing:]): Send FocusOut event to
event filter here.
(-[KWQTextField fieldEditorDidBecomeFirstResponder]): Removed.
(-[KWQTextField fieldEditorDidResignFirstResponder]): Removed.
* kwq/WebCoreFirstResponderChanges.h: Removed first responder methods.
2003-04-03 Trey Matteson <trey@apple.com>
3067928 - printing should not break lines in half
3217607 - when printing we should not draw the selection
We leverage the existing knowledge that a couple render object classes had
for adjusting pagination. Wrote 3217705 saying we should add similar
smarts to a few more places.
Reviewed by Darin.
* ForwardingHeaders/qprinter.h: Added.
* khtml/rendering/render_list.cpp:
(RenderListMarker::paintObject): Call our special setBestTruncatedAt instead
of khtml's setTruncatedAt.
* khtml/rendering/render_root.cpp:
(RenderRoot::setBestTruncatedAt): Accumulate the best pagination boundary.
* khtml/rendering/render_root.h:
* khtml/rendering/render_text.cpp:
(RenderText::paintObject): Call our special setBestTruncatedAt instead
of khtml's setTruncatedAt.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::paint): Don't draw the debugging red background when printing.
(KWQKHTMLPart::adjustPageHeight): The meat of the change. Make another
painting pass (with actual painting disabled) to get the pagination boundary
set as a side effect. Return result up to AppKit.
* kwq/KWQPaintDevice.h: devType() made virtual
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::QPainter): New constructor for making a printing painter.
(QPainter::device): Return either the Screen or Printer device.
* kwq/KWQPixmap.h: Destructor needed to become virtual.
* kwq/KWQPrinter.h: Implement devType().
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge drawRect:]): Setup printer device in our painter if we're
not drawing to the screen.
(-[WebCoreBridge adjustFrames:]): Ditto.
(-[WebCoreBridge adjustPageHeightNew:top:bottom:limit:]): Forward to part.
2003-04-03 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3194468 -- ARCH: text zoom should scale line-height as well as font-size
* khtml/css/css_valueimpl.h:
* khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::computeLength): Add a new version that does
a multiply before rounding. Also simplify the rounding code.
* khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): For line height, multiply by the
text zoom factor in cases where the height isn't already relative to the font size.
- other changes
* khtml/rendering/render_replaced.cpp: (RenderWidget::paintObject): Disable code to work around
X11 widget size limit. It can only do harm for us.
2003-04-03 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed bug 3216832 -- REGRESSION: scroll bar doesn't appear soon enough when shrinking excite.com horizontally
* khtml/rendering/table_layout.cpp: (AutoTableLayout::calcEffectiveWidth):
Fixed mistake where using the wrong variable led to the colspan distribution
loop terminating early, and not giving any additional width to the second column.
- fixed some navigator properties as discussed in the meeting yesterday (with Don, Dave, Mike Malone)
* khtml/ecma/kjs_navigator.cpp: (Navigator::getValueProperty):
Use the date 20030107 instead of 20021225 because people think it's less arbitrary.
Use "Apple Computer, Inc." as the vendor string.
2003-04-02 David Hyatt <hyatt@apple.com>
Fix for 3216650. Needed an additional check when the disabled
attribute is changed on <link> elements for stylesheets to keep
the pending sheet count in sync.
Reviewed by gramps
* khtml/html/html_headimpl.cpp:
(HTMLLinkElementImpl::parseAttribute):
2003-04-02 David Hyatt <hyatt@apple.com>
Fix for 3212011. Avoid applying a fixup to the minwidth
of overflow:hidden table cells, since we don't really have
an accurate width to compare against.
I filed followup bug 3216709 to deal with the fact that this
fixup has been disabled.
Reviewed by john
* khtml/rendering/render_block.cpp:
2003-04-02 David Hyatt <hyatt@apple.com>
Do not assume all columns have a minwidth/maxwidth of 1px.
Instead give them a min/maxwidth of 0px, and only inflate to
1px if a cell originates in the column.
This fixes the error on travelocity.com, where a large colspan
leads to the implicit creation of a new column that contains no
originating cells. That new column should be 0px wide, not
1px.
The bug # is 3170592.
Reviewed by kocienda
* khtml/rendering/table_layout.cpp:
(AutoTableLayout::recalcColumn):
* khtml/rendering/table_layout.h:
2003-04-01 David Hyatt <hyatt@apple.com>
Fix for excite.com. There are many bugs being fixed that all
contributed to the wideness of the table.
The bug # is 3200534
Reviewed by darin
* khtml/rendering/table_layout.cpp:
(shouldScaleColumns):
2003-04-02 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3213854 -- REGRESSION: can't click on a text field to select it
- fixed 3201477 -- friends links don't work on hyatt's blog
* khtml/rendering/render_object.cpp: (RenderObject::nodeAtPoint): Skip floating objects when
hit testing children.
* khtml/rendering/render_inline.cpp: (RenderInline::nodeAtPoint): Ditto.
2003-04-01 Trey Matteson <trey@apple.com>
3119711 - redirects to anchors leave window half-loaded (was SCClib.org is half loaded, half rendered)
The problem happened when an anchor nav was the last half of a client redirect.
We would never stop the redirect timer, and thus never post a clientRedirectCanceled
message up through the stack. This left the app thinking that it was in redirect
mode even when the whole navigation had finished, which makes it not clear the
progress bar.
Reviewed by Darin.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::scrollToAnchor): Stop the redirect timer.
2003-04-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed 3182103 - REGRESSION: one developer.apple.com page is so slow, it almost seems like a hang
* khtml/rendering/bidi.cpp:
(RenderBlock::findNextLineBreak): Avoid returning bad iterators
that point past the end of an object instead of to the start ot
the next one.
2003-04-01 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3123709 -- redirect isn't followed at Apple's Dental Benefits provider
* khtml/dom/dom2_events.h: Added boolean "isWindowEvent" parameter.
* khtml/dom/dom2_events.cpp: (EventListener::handleEvent): Ignore boolean "isWindowEvent" parameter.
* khtml/ecma/kjs_events.h: Added boolean "isWindowEvent" parameter.
* khtml/ecma/kjs_events.cpp: (JSEventListener::handleEvent): Look at new "isWindowEvent" parameter,
and send the event to the window if it's true, rather than the current node, document, and form.
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::defaultEventHandler): Pass true for "isWindowEvent".
* khtml/xml/dom_nodeimpl.cpp: (NodeImpl::handleLocalEvents): Pass false for "isWindowEvent".
2003-04-01 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3144287 -- CSS with media=print not used when printing
* kwq/KWQKHTMLPart.h: Added a setMediaType function, so the bridge can access
the KHTMLView::setMediaType function, which is private (KWQKHTMLPart is a friend).
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::setMediaType): Call setMediaType on the
KHTMLView.
* kwq/WebCoreBridge.h: Added a device type parameter to reapplyStyles.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge reapplyStylesForDeviceType:]):
Call setMediaType with the appropriate media type for the passed in device type.
2003-04-01 David Hyatt <hyatt@apple.com>
Table code fixes. Working to try to fix excite.com.
Reviewed by darin
* khtml/rendering/table_layout.cpp:
(shouldScaleColumns):
(AutoTableLayout::calcMinMaxWidth):
2003-04-01 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3213900 -- REGRESSION: crash in CSS parser at http://radioalice.com/
* khtml/css/cssparser.cpp: (CSSParser::parseColor): Add a missing check for nil.
2003-04-01 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3202542 -- REGRESSION: preinitialized password inputs do not show dots (affects mac.com)
* kwq/KWQTextField.mm: (-[KWQTextField setPasswordMode:]): Remove code that sets the string
value to "". This is not needed, and because a text changed signal is sent out it makes the
caller think the text was deleted intentionally. Added code to move the string from the current
field in use to the other field, so changing the password mode does not make the string go away.
The old code was fragile and depended on the order of operations.
2003-03-31 Darin Adler <darin@apple.com>
* English.lproj/InfoPlist.strings: Changed "1.0 Beta" to "1.0 Beta 2".
* WebCore.pbproj/project.pbxproj: Changed "1.0 Beta" to "1.0 Beta 2".
2003-03-31 David Hyatt <hyatt@apple.com>
Fixes for 3211862 and 3212750, add error-handling cases for
property values to the CSS parser so the whole sheet doesn't
get rejected.
Reviewed by darin
* khtml/css/parser.cpp:
* khtml/css/parser.y:
2003-03-31 Darin Adler <darin@apple.com>
Reviewed by Chris.
- fixed 3213093 -- REGRESSION: crash accessing menu items right after launch with about:blank as homepage
* khtml/khtmlview.cpp: (KHTMLView::viewportMouseMoveEvent):
Another place needed a check for null.
2003-03-31 David Hyatt <hyatt@apple.com>
Fix for 3211849. I accidentally removed a BORDER_COLOR case
from the switch when I removed the transparency check for
the shorthand. The case originally fell through to the case
below it, so a straight removal was wrong. I needed to add
it to the following set of case labels.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-03-31 David Hyatt <hyatt@apple.com>
First-letter can be floated. Make sure we mutate the display
to BLOCK so that we don't make an inline when we're floating.
Fixes bug 3186004.
Reviewed by darin
* khtml/rendering/render_block.cpp:
2003-03-31 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3213093 -- accessing menu items immediately after launch causes crash when about:blank is homepage
* khtml/khtmlview.cpp: (isSubmitImage): Add check for node of 0.
- fixed 3211461 -- crash in KWQListIteratorImpl tabbing through w3c test page
* kwq/KWQKHTMLPart.h: Added childFrameForPart function, better than KHTMLPart::frame because it works
for HTML frames inside objects as well as plain old HTML frames.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::childFrameForPart): Like KHTMLPart::frame, but looks through m_objects too.
(KWQKHTMLPart::nextKeyViewInFrameHierarchy): Use childFrameForPart instead of frame function.
2003-03-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3206524 - incyte.com "load properties" function does not work
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::close): Make sure to clear the tokenizer before firing
the onLoad handler, otherwise document.write from inside an onLoad handler
will fail.
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::close): Call closeInternal.
(DocumentImpl::closeInternal): New version of close that allows
bypassing the tokenizer null check, in case we already deleted the
tokenizer/
2003-03-30 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3169064 - can't search at lonelyplanet.com; onSubmit handler fails due to problem addressing radio button
* khtml/ecma/kjs_dom.cpp:
(DOMNamedNodesCollection::tryGet): Allow lookup by id as well as
by integer index.
2003-03-29 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3138427 - new window opened by javascript is too small for popcap.com game
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Be a bit more tolerant of misformatted attribute strings.
2003-03-29 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3180786 - Can't log in to the LL Bean Web site
The problem on this site was misnested tags, leading to two FORM
elements that were nested. Both their onSubmit handlers fired, and
the outer one returned false. The fix was to avoid bubbling submit
events, since this can never be useful in a valid document and
because that is what other browsers seem to do, and what Win IE
documents.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::prepareSubmit): Don't allow the submit event to bubble.
2003-03-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- improved on Darin's fix for 3211289 - REGRESSION: nil-deref in bridgeForWidget
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::bridgeForWidget): Special-case KHTMLView - this is
the only kind of widget in the program that's not a form control
(so nodeForWidget would return nil for it).
2003-03-28 David Hyatt <hyatt@apple.com>
Fix a regression caused by my addition of nearestFloatBottom
to the code. I needed to make that a loop rather than just call
it once, since the nearestFloatBottom could be a bad position
for the next line.
This fixes the overlapping text problem at CNN: 3186593.
Reviewed by john
* khtml/rendering/bidi.cpp:
2003-03-28 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3191163 -- hang in QPtrListIterator at www.phiffer.com
- fixed 3183520 -- XML page has no vertical scrollbar
The hang was due to an exponential algorithm in lowest/rightmostPosition.
Fixed by making some simplifications to these functions, used only to determine the size
of the entire web page. While doing that I cleared some things up that made the XML
scroll bar problem go away too.
Note that www.phiffer.com still does not render right.
* khtml/rendering/render_block.cpp:
(RenderBlock::lowestPosition): Since this is always called on the whole tree, don't worry
about which parent deals with which child. Just make sure that every object is visited
exactly once.
(RenderBlock::rightmostPosition): Ditto.
* khtml/rendering/render_html.cpp: (RenderHtml::layout): Use the result from calling
lowestPosition on the root, since some floating/positioned objects hang off there, rather
than here. This seems consistent with the long term approach of doing more work in the root
and less in RenderHtml, since XML documents don't have a RenderHtml.
* khtml/rendering/render_root.cpp:
(RenderRoot::docHeight): Call lowestPosition() on self rather than on children. Now that
I understand the method, it's clear this is the correct way to do things.
(RenderRoot::docWidth): Ditto, but rightmostPosition().
- fixed 3211289 -- REGRESSION: nil-deref in bridgeForWidget
Maciej may have some ideas about how to fix this even better, but this
is better than just rolling his change out.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::nextKeyViewForWidget): Added an assertion.
(KWQKHTMLPart::bridgeForWidget): Handle case where node is 0 by returning 0.
(KWQKHTMLPart::partForNode): Added an assertion.
(KWQKHTMLPart::nodeForWidget): Handle case where eventFilterObject is 0 by returning 0.
(KWQKHTMLPart::setDocumentFocus): Quietly do nothing if the node is 0.
(KWQKHTMLPart::clearDocumentFocus): Quietly do nothing if the node is 0.
2003-03-27 David Hyatt <hyatt@apple.com>
A collection of fixes for tables.
(1) Fixed table layout should only be used if an explicit width
is specified on a table.
(2) width="0" and height="0" should be ignored on table cells!
(3) Fixed table layout wasn't spreading extra space over
columns.
Reviewed by mjs
* khtml/html/html_tableimpl.cpp:
(HTMLTableCellElementImpl::parseAttribute):
* khtml/rendering/render_table.cpp:
(RenderTable::setStyle):
* khtml/rendering/table_layout.cpp:
(FixedTableLayout::layout):
2003-03-27 David Hyatt <hyatt@apple.com>
Fix for the top of directory.apple.com. Only use the fixed
width on the cell (with nowrap set) if it is *larger* than
our current minwidth.
Reviewed by darin
* khtml/rendering/render_table.cpp:
(RenderTableCell::calcMinMaxWidth):
2003-03-27 David Hyatt <hyatt@apple.com>
Fix for 3166374. When a float is removed, crawl up and down the
tree looking for blocks that contain the float and dirty them all.
Reviewed by darin
* ChangeLog:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_object.cpp:
(RenderObject::markAllDescendantsWithFloatsForLayout):
(RenderObject::removeFromObjectLists):
* khtml/rendering/render_object.h:
2003-03-27 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3192344 - nil-deref in KWin::info scrolling amazon while other shopping tabs load
- fixed 3098365 - Default window size changes as a result of popup windows
- fixed 3189291 - javascript window.close() closes window, not just originating tab
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::scheduleClose): Close via the bridge, not the window directly.
(KWQKHTMLPart::bridgeForWidget): Take const QWidget * instead of QWidget *.
(KWQKHTMLPart::nodeForWidget): Likewise.
(KWQKHTMLPart::khtmlMousePressEvent): Deal with responder issues via bridge,
not window directly.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Likewise.
(KWQKHTMLPart::mouseDown): Likewise.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Set resizability via bridge,
not window directly.
* kwq/KWQTextArea.mm:
(-[KWQTextArea becomeFirstResponder]): Deal with bridge for first responder
issues, not window directly.
(-[KWQTextArea drawRect:]): Likewise.
(-[KWQTextAreaTextView insertTab:]): Likewise.
(-[KWQTextAreaTextView insertBacktab:]): Likewise.
(-[KWQTextAreaTextView shouldDrawInsertionPoint]): Likewise.
(-[KWQTextAreaTextView selectedTextAttributes]): Likewise.
* kwq/KWQWidget.mm:
(QWidget::setActiveWindow): Focus window via bridge.
(QWidget::hasFocus): Handle first responder issues via bridge.
(QWidget::setFocus): Likewise.
(QWidget::isVisible): Get window from bridge.
(QWidget::mapFromGlobal): Get window from bridge.
(QWidget::disableFlushDrawing): Add comment noting why it's OK
to get the window from the view instead of from the bridge here.
(QWidget::enableFlushDrawing): Likewise.
* kwq/KWQWindowWidget.mm:
(KWQWindowWidget::frameGeometry): Work through bridge, not window
directly.
(KWQWindowWidget::mapToGlobal): Likewise.
(KWQWindowWidget::setFrameGeometry): Likewise.
* kwq/WebCoreBridge.h:
2003-03-27 David Hyatt <hyatt@apple.com>
This is just a long-standing screwup where I didn't port an old
table fix I made to Lars' new table code properly. The original
fix had this check in it.
The bug is 3171963 (cvs.com).
Reviewed by darin
* khtml/rendering/render_table.cpp:
(RenderTableSection::layoutRows):
2003-03-27 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3156509 -- Safari fills src="" frame with current contents of frameset instead of leaving it empty
The trick here is to always use "about:blank" when the frame URL is empty string.
If we pass the empty string elsewhere, it's going to get passed to completeURL and
turned into a reference to the current document, and we have to avoid doing that
ourselves explicitly too.
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::HTMLFrameElementImpl): Let the URL default to null rather
than "about:blank". We do want to treat the frame as "about:blank", but that's not
something people should see when inspecting the frame via the DOM.
(HTMLFrameElementImpl::isURLAllowed): Allow empty URLs explicitly, so we don't
call completeURL on them.
(HTMLFrameElementImpl::updateForNewURL): Map empty URLs to "about:blank" at this level.
(HTMLFrameElementImpl::attach): Do the same thing here. At some point we can share more
code between these two.
(HTMLFrameElementImpl::setLocation): Change this to call updateForNewURL. Not only does
this make us handle the empty URL case properly, it also gets the benefit of other things
we do in updateForNewURL, like handling the "isURLAllowed" rule, and properly handling
the case where we already have a suitable frame.
- other changes
* kwq/KWQKHTMLView.mm: Improved a comment.
=== Safari-69 ===
2003-03-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Chris.
- fix unitialized access.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart):
2003-03-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
Made progress towards better handling of window operations.
* khtml/ecma/kjs_window.cpp:
(Window::get): Replace a few part->widget() calls with part->view() -- just
as good for the real khtml, but easier to adapt to with KWQ.
(WindowFunc::tryCall): Likewise.
* khtml/khtmlview.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::~KWQKHTMLPart): Delete the window widget.
(KWQKHTMLPart::topLevelWidget): Return the window widget.
(KWQKHTMLPart::setBridge): Make a new window widget passing it the bridge.
* kwq/KWQKHTMLView.mm:
(KHTMLView::topLevelWidget): Moved here from KHTMLView; get the top level
widget from the part.
(KHTMLView::mapToGlobal): Moved here from KHTMLView; add a needed cast.
* kwq/KWQWidget.h:
* kwq/KWQWidget.mm: Remove all top level widget considerations.
* kwq/KWQWindowWidget.h:
* kwq/KWQWindowWidget.mm:
(KWQWindowWidget::KWQWindowWidget): Changed to work based on bridge, not window.
(KWQWindowWidget::~KWQWindowWidget): Ditto.
(KWQWindowWidget::frameGeometry): Ditto.
(KWQWindowWidget::mapToGlobal): Ditto.
(KWQWindowWidget::mapFromGlobal): Ditto.
(KWQWindowWidget::setFrameGeometry): Ditto.
Also:
* kwq/KWQKHTMLPart.cpp: Removed stuff that did not belong here.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::selectionStartOffset): Moved here from KWQKHTMLPart.cpp
(KWQKHTMLPart::selectionEndOffset): Likewise.
(KWQKHTMLPart::selectionStart): Likewise.
(KWQKHTMLPart::selectionEnd): Likewise.
(KWQKHTMLPart::selectionRect): Likesie.
2003-03-26 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed a storage leak when running cvs-base
* khtml/rendering/render_list.h: Added _markerInstalledInParent.
* khtml/rendering/render_list.cpp:
(RenderListItem::setStyle): Set _markerInstalledInParent to false when
creating a new marker.
(RenderListItem::detach): Detach the marker if it's not not installed in the
parent yet.
(RenderListItem::updateMarkerLocation): Set _markerInstalledInParent to true
when installing the marker in a parent.
2003-03-26 David Hyatt <hyatt@apple.com>
Make <label> use tag list 1. Fixes 3206063. Residual style
changes called this out.
Reviewed by darin
* khtml/html/dtd.cpp:
(DOM::checkChild):
2003-03-26 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3208468 -- REGRESSION: checkbox immediately unchecks the first time you check it
The stateChanged signal must be delivered before the mouse up event is handled.
* kwq/KWQButton.mm:
(-[KWQButton initWithQButton:]): Use [self init] instead of [super init]; no real difference,
just makes more logical sense.
(-[KWQButton action:]): Don't send the mouse up event here.
(-[KWQButton sendConsumedMouseUpIfNeeded]): Added. New method that sends the consumed mouse
up event.
(-[KWQButton mouseDown:]): Use a simplified scheme that uses only a single boolean to control
sending the consumed mouse up event. Call sendConsumedMouseUpIfNeeded to do the deed.
(QButton::clicked): Added comment to explain why it's important to send the consumed mouse
up event here. Added a call to the new sendConsumedMouseUpIfNeeded method, replacing the
code that was formerly in -[KWQButton action:].
2003-03-25 David Hyatt <hyatt@apple.com>
Fix font-family parsing to match the spec (and other browsers).
This fixes bugs 3197584 and 3207760.
Also fix pseudos to be lower-cased. Fixes 3208303.
Reviewed by darin
* khtml/css/css_valueimpl.h:
* khtml/css/cssparser.cpp:
(CSSParser::parseFontFamily):
2003-03-24 Trey Matteson <trey@apple.com>
Pass -seg_addr_table_filename <FILENAME> to ld. This makes our frameworks in
SYMROOT actually work for symbol resolution because they will have the correct
prebinding address. It also fixes obscure B&I problems with prebinding
reported by Matt Reda.
Note the reason all this is tricky for our projects is that we have a different
install location for Jaguar and Panther. The purpose of this arg is to declare
at link time our eventual location, which allows the prebinding address to be
found in /AppleInternal/Developer/seg_addr_table. We use a funky back-tick
expression within OTHER_LDFLAGS to get a conditional value depending on the
build train we are in.
This can all go away once we only build on Panther and don't embed the
frameworks inside the Safari.app wrapper.
In addition I fixed the OTHER_LDFLAGS settings in our build styles to be
additive instead of overriding, so we have the args we used for B&I in force
when building outside of B&I.
Reviewed by Maciej.
* WebCore.pbproj/project.pbxproj:
2003-03-24 David Hyatt <hyatt@apple.com>
Clean up isInlineFlow. Add a couple of new methods that I'll
be converting code over to use (carefully) piece by piece in
future patches.
Reviewed by gramps
* khtml/rendering/render_block.h:
* khtml/rendering/render_flow.h:
* khtml/rendering/render_inline.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
* khtml/rendering/render_object.h:
2003-03-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by Richard.
- fixed 3083339 - significant top and side margin appended to new windows
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Account for distinction between
frame and content rect.
* kwq/KWQStyle.h: Return 0 for the appropriate style to avoid
adding extra padding when making a new window from JavaScript.
* kwq/WebCoreBridge.h: Prototype new methods.
2003-03-24 David Hyatt <hyatt@apple.com>
Fix for crash on www.lnt.com. 3199929 is the bug number.
Blocks must have all their kids as inlines or all theirs kids
as blocks. Floats and positioned elements are special and
disregarded when this check occurs.
If a float or positioned element suddenly becomes a normal flow
element again, then the parent block might have to make its kids
all be non-inline or it might have to wrap a normal flow inline
with an anonymous block.
This patch fixed RenderObject's setStyle method to check for
this situation and to make the parent block fix itself up
appropriately.
Reviewed by darin
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
2003-03-24 David Hyatt <hyatt@apple.com>
ignore the float property on first-letter styles.
The bug # is 3186044.
Reviewed by darin
* khtml/css/parser.cpp:
* khtml/rendering/render_block.cpp:
2003-03-24 David Hyatt <hyatt@apple.com>
Add error-handling case to deal with a common CSS malformation:
clip: rect( )
The bug is 3206171.
Reviewed by darin
* khtml/css/parser.cpp:
* khtml/css/parser.y:
2003-03-22 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3203869 -- Monaco 9 looks different in Safari than in TextEdit (uses outline instead of bitmap)
* kwq/KWQFontMetrics.mm: (QFontMetricsPrivate::getRenderer): Get a new renderer
if the one we have is wrong printer-vs-screen-wise. For speed, use a global
variable rather than methods.
* kwq/KWQPainter.mm: (QPainter::_updateRenderer): Get a new renderer if the
one we have is wrong printer-vs-screen-wise. For speed, use a global variable
rather than methods.
* kwq/KWQTextRendererFactory.h: Added. Exposes a global variable that tells whether we are
in global "using printer font" mode.
* kwq/WebCoreTextRendererFactory.h: Added setUsingPrinterFonts: and usingPrinterFonts methods.
* kwq/WebCoreTextRendererFactory.m:
(-[WebCoreTextRendererFactory setUsingPrinterFonts:]): Added. Sets global.
(-[WebCoreTextRendererFactory usingPrinterFonts]): Added. Returns value of global.
* WebCore.pbproj/project.pbxproj: Added KWQTextRendererFactory.h.
2003-03-22 David Hyatt <hyatt@apple.com>
Fix the top of the gamespot.com page on the PLT. The
clear status for <br> should be ignored if/when we decide
to ignore the <br> because the previous line didn't break
cleanly.
Reviewed by gramps
* khtml/rendering/bidi.cpp:
2003-03-22 David Hyatt <hyatt@apple.com>
Loosen up the DTD for <dl>, <dt>, and <dd> so that they can
occur anywhere in a document and be independent of one
another.
Reviewed by darin/gramps
* khtml/html/dtd.cpp:
(DOM::checkChild):
2003-03-22 David Hyatt <hyatt@apple.com>
Bottom border/padding was incorrectly being used in float
computations. The fix is trivial... positioning of floats
occurs before you add in the bottom border/padding rather
than after.
Also implementing support for transparent borders and adding
code that understands how to draw more complex polys when
individual sides are transparent. This code existed for left
and right borders, but not for top and bottom borders.
These two fixes make the tantek demo found at:
http://www.tantek.com/map.html
work properly for the first time in Safari.
Reviewed by darin
* ChangeLog:
* khtml/css/cssparser.cpp:
(CSSParser::parseValue):
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_object.cpp:
(RenderObject::paintBorder):
* khtml/rendering/render_style.h:
2003-03-21 David Hyatt <hyatt@apple.com>
Fixes for all 4 macromedia rendering problems. They were all
related to buggy float handling.
The bugs are 3194998, 3195014, 3915155, 3204114.
This patch splits floats and positioned elements into two lists
instead of 1, and it also adds better logic for clearing out
floats when blocks move vertically.
Reviewed by darin
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_container.cpp:
(RenderContainer::detach):
* khtml/rendering/render_flow.cpp:
(RenderFlow::addChildWithContinuation):
* khtml/rendering/render_inline.cpp:
(RenderInline::addChildToFlow):
(RenderInline::nodeAtPoint):
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
(RenderObject::removeFromObjectLists):
(RenderObject::nodeAtPoint):
* khtml/rendering/render_object.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::layout):
* khtml/rendering/render_table.cpp:
(RenderTable::layout):
2003-03-21 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3203212 -- nil-deref in khtml::CachedImage::isErrorImage at turbotax.com
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::removeImage): Remove all occurrences
of the image from the list. We don't try to prevent multiple occurrences from getting
in there. Also use removeRef instead of remove, for speed.
2003-03-21 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3204660 -- EUC decoding not used for japanese yahoo page
* khtml/misc/decoder.cpp: (Decoder::decode):
Do the search for charset= in a case-insensitive way. It's possible that other
browsers are case-insensitive, but also possible that it's just Japanese
auto-detect that papers over this problem there.
- other changes
* kwq/KWQString.mm: (QString::hash): Get rid of unnecessary code to avoid hashes of 0.
This is useful in the place in JavaScriptCore where we copied this from, but
it is not helpful here (slightly ugly and does slow things down a smidgen).
* kwq/WebCoreTextRendererFactory.m: Remove unused method.
2003-03-20 David Hyatt <hyatt@apple.com>
Fix the color handling of link= attributes on <body> elements
to pass in the quirks mode so that lax parsing can take place.
Reviewed by rjw and john
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
2003-03-20 Richard Williamson <rjw@apple.com>
Use "Item" consistently in the WebHistory and WebBackForwardList.
Change createSharedHistoryWithFile: to setSharedHistory:
Make the various page cache methods per WebBackForwardList instead of global.
Reviewed by gramps.
* kwq/KWQKHistoryProvider.mm:
* kwq/WebCoreHistory.h:
2003-03-20 David Hyatt <hyatt@apple.com>
Always do residual style fixups in all three Safari rendering
modes.
Reviewed by darin
* khtml/html/htmlparser.cpp:
(KHTMLParser::popBlock):
=== Safari-68 ===
2003-03-19 David Hyatt <hyatt@apple.com>
Adding a few more tags to the list of ones to check for
residual style.
Reviewed by gramps
* khtml/html/htmlparser.cpp:
(KHTMLParser::isResidualStyleTag):
(KHTMLParser::isAffectedByResidualStyle):
2003-03-19 David Hyatt <hyatt@apple.com>
Fix continuations so that they are smarter about reusing
anonymous blocks. Avoids deep nesting when it isn't
necessary.
A complete implementation of the residual style fixes. It
seems to fix all current outstanding bugs.
One of the bugs in the residual style list was caused by
font-weight not being reset to tables and is actually its
own problem. I fixed that by moving the quirks resets for
table elements into the quirks stylesheet (which should be
a speed boost).
<b><p>Foo</b> Goo</p>
Also fixed the huge XML failure issue that made us fail hundreds
of test cases. Attachment of text nodes was being done way too
early, before the text of the node had been determined. By moving
the attachment from enterText to exitText, the problem is solved.
Reviewed by darin (res. style fix 1) and gramps (rest of res. style fix and XML fix)
* khtml/css/quirks.css:
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::attach):
* khtml/html/htmlparser.cpp:
(KHTMLParser::isResidualStyleTag):
(KHTMLParser::isAffectedByResidualStyle):
(KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
(KHTMLParser::reopenResidualStyleTags):
(KHTMLParser::popBlock):
(KHTMLParser::popOneBlock):
* khtml/html/htmlparser.h:
* khtml/rendering/render_inline.cpp:
(RenderInline::splitFlow):
* khtml/xml/xml_tokenizer.cpp:
(XMLHandler::enterText):
(XMLHandler::exitText):
2003-03-18 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3197684 -- <textarea wrap="hard"> behaves incorrectly (bugzilla)
By doing the line breaking inside the KWQ class for textarea we can both remove
the broken lineOfCharAtIndex: method and avoid the n-squared algorithm KHTML uses to
insert hard line breaks.
* khtml/rendering/render_form.cpp: (RenderTextArea::text):
Call textWithHardLineBreaks on widget instead of trying to break lines here.
* kwq/KWQTextEdit.h: Added textWithHardLineBreaks member function. Made text member function
const. Got rid of text(int), paragraphs, paragraphLength, and lineOfChar member functions.
* kwq/KWQTextEdit.mm:
(QTextEdit::text): Made this const, and move code that transforms CRLF and CR into LF
inside KWQTextArea.
(QTextEdit::textWithHardLineBreaks): Added. Calls new textWithHardLineBreaks method.
* kwq/KWQTextArea.h: Added textWithHardLineBreaks method. Removed numLines, textForLine:,
paragrahs, paragraphLength:, textForParagraph:, and lineOfCharAtIndex: methods.
* kwq/KWQTextArea.mm:
(-[KWQTextArea initWithQTextEdit:]): Call [self init] for clarity instead of [super init].
In both cases, we end up calling [self initWithFrame:].
(-[KWQTextArea text]): Added logic for transforming CRLF and CR into LF here instead of at
the KWQTextEdit level.
(-[KWQTextArea textWithHardLineBreaks]): Added. This method uses the layout manager to extract
the characters for one line at a time, and put line breaks in between.
2003-03-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3146407 - bring the window with the targeted frame to the front
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): If we use an existing frame,
focus it.
* kwq/WebCoreBridge.h: Prototype focusWindow method.
2003-03-17 Trey Matteson <trey@apple.com>
Support for password saving in forms. Added elementIsPassword:,
nuked deadwood formIsLoginForm:.
Reviewed by Maciej.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::submit): Pass forms data for login forms and
password fields to bridge. This case was skipped for security in
khtml's autocomplete, but we need this data to save passwords, and
we enforce policy at a higher level.
* khtml/html/html_formimpl.h:
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
Nuked formIsLoginForm:.
(-[WebCoreBridge elementIsPassword:]): New utility.
2003-03-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3119663 - document.lastModified returns the wrong date format
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
Instead of using NSDate's default date format, use the format that
IE and Gecko use.
2003-03-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Fix build, use size instead of length.
2003-03-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3080337 - default values seem to be "no" when third param of window.open is an empty string
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Treat empty string the same as missing for
third argument - leave all chrome on. Also remove support for
scrollbars= property
2003-03-18 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3164522 -- text encoding conversion is done a chunk at a time with no state; won't work in some cases
- fixed 3164557 -- pages served with encoding UTF-16LE but no BOM character won't be decoded correctly
- fixed 3164569 -- pages without BOM that have a server-specified encoding of utf-16 will fail to decode
- fixed 3165002 -- can't open link with tilde (~) in page with Japanese encoding
- fixed 3181297 -- can't open link with backslash (\) in page with Japanese encoding (download at netscape.com)
- fixed 3182977 -- "unicode" encoding handled as UTF-16 rather than UTF-8 at www.delcom-eng.com
* khtml/misc/decoder.h: Add an optional "8-bit-only" parameter to the
setEncoding method.
* khtml/misc/decoder.cpp:
(Decoder::setEncoding): Add an "8-bit-only" parameter. Use the new
codeForNameEightBitOnly method when that parameter is true. Use the new
usesVisualOrdering constant rather than all the hardcoded logic here to
tell logical from visual Hebrew encodings.
(Decoder::decode): Pass true for "8-bit-only" when the encoding came out
of an HTML header, since we are already parsing the file by this point so
it makes no sense to use a non-8-bit encoding.
(Decoder::flush): Pass true for the "flush" parameter when calling the decoder.
* kwq/KWQCharsets.h: Add a new KWQEncodingFlags enum, and return a parameter of
that type (optionally) from KWQCFStringEncodingFromIANACharsetName.
* kwq/KWQCharsets.mm:
(buildDictionaries): Make the dictionaries lead to table entries so we can get
both the flags and the encoding.
(KWQCFStringEncodingFromIANACharsetName): Get the flags as well as the encoding.
(KWQCFStringEncodingToIANACharsetName): Use the new dictionary format.
(encodingNameHash): Removed special case for hash for 0. This was useful in
JavaScriptCore where this hash function came from, but it's not relevant for
a CF hash function.
* kwq/KWQTextCodec.h: Added codecForNameEightBitOnly function to QTextCodec. Added optional
KWQEncodingFlags parameter to QTextCodec constructor. Replaced isISOLatin1Hebrew with
usesVisualOrdering. Added == and hash functions to QTextCodec. Added virtual destructor to
QTextDecoder. Added optional "flush" boolean parameter to QTextDecoder's toUnicode function.
* kwq/KWQTextCodec.mm:
(codecForCFStringEncoding): Use both the encoding and the flags as a key for the dictionary
that holds QTextCodec objects.
(QTextCodec::codecForName): Pass flags through.
(QTextCodec::codecForNameEightBitOnly): Added. Maps kCFStringEncodingUnicode to
kCFStringEncodingUTF8.
(QTextCodec::codecForLocale): Pass noEncodingFlags.
(QTextCodec::makeDecoder): Pass flags to KWQTextDecoder constructor.
(QTextCodec::toUnicode): Pass true for the "flush" boolean parameter to KWQTextDecoder.
(operator==): Added. Compares both encoding and flags.
(QTextCodec::hash): Added. Computes a hash of encoding and flags.
(QTextCodecsEqual): Added. Calls operator==.
(QTextCodecHash): Added. Calls hash member function.
(QTextDecoder::~QTextDecoder): Added. Empty.
(KWQTextDecoder::KWQTextDecoder): Made this no longer inline.
(KWQTextDecoder::~KWQTextDecoder): Added. Cache the TEC object for use next time.
(KWQTextDecoder::convertUTF16): Use the flags to decide on big vs. little endian when the
page does not have a BOM marker that makes it unambiguous.
(KWQTextDecoder::convertUsingTEC): Added flush parameter. Changed code to reuse the same
converter for successive convert calls, and only flush when the flush parameter is passed.
Added code to set the kUnicodeForceASCIIRangeMask. Do it directly since we can't use
TECSetBasicOptions due to bug 3201405.
(KWQTextDecoder::toUnicode): Pass flush parameter through.
* kwq/mac-encodings.txt: Added new sections for "Unicode, bigEndian", "Unicode, littleEndian",
and "ISOLatinHebrew, visualOrdering". Also moved UTF-16 to "Unicode" from "UTF8" since we now
handle this with the "8-bit-only" mechanism.
* kwq/make-charset-table.pl: Updated script to support flags (after a comma), and made it a bit
more strict about what to do with ill-formed lines.
* kwq/KWQCharsetData.c: Regenerated.
- other changes
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::searchForLabelsBeforeElement): Take advantage of "using" and remove
unneeded namespace prefixes.
(KWQKHTMLPart::matchLabelsAgainstElement): Ditto.
(KWQKHTMLPart::pauseActions): Ditto.
(KWQKHTMLPart::resumeActions): Add check for nil to match pauseActions. Also take
advantage of "using" and remove unneeded namespace prefixes.
(KWQKHTMLPart::saveWindowProperties): Use ERROR instead of ASSERT for the nil case.
(KWQKHTMLPart::saveLocationProperties): Use ERROR instead of ASSERT for the nil case.
(KWQKHTMLPart::restoreWindowProperties): Use ERROR instead of ASSERT for the nil case.
(KWQKHTMLPart::restoreLocationProperties): Use ERROR instead of printf for the nil case.
(KWQKHTMLPart::openURLFromPageCache): Take advantage of "using" and remove
unneeded namespace prefixes.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Ditto.
(KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
2003-03-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3196050 - Hang in www.janegoodall.org dynamic menus
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::handleLocalEvents): Copy handlers before processing
them, so we don't go into an infinite loop if a handler adds or
removes handlers.
2003-03-16 Trey Matteson <trey@apple.com>
3198135 - need to fix our projects so SYMROOT is not stripped
Tweaked stripping options: B&I build does not COPY_PHASE_STRIP.
Deployment build still does.
We strip manually as part of the install that we do ourselves.
Reviewed by Maciej.
* WebCore.pbproj/project.pbxproj:
2003-03-14 Richard Williamson <rjw@apple.com>
Fixed 3197162. The regression was introduced with the change
to preferences. The old settings API was used to 'reset' the jscript
other properties of the part. This effectively always disabled
javascript and prevented properties from being restored to the js
property maps.
Reviewed by trey.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::saveWindowProperties):
(KWQKHTMLPart::saveLocationProperties):
(KWQKHTMLPart::restoreWindowProperties):
(KWQKHTMLPart::restoreLocationProperties):
(KWQKHTMLPart::openURLFromPageCache):
2003-03-14 David Hyatt <hyatt@apple.com>
Make :target match the root element if no #fragment is specified in
the URL.
Reviewed by john
* khtml/css/cssstyleselector.cpp:
2003-03-14 Maciej Stachowiak <mjs@apple.com>
- fixed 3190846 - REGRESSION: can't use Fidelity NetBenefits account
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::updateForNewURL): Treat javascript: URLs as
about:blank for now.
(HTMLFrameElementImpl::attach): Likewise.
* khtml/khtml_part.cpp:
(KHTMLPart::processObjectRequest): Make sure to send completed() signal
after signals are connectd in synchronous load case.
2003-03-13 David Hyatt <hyatt@apple.com>
Fix for ew.com, hrweb and arstechnica forums. A <br> should
not create a nonempty line in the case where the previous line
didn't break cleanly. The fix is to have a new boolean that
tracks how the previous line broke and to have <br> check that
to figure out if it should set the line to be non-empty.
Reviewed by gramps
* khtml/rendering/bidi.cpp:
2003-03-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3188209 - REGRESSION: onmouseup handlers not running for most form elements
* khtml/rendering/render_form.cpp:
(RenderLineEdit::RenderLineEdit): Connect to clicked signal.
(RenderFileButton::RenderFileButton): Likewise.
(RenderFileButton::slotClicked): Send clicked through DOM.
(RenderTextArea::RenderTextArea): Connect to clicked signal.
* khtml/rendering/render_replaced.cpp:
(RenderWidget::sendConsumedMouseUp): New method to send a
mouseUp event for this DOM element. Meant for up events consumed
by AppKit mouseDown: methods that use modal event loops.
* khtml/rendering/render_replaced.h:
* kwq/KWQButton.h:
* kwq/KWQButton.mm:
(-[KWQButton initWithQButton:]): Moved here from former adaptor class.
(-[KWQButton action:]): Make sure to send up before click.
(-[KWQButton mouseDown:]): Record that we are processing a mouse
event. If no click happened, send the missing up event.
(QButton::QButton): Use NSButton subclass instead of separate adaptor.
(QButton::~QButton): Likewise.
* kwq/KWQFileButton.h:
* kwq/KWQFileButton.mm:
(KWQFileButton::KWQFileButton): Initialize clicked signal.
(KWQFileButton::clicked): Emit clicked signal.
(-[KWQFileButtonAdapter initWithKWQFileButton:]): Observe Clicked notification too.
(-[KWQFileButtonAdapter clicked]): Send mouse up and click through DOM.
* kwq/KWQLineEdit.h:
* kwq/KWQLineEdit.mm:
(QLineEdit::QLineEdit): Initialize clicked signal.
(QLineEdit::clicked): Emit clicked signal.
* kwq/KWQListBox.mm:
(QListBox::QListBox): No longer use separate object as delegate and data source.
(QListBox::~QListBox): No more need to retrieve and release delegate.
(-[KWQTableView initWithListBox:items:]):
(-[KWQTableView mouseDown:]): Record that we are processing a mouse
event; if no click happens while processing, send the mouse up event
through the DOM.
(-[KWQTableView tableViewSelectionDidChange:]): If sending clicked
and processing a mouse event, send up first.
* kwq/KWQTextArea.mm:
(-[KWQTextAreaTextView mouseDown:]): Send up and click through DOM
after calling super.
* kwq/KWQTextEdit.h:
* kwq/KWQTextEdit.mm:
(QTextEdit::QTextEdit): Initialize clicked signal.
(QTextEdit::clicked): Emit clicked signal.
* kwq/KWQTextField.mm:
(-[KWQTextField setPasswordMode:]): initWithQLineEdit: instead of initWithQWidget:
(-[KWQTextField fieldEditorDidMouseDown:]): Send up and click through DOM.
(-[KWQSecureTextField initWithQLineEdit:]): Store QLineEdit*, not just QWidget*.
(-[KWQSecureTextField fieldEditorDidMouseDown:]): Send up and click through DOM.
* kwq/KWQWidget.h:
* kwq/KWQWidget.mm:
(QWidget::sendConsumedMouseUp): Common method for widgets to send
a mouseUp that has been consumed by mouseDown processing through
the DOM.
* kwq/WebCoreBridge.h:
* kwq/WebCoreFirstResponderChanges.h:
* kwq/WebCoreViewFactory.m:
* WebCore.exp: Export new string constant.
* WebCore-combined.exp: Regenerated.
2003-03-13 Richard Williamson <rjw@apple.com>
First stage of the WebController -> WebView, WebView -> WebFrameView.
This change does the WebView -> WebFrameView part of the change. Also
changes WebController's inheritance. It now inherits from NSView.
Reviewed by Maciej.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::nextKeyView):
* kwq/KWQScrollView.mm:
* kwq/KWQWidget.mm:
(QWidget::getOuterView):
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge nextKeyViewInsideWebFrameViews]):
(-[WebCoreBridge previousKeyViewInsideWebFrameViews]):
2003-03-13 Darin Adler <darin@apple.com>
- remove mistaken inlining to fix build with newer versions of gcc
* khtml/rendering/render_object.cpp: (RenderObject::container):
Don't mark this inline.
2003-03-13 David Hyatt <hyatt@apple.com>
This is a fix to stop creating textruns for the whitespace at the
end of a block. This is a major line layout bug that leads to the
height of the last line in a paragraph being wrong, especially when
<font> tags are used.
Example of the problem:
<div><nobr>foo</nobr> </div>
The whitespace between the </nobr> and the end of the </div> was
being counted when it should have been stripped. The problem was
an off-by-one error with the endpoint I set up. I used a position
of 0, which is inclusive, so I needed a new value that meant
"Stop on this object and don't include any of it." I'm using
UINT_MAX as this special value for the position.
Reviewed by john
* khtml/rendering/bidi.cpp:
* khtml/rendering/bidi.h:
2003-03-13 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3197728 -- REGRESSION: crash at http://transitive.com/company.htm
* khtml/rendering/bidi.cpp: (appendRun): Added an if statement to handle
the case where obj is 0; the while loop already handled that case.
- did the "no inlining workaround" needed for newer versions of gcc
* khtml/css/parser.y: Added #define __inline as we have elsewhere.
* khtml/css/parser.cpp: Regenerated.
2003-03-13 David Hyatt <hyatt@apple.com>
Add color dumping and bgcolor dumping to the render dump tool.
Reviewed by darin
* kwq/KWQRenderTreeDebug.cpp:
(operator<<):
2003-03-13 David Hyatt <hyatt@apple.com>
Fix for 3193407, crash in CSS parser on www.hixie.ch. Improved the grammar to
understand the CSS3 :not selector so that it wouldn't think of that case as an
error. Also patched the error handling case that crashed on :not anyway. Then
I went ahead and implemented :not (since it was trivial to add once the parser
was reading it in).
Also fixed the regression that the * selector didn't work. The new KHTML trunk moved
away from a tag value of -1 in order to do @namespace support. Since we aren't really ready
to take that code yet, I patched our parser.y to treat * like -1 instead of 0xffff.
Implemented support for a couple of new CSS3 selectors, :root and ::selection. Also :last-child and :only-child.
Fixed a trivial bug (demonstrated in the CSS3 test suite) with the matching of the ~= selector.
Reviewed by darin
* khtml/css/Makefile.am:
* khtml/css/css_base.cpp:
(CSSSelector::extractPseudoType):
* khtml/css/css_base.h:
* khtml/css/cssstyleselector.cpp:
* khtml/css/parser.cpp:
* khtml/css/parser.y:
* khtml/rendering/render_style.h:
* khtml/rendering/render_text.cpp:
(TextRun::paintSelection):
(RenderText::paintObject):
=== Safari-67 ===
2003-03-13 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3194451 -- Textarea COLS='40.0' displays with width of 0
* khtml/xml/dom_stringimpl.h: Changed toInt to not be inline any more.
It was already really too big for inline to be a good optimization.
* khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toInt): Rewrote this to
find the valid characters at the start of the string, rather than strip
invalid characters from the end. The old code would strip non-digits from
the end, which doesn't help with a string like "40.0" or even "40 garbage3".
- fixed a bit of int/long sloppiness
* kwq/KWQString.mm:
(QString::toLong): Use LONG_MAX, not INT_MAX.
(QString::toULong): Use ULONG_MAX, not UINT_MAX.
2003-03-12 Richard Williamson <rjw@apple.com>
Fixed leak of RenderRoot.
Reviewed by darin.
* kwq/KWQPageState.mm:
(-[KWQPageState invalidate]): Added comment.
(-[KWQPageState dealloc]): Ensure that the renderer is "re"set on
the document so it will be correctly cleaned up in detach.
2003-03-12 David Hyatt <hyatt@apple.com>
Two fixes. The first is more help with macromedia. Floats could
get lost and not painted by the correct layer still. The new
code is more robust about checking if a layer crossing occurred
in the case where you want to addOverhangingFloats to a parent.
The second fix changes the priority of space allocation when
growing cells from their minwidths to their preferred widths.
The old code did fixed and then percent. The new code does
percent and then fixed.
Also when tables are overconstrained after growing cells to their
effective widths, instead of shrinking cells without regard for
their type, I implemented a shrink system that follows the same
priority (reversed) that was used when growing the cells originally.
Reviewed by darin
* khtml/rendering/render_block.cpp:
* khtml/rendering/table_layout.cpp:
(AutoTableLayout::layout):
2003-03-12 Trey Matteson <trey@apple.com>
3190784 REGRESSION: crash in KWQListIteratorImpl in form completion code at sonyericsson.com page
Don't crash on an input element with no enclosing form.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge formForElement:]): Gracefully bail on !form.
2003-03-11 David Hyatt <hyatt@apple.com>
Fix for tantek's slides, this is an issue on diveintomark's
list as well. <style> was not honoring any media attributes
set on it, so print stylesheets were being applied to the screen,
etc.!
Reviewed by rjw
* khtml/html/html_headimpl.cpp:
(HTMLStyleElementImpl::childrenChanged):
* khtml/html/html_headimpl.h:
=== Safari-66 ===
2003-03-11 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3166759 -- two fields both look like they have focus at webmail.iquest.net due to onblur
* kwq/KWQTextField.mm:
(-[KWQTextField selectText:]): Don't call -[NSTextField selectText:] in the case where we already
have an editor, because the NSTextField version will cause the field to relinquish first responder
and then take it back, which will send both onblur and onfocus.
(-[KWQSecureTextField selectText:]): Same fix for the secure text field.
2003-03-11 David Hyatt <hyatt@apple.com>
Fix the 16000 pixel tall scrollbar on macromedia.com/software.
vertical-align position hints were being set to bad values.
Reviewed by mjs
* khtml/rendering/render_object.cpp:
(RenderObject::getVerticalPosition):
2003-03-10 David Hyatt <hyatt@apple.com>
Fix for <pre> regression, bug #3193590, directory listings
busted.
Reviewed by gramps
* khtml/rendering/bidi.cpp:
2003-03-10 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3010915 -- mouse wheel won't scroll the main document when you are over [i]frame
* kwq/WebCoreScrollView.h: Added.
* kwq/WebCoreScrollView.m: Added. Overrides scrollWheel to "do the right thing".
* WebCore.pbproj/project.pbxproj: Added WebCoreScrollView, and made it SPI so WebKit can use it.
* WebCore.exp: Exported WebCoreScrollView so WebKit can use it.
* WebCore-combined.exp: Regenerated.
* kwq/KWQListBox.mm: Made KWQListBoxScrollView a subclass of WebCoreScrollView instead of NSScrollView.
* kwq/KWQTextArea.h: Made KWQTextArea a subclass of WebCoreScrollView instead of NSScrollView.
- other changes
* kwq/KWQComboBox.mm: Make the workaround for the position of text in the pop-up
compile only when we build on Jaguar. That way a Jaguar-built Safari looks perfect on
Jaguar and a Panther built one looks perfect on Panther.
* kwq/KWQKHTMLPart.mm: Reformatted some method calls.
2003-03-09 David Hyatt <hyatt@apple.com>
Fix compacts and run-ins to work a lot better than they did
before. I had some huge misunderstandings with how compact
worked that have now been clarified.
Reviewed by kocienda
* khtml/rendering/bidi.cpp:
* khtml/rendering/bidi.h:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::repaint):
* khtml/rendering/render_line.cpp:
(InlineFlowBox::placeBoxesHorizontally):
* khtml/rendering/render_object.cpp:
(RenderObject::nodeAtPoint):
* khtml/rendering/render_object.h:
2003-03-08 David Hyatt <hyatt@apple.com>
Check in the patch I actually meant to land. Somehow what I landed
had removed a line that was supposed to be there.
* khtml/css/cssstyleselector.cpp:
2003-03-07 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::submitForm): Fix form submission (was completely broken).
2003-03-07 Maciej Stachowiak <mjs@apple.com>
Reviewed by Richard.
- fixed 3127705 - don't open new window on opt-click even if the link requests it
- fixed 3143971 - cmd-click should override the target="_blank" and target="_new" (important for tabs)
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::openURL): Don't use findOrCreateFrameNamed, instead pass target along.
(KWQKHTMLPart::openURLRequest): Likewise.
(KWQKHTMLPart::submitForm): Likewise.
(KWQKHTMLPart::urlSelected): Likewise.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Likewise.
* kwq/WebCoreBridge.h:
2003-03-07 David Hyatt <hyatt@apple.com>
better fix for text-decoration issue on time.com.
Reviewed by mjs
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_style.h:
2003-03-07 David Hyatt <hyatt@apple.com>
Fix for time.com regression. Don't allow text-decoration to
apply to anchor elements with no href.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-03-07 David Hyatt <hyatt@apple.com>
Whoops. Fix regression causedb y previous checkin.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-03-07 David Hyatt <hyatt@apple.com>
Make the :hover:active behavior much more sophisticated
(and make it match WinIE, since that buggy browser is what
necessitates this hack).
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-03-06 David Hyatt <hyatt@apple.com>
Fix for 3156125, regression on hiptop.com. Caused by better
nowrap handling perversely enough. Need another quirk from
Moz/WinIE to make this site behave.
Reviewed by darin
* khtml/rendering/render_table.cpp:
(RenderTableCell::calcMinMaxWidth):
(RenderTableCell::setStyle):
2003-03-06 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3191027 -- REGRESSION: KWQColor assert at aol.com front page
* kwq/KWQColor.mm: (qRgb): Clamp to [0,0xFF] instead of asserting.
2003-03-06 Trey Matteson <trey@apple.com>
Refinement of routine that scans the DOM for field labels.
We skip nodes that have no renderer, or are invisible.
Reviewed by hyatt.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::searchForLabelsBeforeElement): Added check.
2003-03-06 David Hyatt <hyatt@apple.com>
Fix for 3190580, tables should reset line-height and white-space
in quirks mode.
Reviewed by trey and john
* khtml/css/quirks.css:
=== Safari-65 ===
2003-03-06 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3177862 -- REGRESSION: can't upload widget at www.konfabulator.com
* khtml/html/html_formimpl.cpp:
(fixUpfromUnicode): Add a call to fixLineBreaks here (and move this down below that function).
(HTMLFormElementImpl::formData): Remove the call to fixLineBreaks here, which was being used
on non-text form data, like files being uploaded.
2003-03-05 Trey Matteson <trey@apple.com>
Autofill tweak. In field names, replace all digits with spaces before matching
labels against them. This turns the digits to word boundaries, so field names like
"address2" are matched by "address".
As part of this, I abandoned an earlier attempt to map Qt regexp syntax to Darwin's.
Now clients just have to use Darwin's.
Reviewed by Maciej.
* kwq/KWQKHTMLPart.mm:
(regExpForLabels):
(KWQKHTMLPart::matchLabelsAgainstElement): Replace digits with space.
* kwq/KWQRegExp.mm:
(QRegExp::KWQRegExpPrivate::compile): Don't try to support Qt syntax.
2003-03-05 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3189442 -- REGRESSION: utf-16-little-endian.html crashes making decoder
* kwq/KWQCharsets.mm: (encodingNameHash): Re-add tolower call to hash function to
match the equality function.
2003-03-04 Trey Matteson <trey@apple.com>
New support for autofill. We provide a routine that scans backwards in the text
before a given element, looking for a match with a set of labels. In addition,
we provide for a similar match against the element's name.
To implement a few more methods in QRegExp API were implemented.
Reviewed by Maciej.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(scanForForm): Remove redundant call to a helper function.
(regExpForLabels): Return a regexp used to search for the set of labels.
(KWQKHTMLPart::searchForLabelsBeforeElement): Walk the DOM to scan backwards
in the text before the element, apply regexp to the text we find.
(KWQKHTMLPart::matchLabelsAgainstElement): Get the element name, use regexp
to check it for any of the labels.
* kwq/KWQRegExp.h:
* kwq/KWQRegExp.mm:
(QRegExp::KWQRegExpPrivate::KWQRegExpPrivate): Init two new ivars.
(RegExpFromPattern): Massage a non-glob expression before handing to Darwin.
(QRegExp::KWQRegExpPrivate::compile): Call RegExpFromPattern.
(QRegExp::match): Set new ivars based on match result.
(QRegExp::search): New API, just call match.
(QRegExp::searchRev): New API, call match repeatedly to (weakly) simulate a
reverse search.
(QRegExp::pos): Return info from last result.
(QRegExp::matchedLength): Return info from last result.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge searchForLabels:beforeElement:]): Call straight through to part.
(-[WebCoreBridge matchLabels:againstElement:]): Call straight through to part.
2003-03-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- got rid of some framework initialization (working on bug 3188781)
* khtml/khtml_part.cpp:
(KHTMLPart::setZoomFactor): Put some waitCursor use inside #if !APPLE_CHANGES.
(KHTMLPart::reparseConfiguration): Put some waitCursor use inside #if !APPLE_CHANGES.
* khtml/rendering/render_frames.cpp: (RenderFrameSet::userResize): Use KCursor cursors
instead of Qt cursors.
* kwq/KWQNamespace.h: Remove Qt cursors.
* kwq/KWQCursor.mm: Remove Qt cursors.
* kwq/KWQKCursor.h: Remove waitCursor.
* kwq/KWQKCursor.mm: Remove waitCursor.
2003-03-04 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed build rules for parser.cpp so we don't rebuild it every time
* khtml/css/Makefile.am: Changed target to parser.cpp, not parser.
- some QColor cleanup
* kwq/KWQColor.h: Removed the qRgba function, the unused KWQColor constructor
that takes a QString parameter, and made the KWQColor constructor that takes a
const char * parameter explicit.
* kwq/KWQColor.mm:
(QColor::QColor): Use findColor directly so we don't create and then destroy a QString.
(QColor::setNamedColor): Eliminated the unnecessary special case for empty string.
Get rid of the call to lower(), which is now handled by the caller. Got rid of the
"can't decipher this color" ERROR, which makes little sense now that non-named colors
(like hex ones) are handled at the KHTML level. Don't use setRgb to set the color,
since the RGB value in the gperf table is already in the correct format to just be
stored in QColor::color.
* khtml/misc/helper.h: Removed now-unused setNamedColor function. I'm sure this
same change exists on the KHTML trunk (since the CSS parser rewrite).
* khtml/misc/helper.cpp: More of the same.
* khtml/misc/loader.cpp: #if !APPLE_CHANGES the places that use qRgba to set
bgColor, which we don't use anyway.
2003-03-03 Maciej Stachowiak <mjs@apple.com>
Reviewed by Richard.
- upgrade to new hash function in one spot that I missed:
* kwq/KWQString.mm:
(QString::hash): Use spiffy new hash algorithm.
2003-03-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3163855 - Need control over certain potential dialogs/sheets
* khtml/rendering/render_form.cpp:
(RenderFileButton::RenderFileButton): Pass the part to KWQFileButton.
* kwq/KWQFileButton.h:
* kwq/KWQFileButton.mm:
(KWQFileButton::KWQFileButton): Go through the bridge for the view,
not the view factory.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::runJavaScriptAlert): Go through the bridge for the panel,
not the view factory.
(KWQKHTMLPart::runJavaScriptConfirm): Likewise.
(KWQKHTMLPart::runJavaScriptPrompt): Likewise.
* kwq/WebCoreViewFactory.h: Move methods from here...
* kwq/WebCoreBridge.h: ...to here.
2003-03-02 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
Updated string hash function to match the new, improved one in
JavaScriptCore.
* kwq/KWQCharsets.mm:
(encodingNameHash):
2003-03-03 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3187518 -- REGRESSION: w3c css sample page crashes in cssyyparse
* khtml/css/parser.y: (selector): Added code to handle the case where simple_selector is 0.
* khtml/css/parser.cpp: Regenerated.
- fixed regression I introduced earlier today where ID anchors wouldn't work
* khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
Check by ID first explicitly before using DOC_ANCHORS.
* WebCore.pbproj/project.pbxproj: Add parser.y to the project to make it easier to open it.
2003-03-03 David Hyatt <hyatt@apple.com>
Fix for 3185852, crash when dynamically inserting rules because
of an unitialized parser variable.
Reviewed by darin
* khtml/css/css_ruleimpl.cpp:
(CSSMediaRuleImpl::insertRule):
* khtml/css/css_stylesheetimpl.cpp:
(CSSStyleSheetImpl::insertRule):
* khtml/css/cssparser.cpp:
(CSSParser::parseRule):
* khtml/css/cssparser.h:
2003-03-03 David Hyatt <hyatt@apple.com>
Clean up dynamic ID/CLASS setting/removal. Make ID actually
work when set dynamically. Fixes bug 3173050.
Reviewed by john
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::parseAttribute):
2003-03-03 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3154394 -- non-repro nil-dereference in DOM::HTMLFormElementImpl::submit
* khtml/html/html_formimpl.cpp: (HTMLFormElementImpl::submit):
Add checks for nil like the other methods in this file have.
- fixed some types to remove a bit of unnecessary overhead
* khtml/ecma/kjs_window.h: Change types.
* khtml/ecma/kjs_window.cpp:
(Window::installTimeout): Change parameter to UString, not Identifier.
(WindowFunc::tryCall): Pass the UString, not Identifier.
(ScheduledAction::ScheduledAction): Change parameter to use const QString & to avoid
a bit of overhead.
(WindowQObject::installTimeout): Change parameter to UString, not Identifier.
2003-03-03 David Hyatt <hyatt@apple.com>
I messed up when i merged Lars' quirks color patch for CSS with
my original patch. I'm now exactly matching Lars' patch, and this
now fixes bug 3181185.
Reviewed by darin
* khtml/css/cssparser.cpp:
(CSSParser::parseColor):
2003-03-03 David Hyatt <hyatt@apple.com>
Fix for 3179084. Fix is to just dump our code so that the new
addHTMLColor code kicks in. This code is very close to WinIE
on more-colortests.html.
Reviewed by darin
* ChangeLog:
* kwq/KWQColor.mm:
(QColor::setNamedColor):
2003-03-03 David Hyatt <hyatt@apple.com>
Fix for 3178361, <th> don't draw borders. Boneheaded mistake
on my part. Just forgot to include it along with <td> in the
CSS hack for sharing cell rules.
Reviewed by rjw
* khtml/css/cssstyleselector.cpp:
2003-03-03 Richard Williamson <rjw@apple.com>
Fix build oops from last checkin to khtml/html/html_formimpl.cpp.
Reviewed by trey
* khtml/html/html_formimpl.cpp:
(encodeCString):
2003-03-03 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3183445 -- hang in QCString::length reloading page with lots of text in textarea
* khtml/html/html_formimpl.cpp: (encodeCString): Compute string length only once outside the loop
to avoid being O(n^2) in the size of the string.
2003-03-03 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3180364 -- infinite loop in JavaScript at www.vw.dk (due to document.anchors problem) leads to hang
The underlying problem was that our document.anchors had all the anchors in it.
But here's what the Gecko DOM reference documentation says about document.anchors:
"For reasons of backwards compatibility, the returned set of anchors only contains
those anchors created with the name attribute, not those created with the id attribute."
* khtml/html/html_miscimpl.cpp:
(HTMLCollectionImpl::calcLength): Include only A elements with NAME attributes in the DOC_ANCHORS case.
(HTMLCollectionImpl::getItem): Ditto.
(HTMLCollectionImpl::getNamedItem): Ditto.
2003-03-02 Trey Matteson <trey@apple.com>
Use a KWQPopUpButton in place of NSPopUpButton. The only addition is that
it implements the KWQWidgetHolder protocol. This is needed in order to
auto set PopUps during autofill.
Reviewed by Maciej.
* kwq/KWQComboBox.mm:
(QComboBox::QComboBox): Make a KWQPopUpButton instead of NSPopUpButton.
(QComboBox::~QComboBox): trivial s/KWQPopUpButton/NSPopUpButton/
(QComboBox::insertItem): ditto
(QComboBox::sizeHint): ditto
(QComboBox::baselinePosition): ditto
(QComboBox::clear): ditto
(QComboBox::setCurrentItem): ditto
(QComboBox::currentItem): ditto
(-[KWQPopUpButtonCell widget]): Also implement KWQWidgetHolder
(-[KWQPopUpButton widget]): Implement KWQWidgetHolder by calling our cell.
2003-02-28 Darin Adler <darin@apple.com>
* khtml/css/parser.y: Fixed bad check-in that broke the build in a subtle way.
* khtml/css/parser.cpp: Regenerated.
2003-02-28 Trey Matteson <trey@apple.com>
More support for autofill, autocomplete.
Pass the form element along with the values to WK when submitting.
isLoginForm looks for a single plain text field along with password fields, so as not to match registration forms.
Added means to find the "current" form on a page.
Added means to return the whole set of controls on a form.
Reviewed by Darin.
* khtml/html/html_elementimpl.h:
Added isGenericFormElement().
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::isLoginForm): See above.
(HTMLFormElementImpl::submit): Also register form when registering values,
so it will be sent over bridge.
* kwq/KWQKHTMLPart.h: New ivar to save form along with form values to be submitted.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Init _formAboutToBeSubmitted ivar.
(KWQKHTMLPart::~KWQKHTMLPart): Free _formAboutToBeSubmitted ivar.
(KWQKHTMLPart::openURL): Pass form to bridge along with values.
(KWQKHTMLPart::openURLRequest): Pass form to bridge along with values.
(scanForForm): Helper function to scan forward in the DOM for a form.
(KWQKHTMLPart::currentForm): Returns current form.
(KWQKHTMLPart::clearRecordedFormValues): Clear _formAboutToBeSubmitted.
(KWQKHTMLPart::recordFormValue): Record _formAboutToBeSubmitted too.
(KWQKHTMLPart::submitForm): Pass form to bridge along with values.
(KWQKHTMLPart::urlSelected): Pass form to bridge along with values.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Pass form to bridge along with values.
* kwq/KWQTextField.mm:
(-[KWQTextField setStringValue:]):
Call textChanged so the changes actually make it to khtml.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(viewForElement): New helper.
(formElementFromDOMElement): New helper.
(-[WebCoreBridge formIsLoginForm:]):
Changed API to operate on a form instead of a field.
(-[WebCoreBridge currentForm]): New method, described above.
(-[WebCoreBridge controlsInForm:]): New method, described above.
* kwq/WebCoreDOMNode.mm:
(-[WebCoreDOMNode isEqual:]):
Implement this to == compare the element we contain.
(-[WebCoreDOMNode hash]): Implement to hash element ptr we contain.
2003-02-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3180170 - filepile.com does not work correctly
I fixed this by making referrer work correctly for targetted
cross-frame and cross-window links. It is still not working right
for JavaScript window.open though.
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): Add some FIXMEs about not handling referrer right.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::openURL): Pass referrer.
(KWQKHTMLPart::openURLRequest): Pass referrer.
(KWQKHTMLPart::submitForm): Pass referrer.
(KWQKHTMLPart::urlSelected): Pass referrer.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Pass referrer.
* kwq/WebCoreBridge.h: Ad referrer argument to loadURL:
2003-02-28 David Hyatt <hyatt@apple.com>
Exclude <BR>s from the text-dec check. Really fixes 3185121.
Reviewed by john
* khtml/rendering/render_line.cpp:
(shouldDrawDecoration):
2003-02-28 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed some storage leaks; this code is still leaking when we run cvs-base
* khtml/css/parser.y:
(import): Use the new maybe_media_list (ported from KDE), and delete the
media list if the current item we are parsing is not a style sheet.
(maybe_media_list): Added. (ported from KDE).
(media_list): Added error case so we don't leak in that case (ported from KDE).
(media): Use media_list instead of media_list2 (ported from KDE).
(selector_list): Added error case so we don't leak in that case (ported from KDE).
(selector): Added error case so we don't leak in that case (ported from KDE).
(simple_selector): Added nil-checking (ported from KDE).
(element_name): Use 0xFFFF instead of -1 (ported from KDE).
(specifier_list): Added error case so we don't leak in that case (ported from KDE).
(declaration): Delete the expr if we don't use it because property is 0.
(expr): Added error case so we don't leak in that case (ported from KDE).
* khtml/css/cssparser.cpp:
(CSSParser::parseSheet): Delete the rule in case one was created.
(CSSParser::parseRule): Zero out the rule after extracting it to return.
(CSSParser::parseValue): Delete the rule in case one was created.
(CSSParser::parseDeclaration): Delete the rule in case one was created.
* khtml/css/parser.cpp: Regenerated.
2003-02-28 David Hyatt <hyatt@apple.com>
Fix for text-dec regression, 3185121.
Reviewed by john
* khtml/rendering/render_line.cpp:
(shouldDrawDecoration):
=== Safari-64 ===
=== Safari-63 ===
2003-02-26 David Hyatt <hyatt@apple.com>
Additional cleanup. Don't need the arg to be a reference param
any more.
Reviewed by mjs
* khtml/rendering/render_object.cpp:
(RenderObject::getTextDecorationColors):
* khtml/rendering/render_object.h:
2003-02-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed reproducible hang at http://asp.eltonsoft.dk/cast/get.asp?cat=Quicktime
This was a set of mutually recursive frameset pages. This allows
the number of frames to grow huge, which kills both WebCore and
WebKit, so I added a hard limit of 200 total frames per page.
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::isURLAllowed):
(HTMLFrameElementImpl::attach):
(HTMLFrameElementImpl::detach):
(HTMLIFrameElementImpl::attach):
* khtml/html/html_baseimpl.h:
* khtml/khtml_part.cpp:
(KHTMLPart::init):
(KHTMLPart::incrementFrameCount):
(KHTMLPart::decrementFrameCount):
(KHTMLPart::topLevelFrameCount):
* khtml/khtml_part.h:
2003-02-26 David Hyatt <hyatt@apple.com>
Fix numerous regressions with text-decoration in quirks mode and
also fixed a bug where text-decoration:none is not being honored
on links.
Reviewed by mjs
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_object.cpp:
(RenderObject::getTextDecorationColors):
* khtml/rendering/render_object.h:
* khtml/rendering/render_text.cpp:
(TextRun::paintDecoration):
2003-02-26 David Hyatt <hyatt@apple.com>
Fix for 3179109. containingBlock() had a big old bug in it.
For ABSOLUTE positioned elements, it would return inline relative
positioned parents (when it should only be returning blocks).
Reviewed by john
* khtml/rendering/render_object.cpp:
(RenderObject::containingBlock):
2003-02-25 David Hyatt <hyatt@apple.com>
Fix for findNextLayer problems. There was nothing wrong with
findNextLayer per se... it was just getting called *way* more
often than it needed to be.
Fixes two bugs, 3159866 and 3168815.
Reviewed by darin
* khtml/rendering/render_container.cpp:
(RenderContainer::appendChildNode):
(RenderContainer::insertChildNode):
* khtml/rendering/render_object.cpp:
(addLayers):
(RenderObject::addLayers):
* khtml/rendering/render_object.h:
2003-02-25 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3177139 -- REGRESSION: tiny buttons with no text on dbaron test page
This is actually a shortcoming in XML support. The reason it seemed like a regression
is that this page was parsed as HTML before we had the XML support.
* khtml/xml/xml_tokenizer.cpp:
(XMLHandler::startElement): As the HTML tokenizer/parser does, call init() on all DOM
tree elements before calling attach(). The KHTML guys want to get rid of init(), but until
they do, we need the same thing here as in the HTML version.
(XMLHandler::startCDATA): Ditto.
(XMLHandler::enterText): Ditto.
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Fix an obvious editing error that
would lead to a second attach.
2003-02-25 David Hyatt <hyatt@apple.com>
Revert one of my optimizations. It was bogus. You can't use
the parsed value of "inherit."
Fixes versiontracker. Bug #3178204
Reviewed by mjs
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::createSharedCellDecls):
2003-02-25 David Hyatt <hyatt@apple.com>
reverseRuns was buggy and crashing. 3182658.
Reviewed by mjs
* khtml/rendering/bidi.cpp:
2003-02-25 David Hyatt <hyatt@apple.com>
Regression caused by my inclusion of inline flows in the bidi
iteration. These flows are always empty and should be skipped
if found at the start of a line.
The bug # is 3175670.
* khtml/rendering/bidi.cpp:
2003-02-25 David Hyatt <hyatt@apple.com>
Fix for bug 3166276. <tt> uses wrong font size inside a table.
Make sure logical font values like "medium" don't set the "size
specified" bit on the font, so that the generic family change
code will get activated.
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
2003-02-25 Darin Adler <darin@apple.com>
Reviewed by me, changes by Dave.
- fixed 3181790 -- REGRESSION: TextRun objects of length 0 or with just the character '\n' leak
* khtml/rendering/render_text.cpp: (RenderText::position): Destroy the passed-in
TextRun if it's the kind that's not needed, rather than just returning.
- fixed 3181794 -- REGRESSION: objects created by RenderObject::createInlineBox leak
* khtml/rendering/render_box.cpp: (RenderBox::position): Only do work for replaced
elements, and for those elements, destroy the passed-in InlineBox. Dave says this
is not the real solution, but it does plug the leak.
* khtml/rendering/render_flow.cpp: (RenderFlow::createInlineBox): Call through
to the inherited createInlineBox for all replaced elements. This code was making
the wrong kind of InlineBox for replaced elements.
- removed Id cvs magic string which causes big headaches in generated files
* khtml/css/parser.cpp: Removed Id cvs magic string.
* khtml/css/parser.y: Removed Id cvs magic string.
2003-02-24 David Hyatt <hyatt@apple.com>
The new CSS1 parser, implementation of attr(), improvement of
the content property, impl of the :target selector, and new
dotted/dashed line drawing code for borders.
Reviewed by darin/gramps
* ForwardingHeaders/css/css_base.h: Added.
* WebCore.pbproj/project.pbxproj:
* khtml/css/Makefile.am:
* khtml/css/css_base.cpp: Added.
(StyleBaseImpl::checkLoaded):
(StyleBaseImpl::stylesheet):
(StyleBaseImpl::baseURL):
(StyleBaseImpl::setParsedValue):
(StyleListImpl::~StyleListImpl):
(CSSSelector::print):
(CSSSelector::specificity):
(CSSSelector::extractPseudoType):
(CSSSelector::operator == ):
(CSSSelector::selectorText):
* khtml/css/css_base.h: Added.
* khtml/css/css_ruleimpl.cpp:
(CSSRuleImpl::parentRule):
(CSSImportRuleImpl::CSSImportRuleImpl):
(CSSImportRuleImpl::~CSSImportRuleImpl):
(CSSImportRuleImpl::setStyleSheet):
(CSSImportRuleImpl::init):
(CSSMediaRuleImpl::CSSMediaRuleImpl):
(CSSMediaRuleImpl::append):
(CSSMediaRuleImpl::insertRule):
(CSSStyleRuleImpl::setDeclaration):
(CSSStyleRuleImpl::setNonCSSHints):
* khtml/css/css_ruleimpl.h:
* khtml/css/css_stylesheetimpl.cpp:
(CSSStyleSheetImpl::CSSStyleSheetImpl):
(CSSStyleSheetImpl::insertRule):
(CSSStyleSheetImpl::cssRules):
(CSSStyleSheetImpl::parseString):
(MediaListImpl::deleteMedium):
* khtml/css/css_stylesheetimpl.h:
* khtml/css/css_valueimpl.cpp:
(CSSStyleDeclarationImpl::getPropertyValue):
(CSSStyleDeclarationImpl::get4Values):
(CSSStyleDeclarationImpl::getShortHandValue):
(CSSStyleDeclarationImpl::getPropertyCSSValue):
(CSSStyleDeclarationImpl::removeProperty):
(CSSStyleDeclarationImpl::getPropertyPriority):
(CSSStyleDeclarationImpl::setProperty):
(CSSStyleDeclarationImpl::setLengthProperty):
(CSSPrimitiveValueImpl::CSSPrimitiveValueImpl):
(CSSPrimitiveValueImpl::cleanup):
(CSSPrimitiveValueImpl::computeLength):
(CSSPrimitiveValueImpl::computeLengthFloat):
(CSSPrimitiveValueImpl::setFloatValue):
(CSSPrimitiveValueImpl::cssText):
(FontFamilyValueImpl::FontFamilyValueImpl):
(FontValueImpl::FontValueImpl):
(FontValueImpl::~FontValueImpl):
* khtml/css/css_valueimpl.h:
* khtml/css/cssparser.cpp:
(qFatal):
(ValueList::ValueList):
(ValueList::~ValueList):
(ValueList::addValue):
(CSSParser::CSSParser):
(CSSParser::~CSSParser):
(CSSParser::parseSheet):
(CSSParser::parseRule):
(CSSParser::parseValue):
(CSSParser::parseDeclaration):
(CSSParser::addProperty):
(CSSParser::createStyleDeclaration):
(CSSParser::clearProperties):
(CSSParser::document):
(validUnit):
(CSSParser::parseShortHand):
(CSSParser::parse4Values):
(CSSParser::parseContent):
(CSSParser::parseShape):
(CSSParser::parseFont):
(CSSParser::parseFontFamily):
(parseColor):
(CSSParser::parseColor):
(yyerror):
(DOM::CSSParser::lex):
(toHex):
(DOM::CSSParser::text):
* khtml/css/cssparser.h:
* khtml/css/cssproperties.c:
(findProp):
* khtml/css/cssproperties.h:
* khtml/css/cssproperties.in:
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/css/cssvalues.c:
(hash_val):
(findValue):
* khtml/css/cssvalues.h:
* khtml/css/cssvalues.in:
* khtml/css/html4.css:
* khtml/css/parser.cpp: Added.
(DOM::getPropertyID):
(getValueID):
(cssyyerror):
(cssyylex):
(__yy_memcpy):
* khtml/css/parser.h: Added.
* khtml/css/parser.y: Added.
* khtml/css/quirks.css: Added.
* khtml/css/tokenizer.cpp: Added.
* khtml/css/tokenizer.flex: Added.
* khtml/dom/css_value.h:
* khtml/dom/html_element.cpp:
* khtml/ecma/kjs_css.cpp:
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
* khtml/html/html_blockimpl.cpp:
(HTMLDivElementImpl::parseAttribute):
(HTMLHRElementImpl::attach):
(HTMLParagraphElementImpl::parseAttribute):
* khtml/html/html_elementimpl.cpp:
(isHexDigit):
(toHex):
(HTMLElementImpl::addHTMLColor):
* khtml/html/html_elementimpl.h:
* khtml/html/html_inlineimpl.cpp:
(HTMLFontElementImpl::parseAttribute):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::parseAttribute):
(HTMLTableElementImpl::attach):
(HTMLTablePartElementImpl::parseAttribute):
(HTMLTableCellElementImpl::parseAttribute):
* khtml/khtml_part.cpp:
(KHTMLPart::gotoAnchor):
* khtml/misc/helper.h:
* khtml/rendering/render_body.cpp:
(RenderBody::setStyle):
* khtml/rendering/render_list.cpp:
(RenderListMarker::lineHeight):
(RenderListMarker::baselinePosition):
* khtml/rendering/render_style.cpp:
(RenderStyle::setContent):
* khtml/rendering/render_style.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::setFocusNode):
(DocumentImpl::setCSSTarget):
(DocumentImpl::getCSSTarget):
* khtml/xml/dom_docimpl.h:
* kwq/KWQChar.mm:
(QChar::upper):
* kwq/KWQColor.h:
* kwq/KWQKStandardDirs.mm:
(locate):
* kwq/KWQPainter.mm:
(QPainter::drawLine):
* kwq/KWQString.h:
2003-02-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3167642 - crash in renderArena.
* khtml/html/html_documentimpl.h:
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::HTMLDocumentImpl): Added new processingLoadEvent bool.
(HTMLDocumentImpl::close): Guard against re-entering the load event handler.
2003-02-24 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3179059 -- CSS1: capitalized letters should remain capitalized when
text-transform: capitalize is applied
* khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::capitalize): Capitalize the first
letters of words, but don't make any letters lowercase.
2003-02-23 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3179181 -- KURL won't accept URLs with a query part and no / separating host name from path
* kwq/KWQKURL.mm: (KURL::parse): Allow any path segment end character to end the host part of a
URL, rather than allowing only a "/".
2003-02-21 Maciej Stachowiak <mjs@apple.com>
Back out last change, mondo layout regressions.
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::close):
2003-02-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed 3167642 - crash in renderArena.
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::close): Clear the tokenizer early to avoid
re-entering the onload handler - this was causing a massive
overload of frames which finally caused a crash.
2003-02-21 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed a problem that was causing layout tests to give inconsistent results
* kwq/KWQPixmap.mm:
(QPixmap::size): Handle case of nil image so we don't use the uninitialized
result of dispatching a method to a structure-returning function.
(QPixmap::rect): Ditto.
(QPixmap::width): Ditto.
(QPixmap::height): Ditto.
2003-02-21 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- Made it possible to run the layout tests in a Deployment version
* kwq/KWQRenderTreeDebug.cpp: (externalRepresentation): Remove #ifndef NDEBUG.
* kwq/KWQRenderTreeDebug.h: Remove #ifndef NDEBUG.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge renderTreeAsExternalRepresentation]):
Remove #ifndef NDEBUG.
2003-02-21 Darin Adler <darin@apple.com>
* kwq/KWQRenderTreeDebug.cpp: (write): Add missing spaces in render
tree dump format.
2003-02-20 Maciej Stachowiak <mjs@apple.com>
Revert Dave's patch to these files, since it turned out to cause
layout regressions.
* khtml/rendering/render_layer.cpp:
(RenderLayer::updateLayerPosition):
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::container):
2003-02-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin Adler.
- fixed 3173276 - hang in kjs string at iteslj.org page
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::addPending): Leave whitespace unmolested inside
<script>, so that literal tabs in strings come through as tabs,
not spaces.
2003-02-20 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3177310 -- REGRESSION: "serif" mapped to "fixed"
Fixed a typo where the serif method was returning the fixed font name.
Also made this class use inlining for almost everything -- yields a miniscule
improvement in code size and speed, and increases brevity.
* kwq/KWQKHTMLSettings.h: Moved almost everything here.
* kwq/KWQKHTMLSettings.mm: Moved almost everything out of here.
2003-02-19 David Hyatt <hyatt@apple.com>
Update layers to not fix their positions during setLayouted.
Inline container() within render_object.cpp so setLayouted can
use it inline.
Reviewed by mjs
* khtml/rendering/render_layer.cpp:
(RenderLayer::updateLayerPosition):
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::container):
2003-02-19 David Hyatt <hyatt@apple.com>
Just chain BidiRuns using an internal next ptr and dump the
use of QPtrList (which has to malloc internal nodes to wrap
each run).
Reviewed by darin (reverseRuns reviewed by mjs)
* khtml/rendering/bidi.cpp:
* khtml/rendering/bidi.h:
* khtml/rendering/render_block.h:
2003-02-19 David Hyatt <hyatt@apple.com>
Make the BidiIterator midpoints use an array instead of a list.
Reviewed by kocienda
* khtml/rendering/bidi.h
* khtml/rendering/bidi.cpp:
* khtml/rendering/render_block.h:
2003-02-18 Maciej Stachowiak <mjs@apple.com
Reviewed by Chris.
Merged changes from Safari-58-1-branch.
2003-02-11 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
* WebCore.pbproj/project.pbxproj: Include /System/Library/PrivateFrameworks.
2003-02-18 Trey Matteson <trey@apple.com>
3171982 - REGRESSION: onClick handlers run twice when button pressed (DSLReports.com forums)
My earlier changes added the codepath by which we let khtmlview fully process
a mouse up after a widget has done it's tracking, which leads to the second
onClick call. Presumably that path does not exist in the native KDE case.
The change below reduces the impact of my hack, whereby instead of fully posting
a fake mouseup, we just note that the mouse has done up at the end of mousedown
handling, and clear the mousePressed state (state I also added).
Reviewed by Darin.
* khtml/khtmlview.cpp:
(KHTMLView::viewportMousePressEvent): Look for a current mouseUp at the end of
dispatching the mouse down.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget):
Don't post a phony mouse up from here.
(KWQKHTMLPart::lastEventIsMouseUp):
Utility routine to test for mouseUp.
=== Safari-62 ===
2003-02-18 David Hyatt <hyatt@apple.com>
Fix for 3176102, bad table cell regression. I was adding in
random properties for cells. Eep.
Also patched table element to add in the inherit property using
CSS_VAL_INHERIT instead of the string "inherit" (faster).
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/html/html_tableimpl.cpp
2003-02-18 David Hyatt <hyatt@apple.com>
Fix for 3171795, dotted borders drawn incorrectly. Picked this
gem up from the KHTML trunk.
Reviewed by darin
* khtml/rendering/render_object.cpp:
(RenderObject::drawBorder):
2003-02-17 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3174332 -- REGRESSION: bad initial layout due to empty QFontMetrics
* khtml/rendering/render_html.cpp: (RenderHtml::setStyle):
Don't set the style's to display:BLOCK if it's display:NONE. This prevents
us from modifying the special FOUC style among other things.
- unrelated code cleanup
* khtml/html/html_baseimpl.cpp: Moved code around that was grouped badly.
2003-02-17 David Hyatt <hyatt@apple.com>
Missed another "Almost Strict" spot.
Reviewed by kocienda
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::recalcStyle):
2003-02-17 David Hyatt <hyatt@apple.com>
Fix for 3% improvement on cached cvs-base. Make cells share the
declarations set up by the table (add these decls to the table
once instead of to every cell).
Reviewed by darin
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::HTMLTableElementImpl):
(HTMLTableElementImpl::~HTMLTableElementImpl):
(HTMLTableElementImpl::createSharedCellDecls):
(HTMLTableCellElementImpl::getAdditionalStyleDecls):
(HTMLTableCellElementImpl::attach):
* khtml/html/html_tableimpl.h:
* khtml/xml/dom_elementimpl.h:
2003-02-17 Trey Matteson <trey@apple.com>
2938062 Mouse cursor does not change to link cursor over non-button form submission controls
Reviewed by Darin
* khtml/khtmlview.cpp:
(isSubmitImage): Helper function to ID submit buttons with images.
(KHTMLView::viewportMouseMoveEvent): Set cursor for submit buttons with images.
* kwq/WebCoreBridge.mm:
(inputElementFromDOMElement): Simplify previously written casting goop.
2003-02-16 David Hyatt <hyatt@apple.com>
Fix "Almost Strict" mode to not match @konq-quirks.
Reviewed by kocienda
* ChangeLog:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::recalcStyleSelector):
2003-02-16 David Hyatt <hyatt@apple.com>
Fix to make table cells within the same table use a shared style
decl object (owned by the table). This stops every cell in a table
from having the exact same values copied on the cell itself.
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::HTMLTableElementImpl):
(HTMLTableElementImpl::~HTMLTableElementImpl):
(HTMLTableElementImpl::createSharedCellDecls):
(HTMLTableCellElementImpl::getAdditionalStyleDecls):
(HTMLTableCellElementImpl::attach):
* khtml/html/html_tableimpl.h:
* khtml/xml/dom_elementimpl.h:
2003-02-14 David Hyatt <hyatt@apple.com>
Make the inline box model live. Borders/backgrounds and text
decorations have been rewritten.
Also fixed a bug with clip rects. They didn't include borders.
Reviewed by kocienda
* khtml/css/cssstyleselector.cpp:
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall):
* khtml/rendering/bidi.cpp:
* khtml/rendering/font.cpp:
* khtml/rendering/font.h:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_box.cpp:
(RenderBox::paintBackground):
(RenderBox::paintBackgroundExtended):
(RenderBox::getClipRect):
(RenderBox::position):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::createInlineBox):
(RenderFlow::paintLineBoxBackgroundBorder):
(RenderFlow::paintLineBoxDecorations):
(RenderFlow::repaint):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_inline.cpp:
(RenderInline::paintObject):
(RenderInline::width):
(RenderInline::height):
(RenderInline::offsetLeft):
(RenderInline::offsetTop):
(RenderInline::nodeAtPoint):
* khtml/rendering/render_inline.h:
* khtml/rendering/render_line.cpp:
(InlineFlowBox::verticallyAlignBoxes):
(InlineFlowBox::computeLogicalBoxHeights):
(InlineFlowBox::placeBoxesVertically):
(InlineFlowBox::shrinkBoxesWithNoTextChildren):
(InlineFlowBox::paintBackgroundAndBorder):
(shouldDrawDecoration):
(InlineFlowBox::paintDecorations):
* khtml/rendering/render_line.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
(RenderObject::lineHeight):
(RenderObject::getTextDecorationColors):
* khtml/rendering/render_object.h:
* khtml/rendering/render_root.cpp:
(enclosingPositionedRect):
* khtml/rendering/render_style.cpp:
(StyleVisualData::StyleVisualData):
(StyleInheritedData::StyleInheritedData):
(StyleInheritedData::operator==):
(RenderStyle::diff):
* khtml/rendering/render_style.h:
* khtml/rendering/render_table.cpp:
(RenderTableCell::repaintRectangle):
* khtml/rendering/render_text.cpp:
(TextRun::paintDecoration):
(TextRun::checkSelectionPoint):
(RenderText::nodeAtPoint):
(RenderText::cursorPos):
(RenderText::absolutePosition):
(RenderText::paintObject):
(RenderText::paint):
(RenderText::position):
* khtml/rendering/render_text.h:
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::drawLineForText):
* kwq/WebCoreTextRenderer.h:
2003-02-13 Trey Matteson <trey@apple.com>
First checkin for working forms autocomplete.
This level has some new support routines.
Reviewed by Chris
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::isLoginForm): New, returns if a form is for login.
* khtml/html/html_formimpl.h:
* kwq/KWQDOMNode.cpp:
(idFromNode): New, helper routine to allow us to use the id() function from ObjC.
* kwq/KWQDOMNode.h:
* kwq/KWQTextArea.h: Adopt KWQWidgetHolder protocol.
* kwq/KWQTextArea.mm:
(-[KWQTextArea widget]): Adopt KWQWidgetHolder protocol.
(-[KWQTextAreaTextView widget]): Adopt KWQWidgetHolder protocol.
* kwq/KWQTextField.h: Adopt KWQWidgetHolder protocol.
* kwq/KWQTextField.mm:
(-[KWQTextField widget]): Adopt KWQWidgetHolder protocol.
(-[KWQSecureTextField widget]): Adopt KWQWidgetHolder protocol.
* kwq/KWQView.h: Define KWQWidgetHolder protocol
* kwq/KWQView.mm:
(-[KWQView widget]): Adopt KWQWidgetHolder protocol.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge elementForView:]): New method.
(inputElementFromDOMElement): Common code for next two methods.
(-[WebCoreBridge elementIsInLoginForm:]): New method.
(-[WebCoreBridge elementDoesAutoComplete:]): New method.
2003-02-13 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3162806 -- REGRESSION: handle == h assertion when clicking headphone link at cnn.com
* khtml/ecma/kjs_window.cpp: (HistoryFunc::tryCall): Instead of trying to actually do the
history navigation here, call the new KHTMLPart::scheduleHistoryNavigation.
* khtml/khtml_part.cpp:
(KHTMLPart::init): Add a few more #if !APPLE_CHANGES so we can leave out more unused fields.
(KHTMLPart::openURL): Ditto.
(KHTMLPart::createJavaContext): Ditto.
(KHTMLPart::clear): Also initialize m_scheduledRedirection to noRedirectionScheduled.
(KHTMLPart::checkCompleted): Use m_scheduledRedirection rather than m_redirectURL to check
whether a redirection is already in progress.
(KHTMLPart::scheduleRedirection): Use m_scheduledRedirection rather than m_redirectURL to check
whether a redirection is already in progress, and set m_scheduledRedirection to redirectionScheduled.
(KHTMLPart::scheduleHistoryNavigation): Added. Does the same thing as scheduleRedirection,
but always uses a delay of 0, sets m_scheduledRedirection to historyNavigationScheduled, and
sets m_scheduledHistoryNavigationSteps.
(KHTMLPart::slotRedirect): Add an if statement that does the history navigation. The code is
moved here from HistoryFunc::tryCall. Also set m_scheduledRedirection to noRedirectionScheduled.
(KHTMLPart::urlSelected): Add a few more #if !APPLE_CHANGES so we can leave out more unused fields.
(KHTMLPart::requestObject): Ditto.
(KHTMLPart::submitForm): Ditto.
(KHTMLPart::slotParentCompleted): Use m_scheduledRedirection rather than m_redirectURL to check
whether a redirection is already in progress.
(KHTMLPart::setZoomFactor): Add a few more #if !APPLE_CHANGES so we can leave out more unused fields.
* khtml/khtml_part.h: Added scheduleHistoryNavigation.
* khtml/khtmlpart_p.h: Added RedirectionScheduled enum. Added more #if !APPLE_CHANGES to leave out
a bunch more fields we don't use. Added m_scheduledRedirection and m_scheduledHistoryNavigationSteps.
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::redirectionTimerStartedOrStopped): Check and don't do anything
if the timer was being used for history redirection.
* khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::close):
Check m_scheduledRedirection instead of m_redirectURL to figure out if there is a redirection
in progress. Not strictly necessary since we really don't care about the history case here,
but consistent with the rest.
2003-02-13 Chris Blumenberg <cblu@apple.com>
Fixed WebKit typos found by Peter Wilson.
Reviewed by darin.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::bridgeForFrameName): call findOrCreateFrameNamed
* kwq/WebCoreBridge.h: fixed method name for findOrCreateFrameNamed
2003-02-12 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3158484 -- after submission failure, submitting a second time doesn't work
* kwq/KWQKHTMLPart.h: Added didNotOpenURL method. Changed _formSubmittedFlag bool
into _submittedFormURL string.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): No need to initialize string.
(KWQKHTMLPart::didNotOpenURL): If the form we submitted failed, then forget about it.
(KWQKHTMLPart::submitForm): Only do the protection against multiple submissions if
the URL is the same.
(KWQKHTMLPart::setView): Nuke the submitted URL here where we used to nuke the flag.
* kwq/WebCoreBridge.h: Added didNotOpenURL: method to be called by WebKit.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge didNotOpenURL:]): Forward the call to the part.
2003-02-12 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3162786 -- hang with large amounts of text in textarea
* kwq/KWQTextArea.mm: (-[KWQTextArea getCursorPositionAsIndex:inParagraph:]):
Rewrite to not use RangeOfParagraph to avoid n^2 algorithm. Also made small
changes to similar functions so they look similar, and got rid of an int/unsigned
mismatch in a case where the value is guaranteed to be positive.
2003-02-11 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3170403 -- nil-dereference in addEventListener
* khtml/ecma/kjs_dom.cpp: (DOMNodeProtoFunc::tryCall): Check getJSEventListener result for nil.
* khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Check getJSEventListener result for nil.
2003-02-11 Trey Matteson <trey@apple.com>
Set -seg1addr in our build styles, but not for the B&I build.
This makes our SYMROOTS from B&I usable to determine symbols from crash
logs from the field.
Also nuked DeploymentFat build style.
Reviewed by Ken.
* WebCore.pbproj/project.pbxproj:
2003-02-10 David Hyatt <hyatt@apple.com>
Inline box model landing, stage 1. Doesn't really change
much of anything visually yet. Just builds a bunch of boxes
and positions them, but those boxes aren't used yet.
Also fixing repaint() to understand not to dirty outside
overflow:hidden clipped ancestors.
Fixed two table bugs in table painting as well.
Reviewed by kocienda
* WebCore.pbproj/project.pbxproj:
* khtml/rendering/bidi.cpp:
* khtml/rendering/bidi.h:
* khtml/rendering/render_block.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_box.cpp:
(RenderBox::position):
(RenderBox::repaintRectangle):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::addChild):
(RenderFlow::deleteLineBoxes):
(RenderFlow::detach):
(RenderFlow::createInlineBox):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_image.cpp:
(RenderImage::paintObject):
* khtml/rendering/render_inline.cpp:
* khtml/rendering/render_inline.h:
* khtml/rendering/render_line.cpp: Added.
(InlineBox::detach):
(throw):
(InlineBox::operator delete):
(InlineFlowBox::marginLeft):
(InlineFlowBox::marginRight):
(InlineFlowBox::marginBorderPaddingLeft):
(InlineFlowBox::marginBorderPaddingRight):
(InlineFlowBox::getFlowSpacingWidth):
(InlineFlowBox::nextOnLineExists):
(InlineFlowBox::prevOnLineExists):
(InlineFlowBox::onEndChain):
(InlineFlowBox::determineSpacingForFlowBoxes):
(InlineFlowBox::placeBoxesHorizontally):
(InlineFlowBox::verticallyAlignBoxes):
(InlineFlowBox::adjustMaxAscentAndDescent):
(InlineFlowBox::computeLogicalBoxHeights):
(InlineFlowBox::placeBoxesVertically):
* khtml/rendering/render_line.h: Added.
* khtml/rendering/render_object.cpp:
(RenderObject::createInlineBox):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_table.cpp:
(RenderTableSection::paint):
(RenderTableCell::repaintRectangle):
(RenderTableCell::paint):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(RenderText::nodeAtPoint):
(RenderText::paintObject):
(RenderText::height):
(RenderText::createInlineBox):
(RenderText::position):
(RenderText::width):
(RenderText::metrics):
* khtml/rendering/render_text.h:
* khtml/xml/dom_docimpl.h:
2003-02-10 Darin Adler <darin@apple.com>
Reviewed by Richard.
- fixed 3124596 -- failures handling URLs with non-ASCII characters in them
* khtml/xml/dom_docimpl.h: Add an m_decoder field.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl): Initialize m_decoder to 0.
(DocumentImpl::completeURL): Pass the QTextCodec from m_decoder to KURL if present.
* khtml/khtml_part.cpp:
(KHTMLPart::begin): Set the decoder on the document when we make the document if we have a decoder.
(KHTMLPart::write): Set the decoder on the document when we make the decoder if we have a document.
(KHTMLPart::completeURL): Remove APPLE_CHANGES; we handle the encoding in the document.
* kwq/KWQKURL.h: Removed "encoding hint" parameters. Add a QTextCodec parameter to the
relative URL constructor, which is the one used when we deal with links on a page.
* kwq/KWQKURL.mm: (KURL::KURL): Decode the relative string based on the QTextCodec parameter.
* kwq/KWQString.h: Added isAllASCII, good for detecting when it's safe to use latin1()
or ascii() without worrying about character sets.
* kwq/KWQString.mm: (QString::isAllASCII): Added.
* WebCore-tests.exp: Updated for changes in KURL API.
* WebCore-combined.exp: Regenerated.
- other changes
* khtml/rendering/render_table.cpp: (RenderTableCell::setWidth): Add an assertion that will help
us notice future overflow issues.
* khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Rolled out the APPLE_CHANGES here that
were intended to cope with the lack of window.history, which we now have. While KHTML's rule may
not be the correct rule, this will now work as well in Safari as in Konqueror.
2003-02-07 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3145899 -- tf1.fr page marked UTF-8 is being decoded as Latin-1 (due to <noscript> before <meta>)
* khtml/misc/decoder.cpp: (Decoder::decode): Add NOSCRIPT to the list of tags
that are allowed before META tags that specify character sets.
- fixed 3144214 -- treat Big5 as Windows CP 950 the same way TEC does
* kwq/mac-encodings.txt: Move Big5 names to kCFStringEncodingDOSChineseTrad
instead of kCFStringEncodingBig5.
* kwq/KWQCharsetData.c: Regenerated.
2003-02-07 Richard Williamson <rjw@apple.com>
Changes to support per WebController preferences.
KHTMLPart now always accesses preferences from it's m_setting.
Changes made to WebPreferences pass to WebCoreSetting to KTMLSettings.
Added JavaScriptCanOpenWindowsAutomatically to KHTMLSettings.
Reviewed by Maciej and Ken.
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall):
* khtml/khtml_part.cpp:
(KHTMLPart::init):
(KHTMLPart::restoreURL):
(KHTMLPart::openURL):
(KHTMLPart::begin):
(KHTMLPart::reparseConfiguration):
* khtml/khtmlpart_p.h:
* kwq/KWQKConfigBase.h:
* kwq/KWQKConfigBase.mm:
(KConfig::readUnsignedNumEntry):
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::setSettings):
* kwq/KWQKHTMLSettings.h:
* kwq/KWQKHTMLSettings.mm:
(KHTMLSettings::stdFontName):
(KHTMLSettings::fixedFontName):
(KHTMLSettings::serifFontName):
(KHTMLSettings::sansSerifFontName):
(KHTMLSettings::cursiveFontName):
(KHTMLSettings::fantasyFontName):
(KHTMLSettings::minFontSize):
(KHTMLSettings::mediumFontSize):
(KHTMLSettings::mediumFixedFontSize):
(KHTMLSettings::isJavaEnabled):
(KHTMLSettings::autoLoadImages):
(KHTMLSettings::isPluginsEnabled):
(KHTMLSettings::isJavaScriptEnabled):
(KHTMLSettings::JavaScriptCanOpenWindowsAutomatically):
(KHTMLSettings::userStyleSheet):
(KHTMLSettings::setStdFontName):
(KHTMLSettings::setFixedFontName):
(KHTMLSettings::setSerifFontName):
(KHTMLSettings::setSansSerifFontName):
(KHTMLSettings::setCursiveFontName):
(KHTMLSettings::setFantasyFontName):
(KHTMLSettings::setMinFontSize):
(KHTMLSettings::setMediumFontSize):
(KHTMLSettings::setMediumFixedFontSize):
(KHTMLSettings::setAutoLoadImages):
(KHTMLSettings::setIsJavaScriptEnabled):
(KHTMLSettings::setIsJavaEnabled):
(KHTMLSettings::setArePluginsEnabled):
(KHTMLSettings::setJavaScriptCanOpenWindowsAutomatically):
(KHTMLSettings::setUserStyleSheet):
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge init]):
(-[WebCoreBridge initializeSettings:]):
* kwq/WebCoreSettings.h:
* kwq/WebCoreSettings.mm:
(-[WebCoreSettings dealloc]):
(-[WebCoreSettings init]):
(-[WebCoreSettings setStandardFontFamily:]):
(-[WebCoreSettings setFixedFontFamily:]):
(-[WebCoreSettings setSerifFontFamily:]):
(-[WebCoreSettings setSansSerifFontFamily:]):
(-[WebCoreSettings setCursiveFontFamily:]):
(-[WebCoreSettings setFantasyFontFamily:]):
(-[WebCoreSettings setMinimumFontSize:]):
(-[WebCoreSettings setDefaultFontSize:]):
(-[WebCoreSettings setDefaultFixedFontSize:]):
(-[WebCoreSettings setJavaEnabled:]):
(-[WebCoreSettings setPluginsEnabled:]):
(-[WebCoreSettings setJavaScriptEnabled:]):
(-[WebCoreSettings setJavaScriptCanOpenWindowsAutomatically:]):
(-[WebCoreSettings setWillLoadImagesAutomatically:]):
(-[WebCoreSettings setUserStyleSheetLocation:]):
(-[WebCoreSettings userStyleSheetLocation]):
(-[WebCoreSettings settings]):
2003-02-07 Darin Adler <darin@apple.com>
* khtml/rendering/render_table.h: Added copyright date.
* khtml/rendering/render_table.cpp: Added copyright date.
2003-02-07 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3165171 -- REGRESSION: images overlap text
* khtml/rendering/table_layout.cpp: (AutoTableLayout::calcEffectiveWidth):
Change to distribute space to the fixed columns first so the code to distribute to non-fixed columns does not
assume it can distribute more to the fixed columns than it really can.
2003-02-07 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3167025 -- REGRESSION: http://www.buypcdirect.com doesn't wrap correctly b/c of huge cell width value
* khtml/rendering/table_layout.h: Make the fields in the Layout structure used in table
width computations use int instead of short.
* khtml/rendering/table_layout.cpp:
(FixedTableLayout::calcMinMaxWidth): Make sure we don't overflow m_minWidth or m_maxWidth in case the
specified fixed width value is huge.
(FixedTableLayout::layout): Use ints for the calcWidth array instead of shorts.
(AutoTableLayout::calcMinMaxWidth): Clamp both maxWidth and minWidth to 0x7fff to match the other code in
this file, rather than using 10000.
2003-02-06 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3140738 -- textarea contents are LF delimited instead of CRLF
* khtml/html/html_formimpl.cpp:
(encodeCString): Turn CR followed by something other than LF into CRLF.
(fixLineBreaks): Added. Turns stray CRs and LFs into CRLF.
(HTMLFormElementImpl::formData): Call fixLineBreaks on form data.
- fixed 3167235 -- REGRESSION: assert after clicking on a link on radioslack.com
* kwq/KWQTextCodec.mm: (KWQTextDecoder::toUnicode): Return the null string
if the passed in string pointer is NULL, rather than asserting.
2003-02-06 David Hyatt <hyatt@apple.com>
Fix rollingstone regression.
Reviewed by mjs
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
2003-02-06 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3166693 -- REGRESSION: infinite recursion in makeFirstResponder while tabbing as page loaded
Because we now deliver blur events, we are triggering a handler on this page that changes focus.
It triggered an infinite loop because setFocus kept setting the focus back to a text field, which
then changed the focus to its editor. The fix was to make QWidget::setFocus smarter about editors.
* kwq/KWQTextField.mm: (-[KWQTextField becomeFirstResponder]): Don't do any changes in responder until
after calling KWQKHTMLPart::setDocumentFocus, since that can change focus away. If it does, return NO.
* kwq/KWQWidget.h: Add hasFocus, remove virtual from setFocus and clearFocus.
* kwq/KWQWidget.mm:
(QWidget::hasFocus): Added. Moved code to check if a particular view is first responder here.
Here's the bug fix too, check if the first responder is this widget's view's editor, and if so return true.
(QWidget::setFocus): Do nothing if this widget already has focus.
(QWidget::clearFocus): Do nothing if this widget does not have focus.
2003-02-06 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3161953 -- crash in KWQListImpl, DOM::CSSStyleSheetImpl::isLoading on XML page
The problem is that this page has some non-HTML elements, but the code was checking
only the element ID, not whether it is HTML or not. Also fixed the page's layout.
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::recalcStyleSelector):
Check that the node is an HTML element before checking the ID in two places.
Without this, we cast the pointer to the wrong type and trash memory.
* khtml/rendering/render_root.cpp:
(RenderRoot::layout): Set all the children false here, not just firstChild.
(RenderRoot::docHeight): Take all the children's heights into account, not just firstChild.
(RenderRoot::docWidth): Take all the children's widths into account, not just firstChild.
2003-02-06 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3165295 -- Hang while triple clicking on page
Flaws in the continuation logic we added to checkSelectionPoint made it take
exponential time on pages with a lot of continuations.
* khtml/rendering/render_object.h: Make checkSelectionPoint non-virtual, and
added virtual checkSelectionPointIgnoringContinuations.
* khtml/rendering/render_object.cpp:
(RenderObject::checkSelectionPoint): Added. Does the inline continuation part of
the render object walking process, which we only want to do at the top level,
since otherwise we will see the same nodes multiple times. Also optimizes by only
looking at the inline continuations of inlines, not any continuations of a block.
(RenderObject::checkSelectionPointIgnoringContinuations): This is now the virtual
function that is overriden by RenderText. It is identical to the old version of
checkSelectionPoint, minus the continuation logic.
* khtml/rendering/render_text.h: Changed the name of checkSelectionPoint to
checkSelectionPointIgnoringContinuations.
* khtml/rendering/render_text.cpp: (RenderText::checkSelectionPointIgnoringContinuations):
Changed the name, and nothing else.
- fixed my build which was crashing on load
* WebCore.pbproj/project.pbxproj: Change seg1addr from 2200000 to 9000000.
2003-02-05 Trey Matteson <trey@apple.com>
3137647 - ad frames get their own history entries at channels.netscape.com
3133844 - 2 items in back list at http://www.kiup-bank.com/personal/main01.html
The logic for deciding whether new entries are added to history is moved here
from WebKit. The advantage is that we can take specific action in each of the
relevant cases instead of the half-informed guessing WK was doing.
Here is what we now use for the lockHistory param to scheduleRedirect():
document.location = XXX - !userGesture
window.location = XXX - !userGesture
window.open - false
window.replace - true
window.reload - true
meta equiv http-refresh - delay <= 1
http-refresh - delay <= 1
Reviewed by Maciej, Darin.
* khtml/ecma/kjs_binding.cpp:
(ScriptInterpreter::wasRunByUserGesture): Rename of previous isWindowOpenAllowed(),
since we know use it for multiple purposes.
* khtml/ecma/kjs_binding.h:
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocument::putValue): Assignment to document.location locks history
if not a result of a user gesture.
* khtml/ecma/kjs_window.cpp:
(Window::put): Assignment to window.location locks history
if not a result of a user gesture.
(WindowFunc::tryCall): Adopt rename to wasRunByUserGesture().
(Location::put): Assignment to window.location locks history
if not a result of a user gesture.
* khtml/khtml_part.cpp:
(KHTMLPart::receivedFirstData): http-refreshes lock history if the timeout<1
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::processHttpEquiv): http-refreshes lock history if the timeout<1
2003-02-04 Trey Matteson <trey@apple.com>
Pass formValues up through the bridge at submit time.
Reviewed by Maciej
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::submit): Tell KWQPart about the form values, instead of
talking to the khtmlview.
* kwq/KWQKHTMLPart.h: New ivar to store formValues.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Init ivar
(KWQKHTMLPart::~KWQKHTMLPart): Free ivar
(KWQKHTMLPart::openURL): Pass nil formValues
(KWQKHTMLPart::openURLRequest): Pass nil formValues
(KWQKHTMLPart::clearRecordedFormValues): Clear saved formValues
(KWQKHTMLPart::recordFormValue): Record a name/value
(KWQKHTMLPart::submitForm): Pass along recorded formValues
(KWQKHTMLPart::urlSelected): Pass nil formValues
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Pass nil formValues
* kwq/WebCoreBridge.h: New params for formValues
2003-02-05 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3165682 -- REGRESSION: assertion failure in appendChildNode loading cnn.com
* khtml/rendering/render_table.cpp: (RenderTable::addChild):
Get rid of double-addChild introduced when I carelessly rolled in a change
from the KHTML guys.
2003-02-05 David Hyatt <hyatt@apple.com>
Fix for 3164949. My fix to make form controls actually obey
display settings in CSS exposed a bug in the html4.css
stylesheet. SELECT had been set to be display: block, which
is of course just plain wrong.
Reviewed by darin
* khtml/css/html4.css:
2003-02-05 Richard Williamson <rjw@apple.com>
Cleanup public WebHistory API, stage 1.
Reviewed by trey.
* kwq/KWQKHistoryProvider.mm:
* kwq/WebCoreHistory.h:
* kwq/WebCoreHistory.m:
(+[WebCoreHistory setHistoryProvider:]):
(+[WebCoreHistory historyProvider]):
2003-02-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3164850 -- REGRESSION: query URLs are broken
Mea culpa. The KURL test in the Tests directory failed last time, but for
some reason I didn't notice that when I ran it, perhaps due to the other
failing tests.
* kwq/KWQKURL.mm: (appendEscapingBadChars): Don't escape '?' even though
it is in the "bad character" set, since this is a more-lenient definition
of bad character. Also fixed a buffer overrun bug in the '%'-sequence-preserving
code, which is a second way this function is lenient. We still get the speed
because most characters this routine processes are not bad characters.
(KURL::encode_string): Instead of calling appendEscapingBadChars, put in
a strict version of the escaping loop that does not tolerate pre-existing
'%' sequences or '?' characters.
2003-02-04 Darin Adler <darin@apple.com>
Reviewed by Dave.
- rolled in table code fix from Dirk on the khtml-dev list
* khtml/rendering/render_table.cpp: (RenderTable::addChild):
Change return back to break.
2003-02-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- we say goodbye to "MIB numbers"
* khtml/misc/decoder.cpp:
(Decoder::Decoder): Get the Latin-1 codec using a name.
(Decoder::setEncoding): Detect the Hebrew encoding using isISOLatin1Hebrew()
instead of MIB number.
(Decoder::decode): Get the UCS-2 codec using a name. Redo APPLE_CHANGES so
we don't get the MIB-number-based workaround for a bug in QTextCodec that
KWQ doesn't have. Get the Latin-1 codec using a name.
* khtml/misc/loader.cpp:
(CachedCSSStyleSheet::CachedCSSStyleSheet): Get the Latin-1 codec using a name.
(CachedScript::CachedScript): Get the Latin-1 codec using a name.
* kwq/KWQCharsets.h: Remove the two MIB-related functions.
* kwq/KWQCharsets.mm: Remove the MIB number from the character set table struct.
Remove the MIB-related dictionary globals and functions.
(buildDictionaries): Remove code to set up the MIB-related dictionaries.
* kwq/KWQTextCodec.h: Remove codecForMib, mibEnum, and encoding member functions.
Add isISOLatin1Hebrew member function.
* kwq/KWQTextCodec.mm:
(QTextCodec::makeDecoder): Pass in the encoding when making KWQTextDecoder rather
than passing in the QTextCodec object.
(QTextCodec::toUnicode): Ditto.
(QTextCodec::isISOLatin1Hebrew): Return true for kCFStringEncodingISOLatinHebrew only.
(KWQTextDecoder::convertUsingTEC): Get encoding directly instead of from a QTextCodec.
(KWQTextDecoder::toUnicode): Ditto.
* kwq/make-charset-table.pl: Don't write out MIB numbers.
* kwq/KWQCharsetData.c: Regenerated.
* khtml/khtml_part.cpp: (KHTMLPart::completeURL):
Don't bother passing the MIB number to KURL. Soon, we'll have to
do something smart here, but we won't use MIB numbers.
* kwq/mac-encodings.txt: Added more 16-bit Unicode character set names.
Updated some comments.
2003-02-04 David Hyatt <hyatt@apple.com>
Patch calcInlineMaxWidth to add in left/right margins/borders/padding
separately (since the inline could break across multiple lines).
Reviewed by darin
* khtml/rendering/render_block.cpp:
(RenderBlock::calcInlineMinMaxWidth):
2003-02-04 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
* WebCore.pbproj/project.pbxproj: Updated to build the framework
standalone instead of embedded when doing a B&I build for Panther.
2003-02-04 David Hyatt <hyatt@apple.com>
Patch #1: Compacts are supposed to use their maximum intrinsic width
when determining if they will fit. I was wrongly using the
minwidth (i.e., being too aggressive about trying to squeeze
the compact in there).
Also yanking the setMaxWidth/MinWidth setters, since I'm not
using them any more.
Reviewed by kocienda
Patch #2: Implement an iterator for min/max width calculations
of blocks with inline children. This iterator will include
inline flows twice (with a bool flag indicating whether you're at the
start or end of the flow).
Reviewed by darin
* khtml/rendering/render_block.cpp:
(RenderBlock::layoutBlockChildren):
* khtml/rendering/render_box.h:
* khtml/rendering/render_object.h:
2003-02-04 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3142813 -- Safari displays a blank page when trying to open html file encoded in little-endian UTF-16
* kwq/KWQString.h: Remove fromStringWithEncoding and convertToQCString,
add append that takes a QChar * and length.
* kwq/KWQString.mm:
(QString::fromUtf8): Use QTextCodec instead of fromStringWithEncoding.
(QString::append): Implement by calling insert.
* kwq/KWQTextCodec.h: Added an encoding() member function to QTextCodec
and made QTextDecoder an abstract base class to pave the way for putting
more state in it to handle multibyte encodings.
* kwq/KWQTextCodec.mm: Add KWQTextDecoder, a concrete subclass of QTextDecoder.
(codecForCFStringEncoding): Moved the static inside this function for clarity.
(QTextCodec::makeDecoder): Make a KWQTextDecoder.
(QTextCodec::toUnicode): Make a KWQTextDecoder and use it do the decoding instead
of calling fromStringWithEncoding.
(KWQTextDecoder::convertUTF16): Added. Decodes Unicode, using the BOM to decide
whether it's little-endian or big-endian.
(KWQTextDecoder::convertUsingTEC): Added. Here's where the code from
QString::fromStringWithEncoding was moved. This needs to be changed to handle
state between multiple buffers passed in eventually, but not to fix this bug.
(KWQTextDecoder::toUnicode): Added. Calls convertUTF16 or convertUsingTEC.
* kwq/WebCoreBridge.mm: (+[WebCoreBridge stringWithData:textEncoding:]):
Use QTextCodec instead of fromStringWithEncoding.
* khtml/misc/decoder.cpp: (Decoder::decode): Rearranged the #if to make
things easier to read.
2003-02-04 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3150252 -- files with question marks in their names fail to upload as attachments
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formData): Don't include a Content-Type header at all if we don't
have a MIME type to send. Matches other web browsers' behavior.
(HTMLInputElementImpl::encoding): Construct the URL using setPath rather than just passing
a filename to the KURL constructor.
(HTMLSelectElementImpl::state): Tweak #if formatting a bit.
(HTMLSelectElementImpl::restoreState): Improve comment a bit.
* kwq/KWQKURL.mm: Make ? be a "bad character". I checked carefully to be sure this does
not adversely affect any calls, including running our KURL tests.
(KURL::setPath): Encode the passed-in path. I determined this was correct both by looking
at all the call sites in KHTML code to see that they would want this behavior, and by noticing
that the path() getter decodes the path.
2003-02-04 Ken Kocienda <kocienda@apple.com>
Reviewed by Darin
Radar 3142922 (file URLs should never be sent as referrers)
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge referrer]): Check that the referrer does not start with
the prefix "file:". If it does, return nil.
2003-02-03 David Hyatt <hyatt@apple.com>
Fix for 3163603, livepage.apple.com repaints entire page.
Reviewed by darin.
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
2003-02-03 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3133902 -- leaked render objects from makeChildrenNonInline (4 after running cvs-base)
* khtml/rendering/render_block.cpp: (RenderBlock::removeChild):
Deatch the anonymous block after emptying it out.
2003-02-03 David Hyatt <hyatt@apple.com>
Fix for livepage.apple.com crash. The bug # is
3163508.
Reviewed by darin
* khtml/rendering/render_box.cpp:
(RenderBox::setPos):
2003-02-03 David Hyatt <hyatt@apple.com>
Rename TextSlave to TextRun.
Reviewed by darin
* khtml/khtml_part.cpp:
(firstRunAt):
(lastRunAt):
(startAndEndLineNodesIncludingNode):
* khtml/rendering/bidi.cpp:
(RenderBlock::layoutInlineChildren):
* khtml/rendering/render_text.cpp:
(TextRun::detach):
(throw):
(TextRun::operator delete):
(TextRun::paintSelection):
(TextRun::paintDecoration):
(TextRun::paintBoxDecorations):
(TextRun::checkSelectionPoint):
(TextRunArray::TextRunArray):
(TextRunArray::compareItems):
(TextRunArray::findFirstMatching):
(RenderText::detach):
(RenderText::deleteRuns):
(RenderText::findTextRun):
(RenderText::nodeAtPoint):
(RenderText::checkSelectionPoint):
(RenderText::cursorPos):
(RenderText::posOfChar):
(RenderText::paintObject):
(RenderText::position):
(RenderText::width):
* khtml/rendering/render_text.h:
* kwq/KWQRenderTreeDebug.cpp:
(writeTextRun):
(write):
2003-02-03 David Hyatt <hyatt@apple.com>
Fix for assertion on nasdaq.com. Patch containingBlock
to return 0 when it can't find a containingBlock at all (e.g.,
when the object is orphaned).
Patch setOverhangingContents to deal with a null containingBlock
caused by it being called from RenderImage::setStyle().
The bug # is 3162989.
Reviewed by Darin.
* khtml/rendering/render_object.cpp:
(RenderObject::containingBlock):
(RenderObject::setOverhangingContents):
2003-02-02 David Hyatt <hyatt@apple.com>
Enable support for the "run-in" and "compact" display types.
Also implementing support for :before and :after (they were not even
remotely working before these fixes).
Made sure :first-letter drills into inline children to find the
first letter in a block, e.g., so :before content can be used in
conjunction with :first-letter.
Fixed a regression in addOverhangingFloats that broke meyerweb.com's
front page.
Patched findNextLineBreak to correctly handle words that cross
inline boundaries and white-space mixtures. We now pass Hixie's
insanely evil mixed white-space test (we are the only browser
to do so).
Reviewed by kocienda
* ChangeLog:
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/bidi.cpp:
(RenderBlock::findNextLineBreak):
* khtml/rendering/render_block.cpp:
(RenderBlock::setStyle):
(RenderBlock::addChildToFlow):
(getInlineRun):
(RenderBlock::layoutBlockChildren):
(RenderBlock::paintObject):
(RenderBlock::clearFloats):
* khtml/rendering/render_box.cpp:
(RenderBox::calcWidthUsing):
* khtml/rendering/render_box.h:
* khtml/rendering/render_container.cpp:
(RenderContainer::insertPseudoChild):
* khtml/rendering/render_container.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::addChild):
* khtml/rendering/render_image.cpp:
(RenderImage::setStyle):
* khtml/rendering/render_inline.cpp:
(RenderInline::setStyle):
(RenderInline::addChildToFlow):
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
* khtml/rendering/render_object.h:
* khtml/rendering/render_style.cpp:
(RenderStyle::addPseudoStyle):
2003-02-03 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3146862 -- meta http-equiv refresh with a space before the delay does not work
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::processHttpEquiv):
Fix code that was trying to use positions within the whitespace-stripped string,
but extracting substrings from the non-stripped original.
- tweaks to render tree dumping format
* khtml/rendering/render_block.h: Make renderName not be inline, since
an inline virtual function doesn't really do any good.
* khtml/rendering/render_block.cpp: (RenderBlock::renderName): Use the
string RenderBlock instead of the string Block for consistency with all the
other renderName results.
* khtml/rendering/render_inline.h: Make renderName not be inline, since
an inline virtual function doesn't really do any good.
* khtml/rendering/render_inline.cpp: (RenderInline::renderName): Use the
string RenderInline instead of the string Inline for consistency with all the
other renderName results.
* khtml/rendering/render_text.h: Make textSlaves() a const member function.
* kwq/KWQRenderTreeDebug.cpp:
(operator<<): Format rectangles as "x at (1,2) size 3x4" rather than "(1,2,3,4)".
(quoteAndEscapeNonPrintables): Added. Makes it easy to turn an arbitrary Unicode
string into something that's all ASCII.
(writeTextSlave): Change this so it also writes out the text.
(write): Call the new writeTextSlave, and also use "layer" instead of "RenderLayer".
2003-02-01 Darin Adler <darin@apple.com>
- fix mistake that broke build
* khtml/rendering/render_block.h: Add include of <qsortedlist.h>.
2003-01-31 Darin Adler <darin@apple.com>
Reviewed by Dave.
- reduced the amount of RenderFlow in the world by about 1/2
* khtml/rendering/bidi.h: Take RenderBlock * instead of RenderFlow *.
* khtml/rendering/bidi.cpp:
(BidiIterator::BidiIterator): Take RenderBlock * instead of RenderFlow *.
(RenderBlock::layoutInlineChildren): Fix debug message to say RenderBlock instead of RenderFlow.
(RenderBlock::findNextLineBreak): Fix debug message to say RenderBlock instead of RenderFlow.
* khtml/rendering/render_block.cpp:
(RenderBlock::addChildToFlow): Make RenderBlock * instead of RenderFlow *.
(RenderBlock::layout): Fix debug message to say RenderBlock instead of RenderFlow.
(RenderBlock::layoutBlockChildren): Fix debug message to say RenderBlock instead of RenderFlow.
(RenderBlock::clearFloats): Fix debug message to say RenderBlock instead of RenderFlow.
* khtml/rendering/render_flow.h: Return a RenderFlow * instead of a RenderObject * from createFlow.
* khtml/rendering/render_flow.cpp:
(RenderFlow::createFlow): Use an if statement instead of ? : to get rid of typecasting.
* khtml/rendering/render_html.cpp: (RenderHtml::containingBlockWidth):
Fix parent call to call RenderBlock. Calling RenderFlow was a mistake, but one that didn't matter
since the actual method isn't implemented until up in RenderBox anyway.
* khtml/rendering/render_inline.h: Change some parameters to RenderBlock *.
* khtml/rendering/render_inline.cpp:
(cloneInline): Make this return a RenderInline * instead of a RenderFlow *.
(RenderInline::splitInlines): Change some parameters to RenderBlock * and locals to RenderInline *.
(RenderInline::splitFlow): Change some parameters and locals to RenderBlock *.
* khtml/rendering/render_layer.h: Remove forward declaration of class RenderFlow.
* khtml/rendering/render_object.h: Remove forward declaration and friend declaration of class RenderFlow.
2003-01-31 Trey Matteson <trey@apple.com>
New plumbing for autofill/autocomplete. WebBrowser receives controlText delegate
messages from our form widgets. Should result in no behavior change.
New SPI is exposed over the bridge and KWQTextField passes the text delegate msgs to it.
Reviewed by Richard
* kwq/KWQTextField.mm: Pass text delegate msgs through new SPI.
(-[KWQTextField controlTextDidBeginEditing:]):
(-[KWQTextField controlTextDidEndEditing:]):
(-[KWQTextField controlTextDidChange:]):
(-[KWQTextField control:textShouldBeginEditing:]):
(-[KWQTextField control:textShouldEndEditing:]):
(-[KWQTextField control:didFailToFormatString:errorDescription:]):
(-[KWQTextField control:didFailToValidatePartialString:errorDescription:]):
(-[KWQTextField control:isValidObject:]):
(-[KWQTextField control:textView:doCommandBySelector:]):
* kwq/WebCoreBridge.h: New SPI for passing text delegate msgs.
2003-01-31 David Hyatt <hyatt@apple.com>
Fix regression that broke John's site. RenderInline needs
to implement childrenInline() so that it can return true.
I pulled this method out of RenderFlow and into RenderBlock,
which caused RenderInline to use RenderObject's method (and
that one returns false).
Reviewed by rjw
* khtml/rendering/render_inline.h:
2003-01-31 David Hyatt <hyatt@apple.com>
Fix for crash on espn.com. Revert my change to make
containingBlock() return 0 for the root. Put it back to the
old behavior, where the root returns itself when you ask for
the root's containing block.
Reviewed by rjw
* khtml/rendering/render_object.cpp:
(RenderObject::containingBlock):
(RenderObject::setOverhangingContents):
2003-01-31 David Hyatt <hyatt@apple.com>
Two whitespace handling fixes that improve <pre> handling,
especially of inline pres.
Reviewed by rjw.
* khtml/rendering/bidi.cpp:
(RenderBlock::findNextLineBreak):
2003-01-31 Darin Adler <darin@apple.com>
Reviewed by Richard.
* khtml/misc/decoder.cpp: (Decoder::decode): Turn off Japanese auto-detect.
It was causing us to use Japanese encoding on pages that were UTF-8.
2003-01-31 Darin Adler <darin@apple.com>
* Resources/Info.plist: Removed unused file.
2003-01-31 David Hyatt <hyatt@apple.com>
Split RenderFlow into subclasses: RenderInline and RenderBlock.
This change should make inlines a lot smaller (since nearly all
of the member variables in RenderFlow moved into RenderBlock).
It also simplifies methods like containingBlock(), which can
now return a RenderBlock.
Reviewed by darin
* WebCore.pbproj/project.pbxproj:
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/bidi.cpp:
(RenderBlock::bidiReorderLine):
(RenderBlock::layoutInlineChildren):
(RenderBlock::findNextLineBreak):
* khtml/rendering/render_block.cpp: Added.
(:RenderFlow):
(RenderBlock::~RenderBlock):
(RenderBlock::setStyle):
(RenderBlock::addChildToFlow):
(getInlineRun):
(RenderBlock::makeChildrenNonInline):
(RenderBlock::removeChild):
(RenderBlock::layout):
(RenderBlock::layoutBlockChildren):
(RenderBlock::layoutSpecialObjects):
(RenderBlock::paint):
(RenderBlock::paintObject):
(RenderBlock::paintFloats):
(RenderBlock::insertSpecialObject):
(RenderBlock::removeSpecialObject):
(RenderBlock::positionNewFloats):
(RenderBlock::newLine):
(RenderBlock::leftOffset):
(RenderBlock::leftRelOffset):
(RenderBlock::rightOffset):
(RenderBlock::rightRelOffset):
(RenderBlock::lineWidth):
(RenderBlock::nearestFloatBottom):
(RenderBlock::floatBottom):
(RenderBlock::lowestPosition):
(RenderBlock::rightmostPosition):
(RenderBlock::leftBottom):
(RenderBlock::rightBottom):
(RenderBlock::clearFloats):
(RenderBlock::addOverHangingFloats):
(RenderBlock::checkClear):
(RenderBlock::nodeAtPoint):
(RenderBlock::calcMinMaxWidth):
(next):
(RenderBlock::calcInlineMinMaxWidth):
(RenderBlock::calcBlockMinMaxWidth):
(RenderBlock::close):
(RenderBlock::printTree):
(RenderBlock::dump):
* khtml/rendering/render_block.h: Added.
* khtml/rendering/render_body.cpp:
(RenderBody::RenderBody):
(RenderBody::setStyle):
(RenderBody::layout):
(RenderBody::availableHeight):
* khtml/rendering/render_body.h:
* khtml/rendering/render_box.cpp:
(RenderBox::containingBlockWidth):
(RenderBox::calcWidth):
(RenderBox::calcHeight):
* khtml/rendering/render_container.cpp:
(RenderContainer::insertPseudoChild):
(RenderContainer::removeLeftoverAnonymousBoxes):
* khtml/rendering/render_flow.cpp:
(RenderFlow::createFlow):
(RenderFlow::addChildWithContinuation):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_form.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::RenderHtml):
(RenderHtml::setStyle):
(RenderHtml::layout):
* khtml/rendering/render_html.h:
* khtml/rendering/render_image.h:
* khtml/rendering/render_inline.cpp: Added.
(:RenderFlow):
(RenderInline::~RenderInline):
(RenderInline::setStyle):
(RenderInline::addChildToFlow):
(cloneInline):
(RenderInline::splitInlines):
(RenderInline::splitFlow):
(RenderInline::paint):
(RenderInline::paintObject):
(RenderInline::calcMinMaxWidth):
(RenderInline::offsetWidth):
(RenderInline::offsetHeight):
(RenderInline::offsetLeft):
(RenderInline::offsetTop):
* khtml/rendering/render_inline.h: Added.
* khtml/rendering/render_list.cpp:
(RenderListItem::RenderListItem):
(RenderListItem::setStyle):
(getParentOfFirstLineBox):
(RenderListItem::calcMinMaxWidth):
(RenderListItem::layout):
(RenderListItem::paint):
(RenderListItem::paintObject):
* khtml/rendering/render_list.h:
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
(RenderObject::containingBlock):
(RenderObject::setOverhangingContents):
(RenderObject::removeFromSpecialObjects):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::RenderRoot):
(RenderRoot::calcMinMaxWidth):
(RenderRoot::layout):
(RenderRoot::paintObject):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTable::RenderTable):
(RenderTable::setStyle):
(RenderTable::lineHeight):
(RenderTable::baselinePosition):
(RenderTable::addChild):
(RenderTable::calcWidth):
(RenderTable::recalcSections):
(RenderTable::dump):
(RenderTableCell::RenderTableCell):
(RenderTableCell::detach):
(RenderTableCell::calcMinMaxWidth):
(RenderTableCell::close):
(RenderTableCell::repaintRectangle):
(RenderTableCell::absolutePosition):
(RenderTableCell::setStyle):
(RenderTableCell::dump):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.h:
* khtml/xml/dom_textimpl.cpp:
(TextImpl::rendererIsNeeded):
2003-01-31 Darin Adler <darin@apple.com>
Reviewed by me, Dave wrote the code.
- fixed 3162013 -- Safari collapses margins through bottom borders (affects top of zeldman.com)
* khtml/rendering/render_flow.cpp: (RenderFlow::layoutBlockChildren):
Don't collapse if we have any bottom border or padding.
2003-01-31 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3160442 -- no top image map at ebay, caused by referrer returning null instead of empty string
* khtml/ecma/kjs_html.cpp: (KJS::HTMLDocument::tryGet):
Return an empty string, not null, when there is no referrer.
2003-01-31 Chris Blumenberg <cblu@apple.com>
* kwq/WebCoreBridge.mm: fixed key value
2003-01-31 Chris Blumenberg <cblu@apple.com>
Fixed : 3155148 - image shown when dragging gets size from image file, not size as used on page
Reviewed by darin.
* kwq/WebCoreBridge.h: added WebCoreElementImageRectKey
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge elementAtPoint:]): get the rect of the image
2003-01-30 Trey Matteson <trey@apple.com>
3161088 - disabled select elements are not disabled when scrolling list used
We use a tableview delegate method to prevent the user from changing the
selection when disabled. Too bad tableviews don't know how to disable themselves.
We also condition the cell used for drawing to match our enabled state.
Reviewed by Maciej.
* kwq/KWQListBox.h: Keep track of whether we are enabled.
* kwq/KWQListBox.mm:
(QListBox::QListBox): Init new flag.
(QListBox::setEnabled): Set new flag.
(QListBox::isEnabled): Getter for new flag.
(-[KWQListBoxTableViewDelegate selectionShouldChangeInTableView:]):
Disallow selection changes if disabled.
(-[KWQListBoxTableViewDelegate tableView:willDisplayCell:forTableColumn:row:]):
Enable cell based on our enabled state to get visual feedback of being disabled.
2003-01-30 Trey Matteson <trey@apple.com>
3161486 - REGRESSION: double click on a widget causes crash
Slight enhancement to the earlier fix of this bug. When handling a doubleclick we
don't want to try to pass the current event down the Cocoa widgets, because Cocoa
has no double-click event, and we just end up resending one we already sent.
The upshot is that we do not pass an extra mouseup event to the widgets at the
end of a double click sequence.
Reviewed by Darin.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget):
Do not pass event down to the widget for doubleclick events.
=== Safari-55 ===
2003-01-30 Darin Adler <darin@apple.com>
Reviewed by Ken, Maciej, and Trey.
- fixed 3161486 -- REGRESSION: double click on a widget causes crash
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
Only pass the mouseUp event if it's not the same as the current event.
Through a strange set of circumstances, sometimes the "mouse down" event is a mouse up
event (due to KHTML vs. AppKit differences for double-click handling).
- fixed build with newer compiler
* khtml/html/Makefile.am: Use ANSI-C style, not C++ style, gperf.
* khtml/html/doctypes.cpp: Regenerated.
* khtml/html/html_documentimpl.cpp: Do __inline workaround to make newer compiler happy.
(HTMLDocumentImpl::determineParseMode): Change to use ANSI-C style.
2003-01-30 Richard Williamson <rjw@apple.com>
Fix for 3156831 (and dupe 3160816). Don't access userInfo on an invalid NSTimer.
Reviewed by trey.
* kwq/KWQObject.mm:
(QObject::pauseTimer):
(QObject::resumeTimers):
2003-01-30 Trey Matteson <trey@apple.com>
3160565 - REGRESSION: Can't log in to etrade
Fix regression caused by fixed to 3058229. We auto-select an item of a select element
if it is size=1 or size is unset (m_size==0 in the code).
This gives us conformance with WinIE. The test at dbaron.org fails us for the
case of a disabled list with no size and no initial selection.
Reviewed by Darin.
* khtml/html/html_formimpl.cpp:
(HTMLSelectElementImpl::recalcListItems): Auto-select an item if size==1 or is unset.
2003-01-30 David Hyatt <hyatt@apple.com>
Make quirk bits part of the bitfield to shrink RenderFlows.
Reviewed by trey
* khtml/rendering/render_flow.h:
2003-01-30 David Hyatt <hyatt@apple.com>
Fix for 3155954. Make sure no layers get made for :before,
:after or :first-letter. The only debatable case is whether
overflow can apply to generated content. Included a FIXME
to think about that case.
Reviewed by darin
* khtml/rendering/render_container.cpp:
(RenderContainer::insertPseudoChild):
* khtml/rendering/render_flow.cpp:
(RenderFlow::addChildToFlow):
* khtml/rendering/render_text.cpp:
(RenderText::nodeAtPoint):
2003-01-30 Darin Adler <darin@apple.com>
* khtml/html/html_documentimpl.cpp: Updated license.
2003-01-29 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3158958 -- nil-dereference in KJS::DOMNode::getValueProperty at www.babyage.com
* khtml/ecma/kjs_dom.cpp: (DOMNode::getValueProperty):
Move the code that gets the render object down after the point where the render tree
is updated, so we don't end up using a stale pointer.
2003-01-29 Darin Adler <darin@apple.com>
- add new assertion that Dave can use to debug bug 3155954 tomorrow
* khtml/rendering/render_arena.cpp: (RenderArena::allocate): Assert that the arena is not 0.
(RenderArena::free): Change signature so we will detect double-frees even more simply.
2003-01-29 David Hyatt <hyatt@apple.com>
Margins were being lost on documents inside iframes
and objects. This turned out to be 3 different bugs, one
of which involved the bad cast of an object element to an
iframe element.
Reviewed by darin
* khtml/html/html_baseimpl.cpp:
(HTMLIFrameElementImpl::HTMLIFrameElementImpl):
* khtml/rendering/render_frames.cpp:
(RenderPartObject::slotViewCleared):
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::createPart):
2003-01-29 David Hyatt <hyatt@apple.com>
Fix for auto width tables. Prevent overflow when assigning from
the computed integer max width back into a short value.
Fixes cnn.com and spies.com. Bug # is 3158469.
Reviewed by darin
* khtml/rendering/table_layout.cpp:
(AutoTableLayout::calcMinMaxWidth):
2003-01-29 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3150439 -- navigating to a .xml, then away, then back causes display problems
* khtml/rendering/render_root.h: Add paintBoxDecorations
* khtml/rendering/render_root.cpp: (RenderRoot::paintObject):
Call paintBoxDecorations all the time. Don't consult shouldPaintBackgroundOrBorder(),
and don't waste cycles on !isInline().
(RenderRoot::paintBoxDecorations): If we don't have a RenderHtml as our first child,
then fill with the background color.
* khtml/html/htmlparser.cpp: (KHTMLParser::finished): Remove code that makes an HTML
element for an empty document. We don't need it any more.
2003-01-29 David Hyatt <hyatt@apple.com>
Fix for tables. They weren't initializing their max top/bottom
values for margin collapsing, so their margins were being
ignored!
Reviewed by darin
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_table.cpp:
(RenderTable::layout):
2003-01-29 David Hyatt <hyatt@apple.com>
Back out my removal of the layer optimization. The rest of
the code is not prepared to deal with child elements overriding
visibility, or with invisible layers sitting on top of
visible ones.
* khtml/rendering/render_layer.cpp:
(RenderLayer::constructZTree):
2003-01-28 David Hyatt <hyatt@apple.com>
Fix yet another bug with makeChildrenNonInline that caused the
assertion on 3158194. Rather than trying to work with the
function as it was written by the KHTML guys, I've just thrown
everything out and re-written it using a helper function to make
it more clear what's going on (and less error-prone).
Reviewed by darin
* khtml/rendering/render_flow.cpp:
(getInlineRun):
(RenderFlow::makeChildrenNonInline):
2003-01-29 Darin Adler <darin@apple.com>
* khtml/rendering/break_lines.cpp: (isBreakable): Fix error that prevented this
from compiling. I had failed to build, and then tested the version without my change!
I retested with the change.
2003-01-29 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3158477 -- text break locator leak leads to giant (2.04 GB) VSIZE idling at livepage
* khtml/rendering/break_lines.cpp: (isBreakable): Dispose the text locator.
2003-01-28 David Hyatt <hyatt@apple.com>
Fix quirks/strict regression caused by improper use of findRev (should
be find), and latin1() (can't be invoked on temporaries).
Reviewed by darin
* khtml/html/html_documentimpl.cpp:
(parseDocTypePart):
(HTMLDocumentImpl::determineParseMode):
2003-01-28 David Hyatt <hyatt@apple.com>
Fix for 3155209, dashed-line schmutz left behind when dragging
links.
Also porting a fix from the old table code to the new table code
that I missed.
Reviewed by darin
* khtml/rendering/render_object.cpp:
(RenderObject::setStyle):
* khtml/rendering/render_table.cpp:
(RenderTable::layout):
2003-01-27 David Hyatt <hyatt@apple.com>
New implementation of determineParseMode that is much better
about getting the quirks vs. strict decision right (as compared
to Mozilla and WinIE).
Also made a new inQuirksMode function and converted callers of
parseMode to use it, so that AlmostStrict and Strict modes will
both be treated as non-quirks mode by those who check for this
sort of thing.
Reviewed by darin, mjs
* khtml/html/html_documentimpl.cpp:
(parsePS):
(containsString):
(parseDocTypeDeclaration):
(HTMLDocumentImpl::determineParseMode):
* khtml/html/html_headimpl.cpp:
(HTMLLinkElementImpl::setStyleSheet):
(HTMLStyleElementImpl::childrenChanged):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::attach):
* khtml/html/htmlparser.cpp:
(KHTMLParser::parseToken):
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::parseTag):
* khtml/khtml_part.cpp:
(KHTMLPart::gotoAnchor):
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
* khtml/rendering/render_list.cpp:
(getParentOfFirstLineBox):
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::determineParseMode):
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::createDecl):
* kwq/KWQString.mm:
(QString::compare):
2003-01-28 Darin Adler <darin@apple.com>
Reviewed by Ken and Maciej.
- fixed remaining bit of 3142646 -- JavaScript Error reported at www.hotmail.com after first time
The problem was that forms that were attached, but had no render object yet, were
not in the form names dictionary. This causes trouble for JavaScript that runs before
style sheets load, since the FOUC code makes us not create render objects at that stage.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::attach): Don't check m_render before adding to dictionary.
(HTMLFormElementImpl::parseAttribute): Use attached(), not m_render, to tell whether
to track the name of the form in the dictionary.
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::parseAttribute): Use attached(), not m_render, to tell whether
to track the name of the image in the dictionary.
(HTMLImageElementImpl::attach): Don't check m_render before adding to dictionary.
2003-01-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3157014 - Crash on disabling JavaScript and reloading livepage.apple.com
* khtml/khtml_part.cpp:
(KHTMLPart::openURL): Move check of JavaScript setting and possible disabling from here...
(KHTMLPart::begin): ... to here, to make sure it happens after clearing the interpreter.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::resumeActions): Don't bother to restore timers if JavaScript is off.
2003-01-28 Trey Matteson <trey@apple.com>
3158465 - REGRESSION: cursor turns into I-beam after clicking on most KWQ widgets
When we return from handing a mousedown to an AK widget, we check to see if currentEvent
is now a MouseUp, in which case we hand it to khtml. This allows khtml to keep in
synch as to the state of the mouse. This covers the case of AK widgets that
run their own event loop and consume events until a mouseup (but not ones that use
Carbon, such as PopUpList, since Carbon does not update currentEvent).
Reviewed by Darin.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Pass mouseup to khtml.
2003-01-28 Trey Matteson <trey@apple.com>
2940179 - Arrow cursor should change to link cursor after click of link in non-frontmost window
3158238 - cursor shape does not track after double-click to activate a window
Reviewed by Darin.
* khtml/khtmlview.cpp:
(KHTMLView::viewportMouseDoubleClickEvent): We get this when the mouse
goes up the second time, so clear d->mousePressed.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::mouseMoved): Pitch any mousemoved that comes through while
we think the mouse is down. Those screw up our tracking, like 3137661. This is
part of the 2940179 fix.
2003-01-27 Trey Matteson <trey@apple.com>
3157146 REGRESSION: using a pop-up menu turns the cursor into an I-beam
A hack for the benefit of AK's PopUpButton, which uses the Carbon menu
manager, which thus eats all subsequent events after it is starts its
modal tracking loop. After the interaction is done, we call a new routine
to fix things up in the khtml event world. We post a fake mouse up to balance
the mouse down we started with. In addition, we post a fake mouseMoved to get
the cursor in sync with whatever we happen to be over after the tracking is done.
Reviewed by Darin.
* kwq/KWQComboBox.mm:
(-[KWQPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:]):
Call part after NSPopUp's modal tracking consumes events.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::doFakeMouseUpAfterWidgetTracking): New routine to allow widgets
to get out event state fixed up after a modal tracking loop.
2003-01-27 Chris Blumenberg <cblu@apple.com>
Fixed: 3152053 - Safari: Java 141: Only visible applets are instantiated on web page
Reviewed by dave.
* khtml/rendering/render_applet.cpp:
(RenderApplet::layout): move the widget before calling showApplet
* kwq/KWQKJavaAppletWidget.mm:
(KJavaAppletWidget::showApplet): add the java view to the main view immediately instead of waiting for first paint
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge selectionImage]): tweak
2003-01-26 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3156461 - SECURITY: contentDocument of iframe from other domain can be accessed
- fixed 3156462 - SECURITY: can invoke setTimeout on other window
- fixed 3156469 - SECURITY: can add an event listener on another protected window
- fixed 3156527 - SECURITY: Can access HTML document from different domain in another frame
- fixed 3156535 - SECURITY: Can access XML document from different domain in another frame
These fixes are merged from or inspired by security fixes in upstream khtml.
* khtml/ecma/kjs_dom.h:
* khtml/ecma/kjs_dom.cpp:
(KJS::checkNodeSecurity): Prototype new method used to check whether a document
is allowed to access the contents of a node.
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLElement::getValueProperty): Apply security check to
getting the contentDocument of an iframe or object.
* khtml/ecma/kjs_window.cpp:
(Window::get): Make sure addEventListener/removeEventListener, and
all timer related functions are protocted from cross-domain calls.
(WindowFunc::tryCall): Make sure this is true even if they are
detached from one window and called on another.
* khtml/khtml_part.cpp:
(KHTMLPart::checkEmitLoadEvent): When setting frames to the domain
of the parent document, don't force it, so the usual suffix check
rule will apply.
2003-01-27 Richard Williamson <rjw@apple.com>
Reviewed by trey.
Added ASSERT trap to help track down non-repro crash reported
by 3144546.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::openURLFromPageCache):
Remove assert that caused 3155781. We believe this was happening
because of a delayed release of the page cache after emptying cache
from "Empty Cache" menu item.
* kwq/KWQPageState.mm:
(-[KWQPageState dealloc]):
2003-01-27 David Hyatt <hyatt@apple.com>
Fix text dragging so that text inside floats paints when you
drag the selection.
Reviewed by cblu
* ChangeLog:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paintObject):
(RenderFlow::paintFloats):
* khtml/rendering/render_flow.h:
2003-01-26 David Hyatt <hyatt@apple.com>
Fix the default font size settings for monospace fonts to
really work. It was overaggressive and kicking in when it
shouldn't have, resulting in failures on the CSS1 test suite.
Reviewed by darin, john
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/rendering/font.h:
2003-01-26 Chris Blumenberg <cblu@apple.com>
Fixed: 3156725 - Partially selected links show extra underlining when dragged
Fixed: 3156962 - Text drag image sometimes doesn't include last selected text node
Reviewed by darin.
* khtml/rendering/render_root.cpp:
(RenderRoot::selectionRect): include all nodes that are selected
* khtml/rendering/render_text.cpp:
(TextSlave::paintDecoration): removed stray ";"
(RenderText::paintObject): call paintDecoration with default parameters for "from" and "to" when not painting the selection only
* khtml/rendering/render_text.h:
2003-01-26 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3126431 -- failed assertion `!attached()' at silkair.net
* khtml/rendering/render_image.h: Fix isImage which for some strange reason was
returning false. Not important because no one calls it. Added dispatchLoadEvent
and detach member functions.
* khtml/rendering/render_image.cpp:
(RenderImage::notifyFinished): Instead of dispatching the load or error event
immediately, call dispatchImageLoadEventSoon on the document.
(RenderImage::dispatchLoadEvent): Added. Moved the code to do the actual
event dispatch in here.
(RenderImage::detach): Remove the image from the document in case it has a
pending event that was not delivered yet before calling the base class detach.
* khtml/xml/dom_docimpl.h: Add dispatchImageLoadEventSoon, dispatchImageLoadEventsNow,
removeImage, and an override of timerEvent. Moved APPLE_CHANGES code to a better place.
* khtml/xml/dom_docimpl.cpp: Moved APPLE_CHANGES code to a better place and made these changes:
(DocumentImpl::DocumentImpl): Initialize m_imageLoadEventTimer to 0.
(DocumentImpl::detach): Redo the APPLE_CHANGES to make them easier to read.
Empty out the m_imageLoadEventDispatchSoonList and the m_imageLoadEventDispatchingList
to avoid an O(n^2) operation as we detach each image and remove it from the list.
(DocumentImpl::dispatchImageLoadEventSoon): Added. Adds image to list and sets up timer.
(DocumentImpl::removeImage): Added. Removes image from lists, and cancels timer if needed.
(DocumentImpl::dispatchImageLoadEventsNow): Added. Copies list, and call images to dispatch load events.
(DocumentImpl::timerEvent): Added. Calls dispatchImageLoadEventsNow.
* khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::close):
Dispatch all pending image load events before dispatching the document load.
* force-clean-timestamp: Force rebuild because Project Builder doesn't do
header dependencies well enough to deal with changes to the document class.
2003-01-26 David Hyatt <hyatt@apple.com>
Fix :active to behave just like :hover. It was being
restricted and only allowed to match <a> tags, when :active
should be applicable to any element (e.g., like images).
Fixes the :active feedback on numerous blog sites (e.g.,
the photo image buttons on joehewitt.com).
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
2003-01-25 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3126211 -- "go back" buttons that use "history.go(-1)" doesn't work (verizonwireless.com is an example)
- fixed 2950618 -- JavaScript window.history object name prints blank
* khtml/ecma/kjs_window.cpp:
(FrameArray::toString): Added. Returns "[object FrameArray]".
(History::getValueProperty): Removed #if APPLE_CHANGES to turn more code on.
(History::toString): Added. Returns "[object History]".
* kwq/KWQKPartsBrowserExtension.h: Make browserInterface a pure virtual function
instead of always returning 0.
* kwq/KWQKHTMLPartBrowserExtension.h: Added browserInterface() function.
Also replaced m_part with a _part that is a KWQKHTMLPart to simplify code.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::KHTMLPartBrowserExtension): Create the browser
interface object when the browser extension object is created.
(KHTMLPartBrowserExtension::openURLRequest): Use _part instead of KWQ(m_part).
(KHTMLPartBrowserExtension::createNewWindow): Use _part instead of KWQ(m_part).
(KHTMLPartBrowserExtension::setIconURL): Use _part instead of KWQ(m_part).
(KHTMLPartBrowserExtension::setTypedIconURL): Use _part instead of KWQ(m_part).
* kwq/KWQKPartsBrowserInterface.h: Add a constructor, property() function, and
_part data member.
* kwq/KWQKPartsBrowserInterface.mm:
(BrowserInterface::property): Added. Handles historyLength property by calling
the historyLength method on the bridge.
(BrowserInterface::callMethod): Handles goHistory(int) by calling the
goBackOrForward: method on the bridge.
* kwq/WebCoreBridge.h: Added historyLength and goBackOrForward: methods.
* kwq/KWQVariant.h: Added Int to the variant enum, added int and uint contructors,
and added toInt() member function.
* kwq/KWQVariant.mm:
(QVariant::QVariant): Implemented int and uint constructors.
(QVariant::toBool): Added Int case, sorted alphabetically.
(QVariant::toInt): Added.
(QVariant::toUInt): Added Int case, sorted alphabetically.
(QVariant::asString): Added Int case, sorted alphabetically.
2003-01-25 Chris Blumenberg <cblu@apple.com>
Fixed: 3153605 - Drag image when dragging text should be the actual text
Reviewed by darin.
* khtml/rendering/font.cpp:
(Font::drawLineForText): take a "from" and "to" so only selected portions of text draw lines
* khtml/rendering/font.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint): handle the selection-only case
* khtml/rendering/render_layer.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::selectionRect): new, computes bounding box of the selection
* khtml/rendering/render_root.h:
* khtml/rendering/render_text.cpp:
(TextSlave::paintDecoration): take a "from" and "to" so only selected portions of text draw lines
(RenderText::paintObject): when only drawing the selection, only draw selected text and no selection background
(RenderText::paint): handle the selection-only case
* khtml/rendering/render_text.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::paint): handle the selection-only case
(KWQKHTMLPart::selectionRect): new, returns the bounding box of the selection
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::drawLineForText): take a "from" and "to" so only selected portions of text draw lines
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge drawRect:withPainter:]): handle the selection-only case
(-[WebCoreBridge selectionRect]): new, returns the bounding box of the selection clipped to visible
(-[WebCoreBridge selectionImage]): new, returns the image of the selection
2003-01-24 David Hyatt <hyatt@apple.com>
Fix for 3153260, tables used as height spacers don't get the
specified height.
Reviewed by rjw
* khtml/rendering/render_table.cpp:
(RenderTableSection::layoutRows):
2003-01-24 Trey Matteson <trey@apple.com>
Chris pointed out a FIXME that led to a more contained way to make sure the cursor
is correct during and after image/text/URL dragging.
Reviewed by Chris.
* kwq/KWQKHTMLPart.h: Back out just-added resetCursor method.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMouseMoveEvent): Reset cursor to arrow when image drag starts.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm: Back out just-added resetCursor method, which is no
longer needed by WebKit.
2003-01-24 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3058229 -- two failures in DOM test page for HTMLSelectElement
- fixed 3138938 -- choose another member name on .Mac signup not working as expected
- fixed 3155763 -- Safari autoselects first item in a WOBrowser/<select>
* khtml/html/html_formimpl.cpp:
(HTMLSelectElementImpl::value): Return "" rather than null when nothing is selected.
(HTMLSelectElementImpl::recalcListItems): Don't automatically select a first item
in the single selection case.
2003-01-24 David Hyatt <hyatt@apple.com>
Fix for 3146066, messed up lists on dictionary.com. Make
sure that a marker in an anonymous box with no other line box
parent available just stays where it is, rather than removing
itself from the anonymous box (causing that box to be deleted
and recreated ad infinitum).
Reviewed by darin
* khtml/rendering/render_list.cpp:
(RenderListItem::updateMarkerLocation):
2003-01-24 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3142852 -- frame content repeatedly requested
The bug was that JavaScript document.referrer was totally wrong.
* khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::referrer):
Use the new incomingReferrer() rather than referrer(), because referrer()
is the referrer to use for new loads in the part, not the one that was
used to load the document.
* kwq/KWQKHTMLPart.h: Added incomingReferrer(). Also removed referrer()
which has been totally redundant since we made KWQKHTMLPart a subclass of KHTMLPart.
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::incomingReferrer): Added. Uses the bridge.
* kwq/WebCoreBridge.h: Added incomingReferrer.
2003-01-24 Trey Matteson <trey@apple.com>
3155162 - cursor changes to I-beam after dragging image
3154468 - no mouseup event comes through after text snippet drag
Export a means to reset the cursor to WebKit, which is used to fix these bugs.
Reviewed by Darin.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::resetCursor): New method that just calls through to khtmlview's
private resetCursor method.
* kwq/WebCoreBridge.h: Add new method.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge resetCursor]): Call view's reset cursor.
2003-01-23 Trey Matteson <trey@apple.com>
I ran our KURL tests and found that my previous fix for "localhost" urls, fixed too much.
This now passes all the tests.
Reviewed by Darin.
* kwq/KWQKURL.mm:
(KURL::parse): Use different logic for deciding to add //authority to the URL
and stripping localhost off of file URLs.
2003-01-24 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed null view and hang part of 3153612 -- REGRESSION: null view and hang loading cycleworld.com
* khtml/xml/xml_tokenizer.cpp: (XMLHandler::XMLHandler): Initialize the line number
to 0 so we can detect the case where we didn't get a fatal error callback.
(XMLTokenizer::finish): Construct an error page without an XML excerpt if the line
number if 0.
2003-01-24 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3140945 -- crash viewing www.nextthing.org
* khtml/rendering/render_container.cpp: (RenderContainer::removeLeftoverAnonymousBoxes):
Change this function so it will never remove a table cell. Although a table cell that is
created automatically is anonymous, it is not an anonymous box in the sense that this
function is trying to deal with. Maybe there will be a better way to fix this some day,
but this is the best Dave and I could come up with.
- fixed 3155700 -- nil-dereference in khtml::RenderTableRow::detach shortly after visiting www.alltheweb.com
* khtml/rendering/render_table.cpp: (RenderTableRow::detach):
Check for nil before calling setNeedCellRecalc in case we are being detached after our
parent is already nil.
2003-01-23 Richard Williamson <rjw@apple.com>
Fix for 3152494. Set the default iframe width to 300 and
height to 150. This copies the behavior of mozilla and IE.
Reviewed by hyatt.
* khtml/css/html4.css:
2003-01-23 Richard Williamson <rjw@apple.com>
Fixed whitespace exclusion code. Fixes many sites
that have problems that were exposed after
fixing 3119777.
Reviewed by hyatt.
* khtml/rendering/bidi.cpp:
(RenderFlow::bidiReorderLine):
(RenderFlow::findNextLineBreak):
* khtml/rendering/break_lines.cpp:
* khtml/rendering/render_text.cpp:
(RenderText::calcMinMaxWidth):
2003-01-23 David Hyatt <hyatt@apple.com>
Dump textslaves in the regression tests.
Reviewed by rjw.
* kwq/KWQRenderTreeDebug.cpp:
(operator<<):
(write):
2003-01-23 David Hyatt <hyatt@apple.com>
Fix for 3144763, inlines clear too many floats, and jump all the
way to the end of the lowest float instead of only moving as far
down as they have to in order to fit.
Reviewed by darin
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
* khtml/rendering/render_flow.cpp:
(RenderFlow::nearestFloatBottom):
* khtml/rendering/render_flow.h:
2003-01-23 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3144560 -- non-reproducible nil-dereference in HTMLFrameElementImpl::updateForNewURL at macfixit
* khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::updateForNewURL): Add check for nil view.
2003-01-23 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3154647 -- Triple clicked on a line of text (to select entire line), crashola
* khtml/khtml_part.cpp:
(firstSlaveAt): Loop instead of using recursion for siblings.
(lastSlaveAt): Ditto, only backwards.
2003-01-23 David Hyatt <hyatt@apple.com>
Fix for 3142124.
When pseudo-elements have display:none, they should not generate
rendering objects.
Reviewed by rjw, kocienda.
* khtml/rendering/render_container.cpp:
(RenderContainer::insertPseudoChild):
2003-01-23 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3129556 -- can't search on japanese string at yahoo.co.jp
The key to fixing this was to look up character sets in a way that does not
pay attention to punctuation. Only alphanumeric characters count. Also did
a little belt tightening and speeding up while I was at it.
* kwq/KWQCharsets.h: Use const char * instead of CFStringRef.
* kwq/KWQCharsets.mm:
(buildDictionaries): Store const char * in the dictionaries instead of CFStringRef,
and use the key compare and hash functions that obey only alphanumeric characters.
(KWQCFStringEncodingFromIANACharsetName): Use const char * directly.
(KWQCFStringEncodingFromMIB): Tweak code a bit.
(KWQCFStringEncodingToIANACharsetName): Use const char * directly.
(KWQCFStringEncodingToMIB): Tweak code a bit.
(encodingNamesEqual): Added. Compares two names, ignoring non-alphanumeric characters.
(encodingNameHash): Added.
* kwq/KWQKCharsets.h: Take a const char * instead of a QString. Also overload for QCString.
This fixes conversion back and forth from QString that was happening before.
* kwq/KWQKCharsets.mm: (KCharsets::codecForName): Update for above parameter change.
* kwq/KWQTextCodec.mm:
(codecForCFStringEncoding): Add check for kCFStringEncodingInvalidId.
(QTextCodec::codecForMib): Simplify because of above check.
(QTextCodec::codecForName): Simplify because we don't need to make a CFStringRef, and
because of above check.
(QTextCodec::name): No need to convert the CFStringRef back to a const char * now.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge textEncoding]): Convert character set name to a const char * to pass in.
(+[WebCoreBridge stringWithData:textEncodingName:]): Ditto.
* kwq/WebCoreEncodings.mm:
(+[WebCoreEncodings charsetNameForEncoding:]): Convert character set name to an NSString
to use as a return value.
(+[WebCoreEncodings encodingForCharsetName:]): Convert character set name to a const char *
to pass in.
2003-01-23 Chris Blumenberg <cblu@apple.com>
Fixed a divide by zero problem.
Reviewed by darin.
* WebCore.pbproj/project.pbxproj:
* khtml/rendering/render_image.cpp:
(RenderImage::calcReplacedWidth):
(RenderImage::calcReplacedHeight):
2003-01-23 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed last minute screwup in my last patch fixing onchange
* kwq/KWQTextField.mm:
(-[KWQTextField fieldEditorWillBecomeFirstResponder]): Renamed
from fieldWillBecomeFirstResponder.
(-[KWQTextField fieldEditorWillResignFirstResponder]): Renamed
from fieldWillResignFirstResponder.
2003-01-23 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3151442 - mac.com homepage editing - selection and clicking with mouse don't work
* khtml/ecma/kjs_events.cpp:
(JSEventListener::handleEvent): Only allow a false return value to
prevent default if this is an html event handler, rather than one
set with addEventListener or the like.
2003-01-23 Chris Blumenberg <cblu@apple.com>
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.
Reviewed by dave.
* khtml/rendering/render_box.cpp:
(RenderBox::paint):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::paint):
(RenderFlow::paintObject):
(RenderFlow::paintFloats):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_html.cpp:
(RenderHtml::paint):
* khtml/rendering/render_html.h:
* khtml/rendering/render_image.cpp:
(RenderImage::paintObject):
* khtml/rendering/render_image.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
* khtml/rendering/render_list.cpp:
(RenderListItem::paint):
(RenderListItem::paintObject):
(RenderListMarker::paint):
(RenderListMarker::paintObject):
* khtml/rendering/render_list.h:
* khtml/rendering/render_object.cpp:
(RenderObject::paint):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderReplaced::paint):
(RenderWidget::paintObject):
* khtml/rendering/render_replaced.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::paint):
(RenderRoot::paintObject):
* khtml/rendering/render_root.h:
* khtml/rendering/render_table.cpp:
(RenderTable::paint):
(RenderTableSection::paint):
(RenderTableCell::paint):
* khtml/rendering/render_table.h:
* khtml/rendering/render_text.cpp:
(RenderText::paintObject):
(RenderText::paint):
* khtml/rendering/render_text.h:
2003-01-23 David Hyatt <hyatt@apple.com>
Fix for 3147995, empty <li> tags don't render bullets.
Reviewed by john.
* khtml/rendering/render_list.cpp:
(RenderListItem::layout):
* khtml/rendering/render_list.h:
2003-01-23 David Hyatt <hyatt@apple.com>
Fix for 3134613, bullets overlapping text on weather.com. Make
sure min/max widths get updated when the marker moves around.
Reviewed by john
* khtml/rendering/render_list.cpp:
(RenderListItem::updateMarkerLocation):
(RenderListItem::calcMinMaxWidth):
(RenderListItem::layout):
* khtml/rendering/render_list.h:
=== Safari-54 ===
2003-01-23 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3154575 -- REGRESSION: Right sidebar on Yahoo! page in base PLT renders incorrectly
* khtml/rendering/break_lines.cpp: (isBreakable): Pass kUCTextBreakLineMask to the
UC calls, which looks for places where line breaks are allowed, instead of kUCTextBreakWordMask,
which finds all word breaks instead. We still pass all the layout tests, so I think this means
Japanese word breaking is still OK.
- fixed 3154416 -- images that specify width but not height should keep aspect ratio (example at thegods.org.uk)
* khtml/rendering/render_image.h: Declared new member functions.
* khtml/rendering/render_image.cpp:
(RenderImage::widthSpecified): Added helper function.
(RenderImage::heightSpecified): Added helper function.
(RenderImage::calcReplacedWidth): Added. Derives width from height keeping aspect ratio if we
have a specified height and no width.
(RenderImage::calcReplacedHeight): Added. Same thing in the opposite direction.
2003-01-22 Trey Matteson <trey@apple.com>
3153313 cursor changes during text selection when we cross links
Reviewed by Dave.
* khtml/khtmlview.cpp:
(KHTMLView::viewportMousePressEvent): Remember mouse is down.
(KHTMLView::viewportMouseMoveEvent): Use ibeam while mouse down.
(KHTMLView::viewportMouseReleaseEvent): Remember that it's up.
2003-01-22 David Hyatt <hyatt@apple.com>
Fix first-line regression caused by my removal of a local variable.
Reviewed by mjs
* khtml/css/cssstyleselector.cpp:
2003-01-22 Richard Williamson <rjw@apple.com>
Fix the fix to 3119777 to scan for break over entire string
instead of trying to optimize.
Reviewed by hyatt.
* khtml/rendering/break_lines.cpp:
Pass offset into entire string, rather than try to optimize
by passing a shorter string.
2003-01-22 David Hyatt <hyatt@apple.com>
Fix the CSS parser so that it disallows class names beginning
with a digit even in quirks mode.
Reviewed by rjw
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseSelector2):
2003-01-22 Richard Williamson <rjw@apple.com>
Fix 3119777 (and a host of other international bugs). Word break
was broken. Use unicode services to detect work breaks
for non basic latin1. We may want to go further and
always use unicode services so we get correct hyphenation
breaking.
Reviewed by hyatt.
* khtml/rendering/break_lines.cpp:
2003-01-22 David Hyatt <hyatt@apple.com>
Fix word-spacing bugs in text measurement calculations. This
fixes our issues on the CSS1 test suite. Regression tests have
been added for both positive and negative word-spacing.
Reviewed by rjw
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
* khtml/rendering/render_text.cpp:
(RenderText::calcMinMaxWidth):
(RenderText::containsOnlyWhitespace):
* khtml/rendering/render_text.h:
2003-01-22 Chris Blumenberg <cblu@apple.com>
Fixed: 3153969 - Should not be able drag text while double or triple-click selecting it
Fixed: 3154153 - Can drag an empty selection
Reviewed by rjw.
* khtml/khtml_part.cpp:
(KHTMLPart::isPointInsideSelection): consider an empty selection like no selection
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMouseMoveEvent): don't allow dragging after selection has started using double or triple click
2003-01-22 David Hyatt <hyatt@apple.com>
Fix absolute positioning problem for bottom-positioned elements.
This is a fix from the KHTML trunk.
Reviewed by john
* khtml/rendering/render_box.cpp:
(RenderBox::calcAbsoluteVertical):
2003-01-22 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3141566 -- non-reproducible nil-dereference in HTMLGenericFormElementImpl at firstdirect.com
* khtml/html/html_formimpl.cpp: (HTMLGenericFormElementImpl::defaultEventHandler):
Check for the case where the view is 0.
2003-01-22 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed two-day-old regression where we get nil-dereferences with text areas
* kwq/KWQTextArea.mm:
(-[KWQTextArea _createTextView]): Don't do the setWidget: here because widget is always nil at this point.
(-[KWQTextArea initWithQTextEdit:]): Do it here instead.
2003-01-22 David Hyatt <hyatt@apple.com>
Fix for 3126927, don't let absolute positioned blocks grow
to accommodate content. They overflow instead.
Reviewed by mjs
* khtml/rendering/render_box.cpp:
(RenderBox::calcAbsoluteVertical):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_object.h:
2003-01-22 David Hyatt <hyatt@apple.com>
Fix for 3153316, selection busted on google.com. For now keep
mouse events grabbing the absolutePosition of elements, and don't
ever let them grab the absolutePosition of text nodes.
Reviewed by john.
* khtml/khtml_events.cpp:
(khtml::MouseEvent::MouseEvent):
2003-01-22 Chris Blumenberg <cblu@apple.com>
Renamed isPointSelected to isPointInsideSelection because it's a better name.
Reviewed by darin.
* khtml/khtml_part.cpp:
(KHTMLPart::isPointInsideSelection):
(KHTMLPart::khtmlMousePressEvent):
* khtml/khtml_part.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge elementAtPoint:]):
2003-01-21 Chris Blumenberg <cblu@apple.com>
Added support for text dragging.
Reviewed by dave.
* khtml/khtml_events.cpp:
(khtml::MouseEvent::offset): made checkSelectionPoint take x,y coords, passing the whole event is unnecessary
* khtml/khtml_part.cpp:
(KHTMLPart::isPointSelected): new
(KHTMLPart::khtmlMousePressEvent): don't restart the selection when click was on the selection
(KHTMLPart::khtmlMouseMoveEvent): restart the selection since we may not do it in khtmlMousePressEvent
(KHTMLPart::khtmlMouseReleaseEvent): clear the selection if no selection took place
* khtml/khtml_part.h:
* khtml/khtmlpart_p.h:
* khtml/rendering/render_object.cpp:
(RenderObject::checkSelectionPoint): made checkSelectionPoint take x,y coords, passing the whole event is unnecessary
* khtml/rendering/render_object.h:
* khtml/rendering/render_text.cpp:
(RenderText::checkSelectionPoint): made checkSelectionPoint take x,y coords, passing the whole event is unnecessary
* khtml/rendering/render_text.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMousePressEvent): set booleans indicating that it is OK to drag or select
(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.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge elementAtPoint:]): set the selection bit
2003-01-21 Trey Matteson <trey@apple.com>
3032718 - I-beam cursor behavior different between web view and text view
Now that the innerNode is the real text element instead of an enclosing
tag element, it's a piece of cake to test for a text node and set the ibeam cursor.
Reviewed by Chris
* khtml/khtmlview.cpp:
(KHTMLView::viewportMouseMoveEvent): Set iBeam if over text.
* kwq/KWQKCursor.mm:
(KCursor::ibeamCursor): Make this cursor have the Cocoa ibeam instead of arrow.
2003-01-21 David Hyatt <hyatt@apple.com>
Fix selection so that it will go up to the parent node
if the innerNode is text, preserving the old behavior for
now until we can rewrite selection to not require this.
Reviewed by cblu.
* khtml/khtml_events.cpp:
(khtml::MouseEvent::offset):
* khtml/khtml_part.cpp:
(KHTMLPart::khtmlMousePressEvent):
(KHTMLPart::khtmlMouseMoveEvent):
2003-01-21 Trey Matteson <trey@apple.com>
3121681 - "localhost" part of link is lost with relative links
Was broken for abs links with localhost too. Solution is to tighten up the test
for "localhost" removal to only apply to file urls.
canonical result.
Reviewed by Maciej.
* kwq/KWQKURL.mm:
(KURL::parse): Allow the authority processing even for links with
localhost. Only cut out the addition of host for locahost file links.
2003-01-21 David Hyatt <hyatt@apple.com>
Fix nodeAtPoint to return text nodes if the mouse is over them.
Make :active fully hierarchical so that e.g., <a><b>Foo</b></a>
gets an outline when clicked.
Reviewed by trey
* khtml/rendering/render_object.cpp:
(RenderObject::setHoverAndActive):
* khtml/rendering/render_text.cpp:
(RenderText::nodeAtPoint):
2003-01-21 David Hyatt <hyatt@apple.com>
Fix for regressions on layout-tests caused by new table code.
Make sure cell's padding is used and not just the table's cellpadding.
Also make sure cell padding can be changed dynamically.
Reviewed by darin.
* khtml/rendering/table_layout.cpp:
(AutoTableLayout::recalcColumn):
2003-01-21 Darin Adler <darin@apple.com>
- correct our copyrights to 2003; copyright is based on year of publication, not year worked on
2003-01-21 David Hyatt <hyatt@apple.com>
Fix for the 2.5% perf regression from the descendant rules
changes. This patch does 3 things:
(1) Fix the descendant rule check in the CSS parser. It
was incorrect.
(2) Fix DOM insertion/removal from setting the parent as needing
a style re-resolve.
(3) Fix whitespace inside <html> so that it doesn't make a premature
<body>.
Reviewed by mjs
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseSelector):
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::recalcStyle):
* khtml/xml/dom_nodeimpl.cpp:
(NodeBaseImpl::insertBefore):
(NodeBaseImpl::replaceChild):
(NodeBaseImpl::removeChild):
(NodeBaseImpl::appendChild):
2003-01-21 Darin Adler <darin@apple.com>
Reviewed by Richard.
- clean room rewrite of QCString
* kwq/KWQCString.mm: Replaced functions that needed rewrite.
2003-01-21 Richard Williamson <rjw@apple.com>
Added support to pause and resume javascript timers. This allows pages
that have javascript timers to be added to the page cache.
Fixes 3126138.
Reviewed by trey and maciej.
* khtml/ecma/kjs_window.cpp:
(Window::pauseTimeouts):
(Window::resumeTimeouts):
(WindowQObject::pauseTimeouts):
(WindowQObject::resumeTimeouts):
(WindowQObject::timerEvent):
* khtml/ecma/kjs_window.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::pauseActions):
(KWQKHTMLPart::resumeActions):
(KWQKHTMLPart::canCachePage):
(KWQKHTMLPart::openURLFromPageCache):
* kwq/KWQObject.h:
* kwq/KWQObject.mm:
(QObject::pauseTimer):
(QObject::_addTimer):
(QObject::clearPausedTimers):
(QObject::resumeTimers):
(QObject::startTimer):
* kwq/KWQPageState.h:
* kwq/KWQPageState.mm:
(-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
(-[KWQPageState setPausedActions:int::]):
(-[KWQPageState int::]):
(-[KWQPageState _cleanupPausedActions]):
(-[KWQPageState invalidate]):
(-[KWQPageState dealloc]):
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]):
(-[WebCoreBridge saveDocumentToPageCache]):
2003-01-21 Darin Adler <darin@apple.com>
* khtml/xml/dom_nodeimpl.cpp: (NodeImpl::createRenderer):
Add return statements to fix compile on deployment build.
2003-01-21 Darin Adler <darin@apple.com>
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::rendererIsNeeded):
(HTMLInputElementImpl::attach):
Add return statements to fix compile on deployment build.
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Nobody, fixing an accidental commit.
* khtml/khtml_part.cpp:
* khtml/html/html_documentimpl.cpp:
* khtml/xml/dom_docimpl.h:
2003-01-21 Darin Adler <darin@apple.com>
Everything else reviewed by Maciej, dtd.cpp and htmlparser.cpp changes reviewed by Dave.
- fixed 3151098 -- REGRESSION: Frequent assert about renderer in DOM code
* khtml/html/dtd.cpp: (DOM::checkChild): Disallow text inside colgroup so it can be handled as a special case
inside the parser.
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode): Discard text inside colgroup and don't pop the colgroup.
- fixed 3149792 -- memory trasher at robinlionheart.com
- fixed 3150664 -- failed assertion in HTMLFrameSetElementImpl::attach on page with frameset inside frameset
The key to fixing the 3149792 memory trasher was to avoid constructing trees where there
is a render object nested inside an object that is not a suitable container. In particular,
the code assumed that RenderFlow objects would only be inside other RenderFlow objects, and
this does not happen if you have an <object> that is an image, with objects inside it that
are intended to be used if the image fails to load.
The key to fixing the 3150664 assertion was to handle the case where a frame set's parent
didn't have a renderer, rather than just asserting about it.
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout): Added an assertion and a FIXME from Dave's and my review of this code.
(RenderFlow::splitInlines): Add assertions that we have actual RenderFlow objects. Casting
non-RenderFlow objects was the cause of the memory trashing. The other parts of this change
assure we never hit these assertions by not creating any render objects for DOM objects
that are inside non-RenderFlow.
(RenderFlow::addChildWithContinuation): Add a similar assertion here.
* khtml/rendering/render_object.h: Declare new member function.
* khtml/rendering/render_object.cpp: (RenderObject::canHaveChildren): Return false.
* khtml/rendering/render_container.h: Declare new member function.
* khtml/rendering/render_container.cpp: (RenderContainer::canHaveChildren): Return true.
* khtml/rendering/render_replaced.h: Declare new member function.
* khtml/rendering/render_replaced.cpp: (RenderReplaced::canHaveChildren): Return false.
* khtml/xml/dom_nodeimpl.h: Declare new member functions.
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::createRendererIfNeeded): Added. Checks to see if a renderer should be created,
and creates it if so. The bug fix is checking canHaveChildren() here. This also reduces
the amount of repeated code in various attach() methods.
(NodeImpl::styleForRenderer): Added. Default is parent style.
(NodeImpl::rendererIsNeeded): Added. Default is to create only if display is not none.
(NodeImpl::createRenderer): Added. Must never reach this function, but I didn't make it a pure
virtual because of subclasses like AttrImpl that don't ever call createRendererIfNeeded.
Could rethink this and improve it even more.
* khtml/xml/dom_elementimpl.h: Declare new member functions.
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::styleForRenderer): Override to get the style from the style selector rather
than from the parent renderer.
(ElementImpl::createRenderer): Call RenderObject::createObject to create the right type of renderer.
(ElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_baseimpl.h: Declare new member functions.
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::createRenderer): Create a RenderBody.
(HTMLBodyElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLFrameElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLFrameElementImpl::createRenderer): Create a RenderFrame.
(HTMLFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLFrameSetElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLFrameSetElementImpl::createRenderer): Create a RenderFrameSet.
(HTMLFrameSetElementImpl::attach): Call createRendererIfNeeded to do most of the work.
This fixes a bug where the parent doesn't have a renderer; we were asserting in
that case rather than just not creating a renderer ourselves, which was wrong.
(HTMLHtmlElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLHtmlElementImpl::createRenderer): Create a RenderHtml.
(HTMLHtmlElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLIFrameElementImpl::createRenderer): Create a RenderPartObject.
(HTMLIFrameElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_formimpl.h: Declare new member functions.
* khtml/html/html_formimpl.cpp:
(HTMLGenericFormElementImpl::attach): Remove now-unneeded code that is handled by
createRendererIfNeeded now.
(HTMLInputElementImpl::rendererIsNeeded): Return false for HIDDEN, otherwise call base.
(HTMLInputElementImpl::createRenderer): Create the appropriate type of RenderObject.
(HTMLInputElementImpl::attach): Call createRendererIfNeeded to do most of the work.
Determined that we don't need the special case for image buttons any more.
(HTMLSelectElementImpl::createRenderer): Create a RenderSelect.
(HTMLSelectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLTextAreaElementImpl::createRenderer): Create a RenderTextArea.
(HTMLTextAreaElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_imageimpl.h: Declare new member function.
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::createRenderer): Create a RenderImage.
(HTMLImageElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_inlineimpl.h: Declare new member function.
* khtml/html/html_inlineimpl.cpp:
(HTMLBRElementImpl::createRenderer): Create a RenderBR.
(HTMLBRElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/html/html_objectimpl.h: Declare new member functions.
* khtml/html/html_objectimpl.cpp:
(HTMLAppletElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLAppletElementImpl::createRenderer): Create either a RenderApplet or RenderEmptyApplet.
(HTMLAppletElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLEmbedElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLEmbedElementImpl::createRenderer): Create a RenderPartObject.
(HTMLEmbedElementImpl::attach): Call createRendererIfNeeded to do most of the work.
(HTMLObjectElementImpl::rendererIsNeeded): Override to implement the different policy
this element uses to decide whether to make a renderer (same as old code).
(HTMLObjectElementImpl::createRenderer): Create either a RenderImage or a RenderPartObject.
(HTMLObjectElementImpl::attach): Call createRendererIfNeeded to do most of the work.
* khtml/xml/dom_textimpl.h: Declare new member functions.
* khtml/xml/dom_textimpl.cpp:
(TextImpl::rendererIsNeeded): Moved logic about not making renderers for only-whitespace
elements here. Left out the special case for textarea, since the fact that RenderReplaced
returns false from the canHaveChildren function now takes care of that of that case.
(TextImpl::createRenderer): Create a RenderText.
(TextImpl::attach): Call createRendererIfNeeded to do most of the work.
- fixed a buffer overrun that libgmalloc detected
* khtml/misc/decoder.cpp:
(KanjiCode::judge): Pass in a size parameter instead of using strlen.
(Decoder::decode): Pass in a size parameter.
- a little housekeeping
* WebCore.pbproj/project.pbxproj: Remove a bunch of the .moc files
from the project. I'm not sure why I put them in originally, but they
do no good in there.
* khtml/khtmlview.moc: Empty out this file.
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3145317 - Unable to add or remove menu items on Site Menu page using Safari Beta
This turned out to be a problem with event.layerX / event.layerY.
* khtml/xml/dom2_eventsimpl.cpp:
(MouseEventImpl::computeLayerPos): Since layer position is
relative to parent layer, go up the layer tree adjusting for layer
offset to compute true layer position.
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- fixed 3151982 - missing content at debka.com after iframe is written using document.write
- fixed 3000234 - javascript problem writing iframe at cycleworld.com
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::scriptHandler): If we come out of the script with
the parser in skip mode, don't throw away the whole rest of the
document - instead, parse it as usual. The parser's skip mode will
take care of skipping stuff as needed and will detect close tags
for special tags like <iframe>.
2003-01-20 David Hyatt <hyatt@apple.com>
Fix :hover performance regression on wsj.com. Moving my
<a name="foo"> quirk down into the :hover rule matching code,
so that we'll know never to apply :hover to anchorless <a>s.
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_object.cpp:
(RenderObject::setHoverAndActive):
2003-01-20 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey.
- fixed 3132120 - onchange handler not firing on mac.com webmail
* khtml/rendering/render_form.h:
* khtml/rendering/render_replaced.cpp:
(RenderWidget::handleFocusOut): Moved empty virtual method here from render_form.
(RenderWidget::eventFilter): Uncomment call to handleFocusOut - we
need it to send onChange properly.
* khtml/rendering/render_replaced.h:
* kwq/KWQObject.h: Add empty eventFilter virtual method.
* kwq/KWQComboBox.h: Remove no longer needed empty eventFilter.
* kwq/KWQEvent.h: Implement a bit more of QFocusEvent.
* kwq/KWQTextArea.mm:
(-[KWQTextArea _createTextView]): Tell the text view its widget.
(-[KWQTextAreaTextView setWidget:]): New method to set widget.
(-[KWQTextAreaTextView becomeFirstResponder]): In addition to the usual stuff,
call the widget's event filter with a focus in event.
(-[KWQTextAreaTextView resignFirstResponder]): In addition to the usual stuff,
call the widget's event filter with a focus out event.
* kwq/KWQTextField.mm:
(-[KWQTextField becomeFirstResponder]): Cleaned up a bit.
(-[KWQTextField fieldWillBecomeFirstResponder]): Call the widget's event filter with a focus in event.
(-[KWQTextField fieldWillResignFirstResponder]): Call the widget's event filter with a focus out event.
* kwq/KWQView.mm:
2003-01-20 David Hyatt <hyatt@apple.com>
Fix for 3147213. <nobr> is treated like other inlines now,
so it can contain blocks. <wbr> is also fixed. This fixes
tvguide.com.
Reviewed by john
* khtml/html/dtd.cpp:
(DOM::checkChild):
2003-01-20 David Hyatt <hyatt@apple.com>
Gah. Fix positioned objects and floating objects so that they
don't append themselves to the list of runs in normal flow.
An astoundingly basic bug. :(
Reviewed by john
* khtml/rendering/bidi.cpp:
(appendRunsForObject):
* khtml/rendering/render_flow.cpp:
(RenderFlow::addChildToFlow):
2003-01-19 David Hyatt <hyatt@apple.com>
Fixes for 3150561 (blog articles vanish on stylesheet switch) and
and 3150560 (crash changing fixed positioned element to normal
positioning dynamically).
This change makes layers able to deal with dynamic changes in
position that cause you to have to either remove a layer from
the hierarchy while preserving the children or to insert a
layer into the hierarchy in between a parent and its descendants.
This patch also rewrites :hover/:active so that they can actually
be used in selectors other than the rightmost selector (e.g., so you
can write a rule like "li:hover > a").
Also, layers will now properly clear out their hover/active state
when the mouse is no longer inside them.
With these fixes, Eric Meyer's "Pure CSS Menus" work (perfectly)
and the repainting problems on sites like brainjar.com and
diveintomark.org and wired.com are fixed.
Reviewed by mjs and john.
* khtml/css/css_stylesheetimpl.h:
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseSelector):
* khtml/css/cssparser.h:
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/dom/html_head.cpp:
(HTMLLinkElement::setDisabled):
* khtml/rendering/render_box.cpp:
(RenderBox::setStyle):
* khtml/rendering/render_box.h:
* khtml/rendering/render_container.cpp:
(RenderContainer::appendChildNode):
(RenderContainer::insertChildNode):
* khtml/rendering/render_flow.cpp:
(RenderFlow::setStyle):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::addChild):
(RenderLayer::removeOnlyThisLayer):
(RenderLayer::insertOnlyThisLayer):
(RenderLayer::clearOtherLayersHoverActiveState):
(RenderLayer::clearHoverAndActiveState):
(RenderLayer::nodeAtPoint):
(RenderLayer::constructZTree):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.cpp:
(RenderObject::addLayers):
(RenderObject::moveLayers):
(RenderObject::findNextLayer):
(RenderObject::setStyle):
(RenderObject::setHoverAndActive):
* khtml/rendering/render_object.h:
* khtml/rendering/render_style.cpp:
(RenderStyle::diff):
* khtml/rendering/render_style.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_elementimpl.cpp:
(ElementImpl::recalcStyle):
* khtml/xml/dom_nodeimpl.cpp:
(NodeBaseImpl::setActive):
2003-01-17 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3149511 - Blogger.com window closes after update is posted
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall): For now, don't allow closing the window at
all if it wasn't opened by JavaScript, since we don't support the
history object and so can't tell if the window has only one
history item.
2003-01-17 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed the crashing so the layout tests work
* khtml/rendering/render_layer.h: Add a node pointer result.
* khtml/rendering/render_layer.cpp: (RenderLayer::elementList):
Return the node pointer so we can destroy it when done with it.
* khtml/rendering/render_object.h: Make renderArena() const.
* khtml/rendering/render_object.cpp: (RenderObject::renderArena): Make it const.
* kwq/KWQRenderTreeDebug.cpp: (writeLayers): Free the Z layer list when done.
Without this things just crashed.
2003-01-17 Richard Williamson <rjw@apple.com>
Fixed 3126141. Allow pages with plugins to be cached. This is safe
because plugins are cleanly started/stopped when their containing views are
added/removed from the view hierarchy.
Reviewed by trey.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::canCachePage):
2003-01-17 David Hyatt <hyatt@apple.com>
The new table code from Lars. Also includes bug fixes for
percentage height children in table cells, for positioning
of tables, and for width distribution of percentage width
cells.
Reviewed by darin
* ForwardingHeaders/rendering/table_layout.h: Added.
* WebCore.pbproj/project.pbxproj:
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseValue):
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssvalues.c:
(findValue):
* khtml/css/cssvalues.h:
* khtml/css/cssvalues.in:
* khtml/css/html4.css:
* khtml/dom/html_table.cpp:
(HTMLTableElement::insertRow):
(HTMLTableElement::deleteRow):
(HTMLTableRowElement::insertCell):
(HTMLTableRowElement::deleteCell):
(HTMLTableSectionElement::insertRow):
(HTMLTableSectionElement::deleteRow):
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::HTMLTableElementImpl):
(HTMLTableElementImpl::setTFoot):
(HTMLTableElementImpl::setTBody):
(HTMLTableElementImpl::createTHead):
(HTMLTableElementImpl::createTFoot):
(HTMLTableElementImpl::insertRow):
(HTMLTableElementImpl::deleteRow):
(HTMLTableElementImpl::addChild):
(HTMLTableElementImpl::parseAttribute):
(HTMLTableElementImpl::attach):
(HTMLTablePartElementImpl::parseAttribute):
(HTMLTableSectionElementImpl::HTMLTableSectionElementImpl):
(HTMLTableSectionElementImpl::~HTMLTableSectionElementImpl):
(HTMLTableSectionElementImpl::insertRow):
(HTMLTableSectionElementImpl::deleteRow):
(HTMLTableSectionElementImpl::numRows):
(HTMLTableRowElementImpl::rowIndex):
(HTMLTableRowElementImpl::insertCell):
(HTMLTableRowElementImpl::deleteCell):
(HTMLTableCellElementImpl::HTMLTableCellElementImpl):
(HTMLTableCellElementImpl::parseAttribute):
(HTMLTableCellElementImpl::attach):
(HTMLTableColElementImpl::HTMLTableColElementImpl):
(HTMLTableColElementImpl::parseAttribute):
* khtml/html/html_tableimpl.h:
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
(KHTMLParser::getElement):
* khtml/rendering/bidi.cpp:
(RenderFlow::layoutInlineChildren):
* khtml/rendering/render_body.cpp:
(RenderBody::availableHeight):
* khtml/rendering/render_body.h:
* khtml/rendering/render_box.cpp:
(RenderBox::contentWidth):
(RenderBox::contentHeight):
(RenderBox::calcReplacedWidth):
(RenderBox::calcReplacedHeight):
(RenderBox::availableHeight):
(RenderBox::calcAbsoluteVertical):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
(RenderFlow::leftOffset):
(RenderFlow::rightOffset):
(RenderFlow::addOverHangingFloats):
(RenderFlow::calcBlockMinMaxWidth):
(RenderFlow::calcMinMaxWidth):
* khtml/rendering/render_form.cpp:
* khtml/rendering/render_form.h:
* khtml/rendering/render_frames.cpp:
* khtml/rendering/render_frames.h:
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
(RenderObject::paddingTop):
(RenderObject::paddingBottom):
(RenderObject::paddingLeft):
(RenderObject::paddingRight):
* khtml/rendering/render_object.h:
* khtml/rendering/render_replaced.cpp:
(RenderReplaced::calcMinMaxWidth):
* khtml/rendering/render_root.cpp:
(RenderRoot::RenderRoot):
(RenderRoot::layout):
(RenderRoot::paintObject):
* khtml/rendering/render_root.h:
* khtml/rendering/render_style.cpp:
(StyleSurroundData::StyleSurroundData):
* khtml/rendering/render_style.h:
* khtml/rendering/render_table.cpp:
(RenderTable::RenderTable):
(RenderTable::~RenderTable):
(RenderTable::setStyle):
(RenderTable::position):
(RenderTable::addChild):
(RenderTable::calcWidth):
(RenderTable::layout):
(RenderTable::setCellWidths):
(RenderTable::paint):
(RenderTable::calcMinMaxWidth):
(RenderTable::splitColumn):
(RenderTable::appendColumn):
(RenderTable::colElement):
(RenderTable::recalcSections):
(RenderTable::removeChildNode):
(RenderTable::dump):
(RenderTableSection::RenderTableSection):
(RenderTableSection::~RenderTableSection):
(RenderTableSection::detach):
(RenderTableSection::setStyle):
(RenderTableSection::addChild):
(RenderTableSection::ensureRows):
(RenderTableSection::addCell):
(RenderTableSection::setCellWidths):
(RenderTableSection::calcRowHeight):
(RenderTableSection::layoutRows):
(RenderTableSection::paint):
(RenderTableSection::recalcCells):
(RenderTableSection::clearGrid):
(RenderTableSection::removeChildNode):
(RenderTableSection::dump):
(RenderTableRow::RenderTableRow):
(RenderTableRow::detach):
(RenderTableRow::setStyle):
(RenderTableRow::addChild):
(RenderTableRow::removeChildNode):
(RenderTableRow::dump):
(RenderTableRow::layout):
(RenderTableCell::RenderTableCell):
(RenderTableCell::detach):
(RenderTableCell::updateFromElement):
(RenderTableCell::getCellPercentageHeight):
(RenderTableCell::setCellPercentageHeight):
(RenderTableCell::calcMinMaxWidth):
(RenderTableCell::baselinePosition):
(RenderTableCell::setStyle):
(RenderTableCell::paint):
(RenderTableCell::paintBoxDecorations):
(RenderTableCell::dump):
(RenderTableCol::RenderTableCol):
(RenderTableCol::updateFromElement):
(RenderTableCol::addChild):
(RenderTableCol::dump):
* khtml/rendering/render_table.h:
* khtml/rendering/table_layout.cpp: Added.
(FixedTableLayout::FixedTableLayout):
(FixedTableLayout::~FixedTableLayout):
(FixedTableLayout::calcWidthArray):
(FixedTableLayout::calcMinMaxWidth):
(FixedTableLayout::layout):
(AutoTableLayout::AutoTableLayout):
(AutoTableLayout::~AutoTableLayout):
(AutoTableLayout::recalcColumn):
(AutoTableLayout::fullRecalc):
(AutoTableLayout::calcMinMaxWidth):
(AutoTableLayout::calcEffectiveWidth):
(AutoTableLayout::insertSpanCell):
(AutoTableLayout::layout):
(AutoTableLayout::calcPercentages):
* khtml/rendering/table_layout.h: Added.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::createHTMLElement):
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::NodeImpl):
(NodeImpl::dump):
* khtml/xml/dom_nodeimpl.h:
2003-01-17 Darin Adler <darin@apple.com>
Reviewed by Dave.
- clean room rewrite of QCString::operator<<.
* kwq/KWQCString.mm: (operator<<): Rewrote it.
- update format of render tree dumping for real use
* khtml/rendering/render_layer.h: Added elementList().
* khtml/rendering/render_layer.cpp: (RenderLayer::elementList): Added.
* kwq/KWQRenderTreeDebug.cpp:
(operator<<): Added an overload for writing out QRect.
(writeIndent): Added.
(write): Use the overload for QRect, also reorganize to dump layers.
(writeLayers): Use this to dump the layers.
(externalRepresentation): Call writeLayers instead of write.
2003-01-17 Darin Adler <darin@apple.com>
Reviewed by Ken.
- removed unused KWQDrawUtil code
* ForwardingHeaders/qdrawutil.h: Emptied this file out.
* kwq/KWQDrawUtil.h: Removed.
* kwq/KWQDrawUtil.mm: Removed.
* WebCore.pbproj/project.pbxproj: Removed KWQDrawUtil.
2003-01-17 Darin Adler <darin@apple.com>
Reviewed by John.
- updated copyright to include expat copyrights
* WebCore.pbproj/project.pbxproj: Added expat copyrights on the end.
Got text of copyrights from Acknowledgments.rtf in WebBrowser.
2003-01-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed 3148141 - crash in KJS::WindowFunc::tryCall leaving certain site
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::setView): If setting the view to nil and we have a
document, detach the document. This means that we are removing a
frame from the tree, so we want to run it's onUnload handler now,
rather than later when things are no longer fully hooked up.
2003-01-16 Richard Williamson <rjw@apple.com>
Fixed 3148932. Account for zero width characters
in <pre> fixed-width optimization.
Reviewed by hyatt.
* khtml/rendering/render_text.cpp:
(RenderText::widthFromCache):
Reviewed by Richard (written by Mike S.) 'Clean' implementations of these
functions that were too similar to the Qt implementations.
* kwq/KWQString.mm:
(QString::left):
(QString::right):
(QString::mid):
2003-01-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3144771 - Crash in KJS::WindowFunc::tryCall leaving www.smogcheck.org
I fixed this by making sure we couldn't send the unload event twice, which was
happening before in certain circumstances.
* khtml/khtml_part.cpp:
(KHTMLPart::closeURL): When emitting load event, note that unload
event has not yet been sent.
(KHTMLPart::checkEmitLoadEvent): Note when unload event has been
sent to avoid sending it twice.
* khtml/khtmlpart_p.h:
2003-01-16 Darin Adler <darin@apple.com>
Reviewed by John.
- added an API for dumping the external representation of the render tree for testing
* kwq/KWQRenderTreeDebug.h: Added.
* kwq/KWQRenderTreeDebug.cpp: Added.
* kwq/KWQTextStream.h: Added more overloads for operator<<.
* kwq/KWQTextStream.mm: (QTextStream::operator<<): Implemented them.
* kwq/WebCoreBridge.h: Added renderTreeAsExternalRepresentation.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge renderTreeAsExternalRepresentation]): Added.
- removed remnants of an earlier more-naive cut at this same sort of thing
- removed ForwardingHeaders from the project since that doesn't really help Project Builder
* kwq/WebCoreTestController.h: Removed.
* kwq/WebCoreTestController.m: Removed.
* WebCore.exp: Removed WebCoreTestController.
* WebCore-combined.exp: Re-generated.
* WebCore.pbproj/project.pbxproj: Removed WebCoreTestController and ForwardingHeaders.
=== Safari-52 ===
2003-01-15 Trey Matteson <trey@apple.com>
3144458 - user's credentials are present in a form that is revisited via b/f or history
We now never save/restore password fields. Also if the page has a form with a password
field that would be submitted securely, we do not save anything on that page.
Reviewed by Darin.
* force-clean-timestamp: PB isn't smart enough to know what to rebuild.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formWouldHaveSecureSubmission): Utility function.
(HTMLFormElementImpl::attach): Tell doc if we've added a secure form.
(HTMLFormElementImpl::parseAttribute): Tell doc if form became secure.
(HTMLInputElementImpl::state): Assert that we never save password fields.
(HTMLInputElementImpl::restoreState): Assert that we never restore password fields.
(HTMLInputElementImpl::attach): Tell doc if we've added a password field.
* khtml/html/html_formimpl.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl): Init count of secure forms, password fields.
(DocumentImpl::passwordFieldAdded):
(DocumentImpl::passwordFieldRemoved):
(DocumentImpl::hasPasswordField): New methods to count password fields.
(DocumentImpl::secureFormAdded):
(DocumentImpl::secureFormRemoved):
(DocumentImpl::hasSecureForm): New methods to count secure forms.
* khtml/xml/dom_docimpl.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::canCachePage): Never let pages with password fields in the page cache.
(KWQKHTMLPart::saveDocumentState): Do not save form state if page has a form with
a password field that would be submitted securely
2003-01-15 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed problem where Content-Type was coming in with suffixes like "charset"
* kwq/WebCoreBridge.h: Add contentType and refresh parameters, and remove "headers"
parameter, from openURL method.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:reload:contentType:refresh:lastModified:pageCache:]): Get the
content type from a parameter, and the refresh header from a separate parameter rather
than extracting both from a headers dictionary.
2003-01-14 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3147036 -- words separated only by newlines are getting rammed together on XML page
- fixed 3147032 -- preformatted text is missing much whitespace on XML page
* khtml/xml/xml_tokenizer.cpp: (XMLHandler::characters): Don't try to strip whitespace at all,
because it needs to be in the DOM.
- add support for more MIME types
* khtml/khtml_part.cpp: (KHTMLPart::begin): Add "application/xml" and "application/xhtml+xml".
2003-01-14 David Hyatt <hyatt@apple.com>
Make FOUC work with XML.
Reviewed by darin.
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::attach):
* khtml/xml/dom_xmlimpl.cpp:
(ProcessingInstructionImpl::ProcessingInstructionImpl):
(ProcessingInstructionImpl::checkStyleSheet):
(ProcessingInstructionImpl::isLoading):
(ProcessingInstructionImpl::sheetLoaded):
(ProcessingInstructionImpl::setStyleSheet):
* khtml/xml/dom_xmlimpl.h:
2003-01-14 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- first cut at XML parsing with expat
* khtml/khtml_part.cpp: (KHTMLPart::begin): Remove APPLE_CHANGES and use the XML
code for text/xml documents.
* WebCore.pbproj/project.pbxproj: Added the ForwardingHeaders to the project.
Added new QXml files, removed old ones.
* kwq/KWQXml.h: Removed.
* kwq/KWQXml.mm: Removed.
* kwq/KWQXmlAttributes.h: Added.
* kwq/KWQXmlAttributes.mm: Added.
* kwq/KWQXmlDefaultHandler.h: Added.
* kwq/KWQXmlDefaultHandler.mm: Added.
* kwq/KWQXmlSimpleReader.h: Added.
* kwq/KWQXmlSimpleReader.mm: Added.
* kwq/KWQString.h: Add fromUtf8 functions.
* kwq/KWQString.mm: (QString::fromUtf8): Added. Simple implementation just
calls fromStringWithEncoding. We may need something more efficient later,
at least for all-ASCII text.
- other changes
* khtml/khtml_part.h: Fix spelling of occurrence.
* khtml/misc/decoder.cpp: (Decoder::decode): Turn on Japanese auto-detect.
It doesn't seem to work yet, but this does no harm.
2003-01-13 Richard Williamson <rjw@apple.com>
Fix for 3139120. This patch was contributed by Mitz Pettel. It correctly
handles the visually ordered encodings. The patch also picks up changes
from kde that accounts for european numbers correctly in bidiReorderLine().
Reviewed by Dave.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formData):
* khtml/misc/decoder.cpp:
(Decoder::setEncoding):
* khtml/rendering/bidi.cpp:
(RenderFlow::bidiReorderLine):
* khtml/rendering/bidi.h:
2003-01-13 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3143781 -- submitting the same form twice doesn't work properly
(example at directory.apple.com)
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::submitForm): Only run the "don't submit the same
form twice" logic when the form is one that affects the frame that the form is in.
2003-01-12 Darin Adler <darin@apple.com>
* WebCorePrefix.h: Needed to touch this file since we now have plain C source (expat).
* kwq/KWQKHTMLPart.cpp: Reformatted a bit.
2003-01-12 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- first step towards integrating expat for XML support: make it compile and link
* kwq/KWQXml.mm: (QXmlSimpleReader::parse): Put in a placeholder that calls expat.
Mainly just used to make sure we link.
* WebCore.pbproj/project.pbxproj: Added expat files.
* expat/COPYING: Added.
* expat/Changes: Added.
* expat/MANIFEST: Added.
* expat/README: Added.
* expat/expat_config.h: Added.
* expat/lib/ascii.h: Added.
* expat/lib/asciitab.h: Added.
* expat/lib/expat.h: Added.
* expat/lib/iasciitab.h: Added.
* expat/lib/internal.h: Added.
* expat/lib/latin1tab.h: Added.
* expat/lib/nametab.h: Added.
* expat/lib/utf8tab.h: Added.
* expat/lib/xmlparse.c: Added.
* expat/lib/xmlrole.c: Added.
* expat/lib/xmlrole.h: Added.
* expat/lib/xmltok.c: Added.
* expat/lib/xmltok.h: Added.
* expat/lib/xmltok_impl.c: Added.
* expat/lib/xmltok_impl.h: Added.
* expat/lib/xmltok_ns.c: Added.
2003-01-12 Darin Adler <darin@apple.com>
Reviewed by Dave.
- minor cleanup of plug-in-related classes in ECMA directory
* khtml/ecma/kjs_navigator.cpp: Remove unneeded PluginBase member functions
ref() and deref(). Instead just make Plugin and MimeType both derive from
PluginBase and remove APPLE_CHANGES.
(Navigator::getValueProperty): Don't use "Konqueror" for the fallback.
Just return Undefined() for that case since we will never reach it anyway.
- simplify the logic in khtmlMoveMouseEvent so it's easier to decipher
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMouseMoveEvent): By merging two
identical if statements, the logic of this function becomes much clearer.
2003-01-12 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed a bunch of places where KHTML did !x == y instead of !(x == y) or x != y.
* khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule):
* khtml/html/htmlparser.cpp: (KHTMLParser::insertNode):
* khtml/misc/loader.cpp: (Cache::requestImage), (Cache::requestStyleSheet):
* khtml/rendering/render_flow.cpp: (RenderFlow::setStyle):
Changed !x == y to x != y. In each case, there's a reason that this does not create
any problem in practice, which is why we didn't rush to get this in for beta 1.
2003-01-11 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3144789 -- reproducible crash in KHTMLParser::freeBlock on a page at www.library.arizona.edu
* khtml/html/htmlparser.cpp: (KHTMLParser::finished): Call freeBlock here rather than
waiting until the parser is destroyed. This fixes the bug because when the parser is
destroyed, the document is already destroyed, so we have a dangling current pointer to an
already-destroyed node.
- fixed 3142024 -- crash/hang/assert on java.sun.com in HTMLTokenizer
The bug was caused by an erroneous clicked signal that was being emitted by
QListBox at just the wrong time.
* kwq/KWQListBox.h: Added _changingSelection boolean.
* kwq/KWQListBox.mm: (QListBox::QListBox): Set _changingSelection to false.
(QListBox::setSelected): Set _changingSelection to true.
(-[KWQListBoxTableViewDelegate tableViewSelectionDidChange:]): Only emit the "clicked"
signal if _changingSelection is false.
* khtml/html/htmltokenizer.h: Add debug-only boolean inWrite.
* khtml/html/htmltokenizer.cpp: (HTMLTokenizer::HTMLTokenizer): Set inWrite to false.
(HTMLTokenizer::write): Set inWrite to true.
(HTMLTokenizer::~HTMLTokenizer): Assert that inWrite is not true.
2003-01-11 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3136944 -- mouseover feedback over non-mapped part of image map claims
link to current page
* kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]):
Change code so we won't call completeURL and complete a null ATTR_HREF (which is distinct
from an empty ATTR_HREF). Did a similar cleanup on the image code.
2003-01-09 Darin Adler <darin@apple.com>
* WebCore.pbproj/project.pbxproj: Add the year 2003, remove CFBundleIconFile,
bump marketing version to 0.8.1 and version to 52u to keep up with the branch,
remove NSHumanReadableCopyright, remove NSPrincipalClass, remove SKIP_INSTALL
that was in the Info plist instead of project settings.
* English.lproj/InfoPlist.strings: Update to match above.
2003-01-09 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed Radar 3143013 - hang trying to load spiny.com/software
* khtml/rendering/render_table.cpp:
(RenderTable::layoutRows): Check for the render root as a loop
termination condition, to avoid an infinite loop for an absolute
but non-fixed table cell.
2003-01-09 David Hyatt <hyatt@apple.com>
The "flow-mode" quirk for lists is just that - a quirk, and should
not be applied when in strict mode.
Fixes diveintomark.org's navigation bar on the front page (issue #2
on his list).
Reviewed by darin and maciej
* khtml/css/html4.css:
2003-01-08 David Hyatt <hyatt@apple.com>
Finish the KONQBLOCK removal and make sure that table rows and
cells encountered inside stray content cause the stray content to
close so that the rows and cells can be part of the table.
This fixes the versiontracker bug. #3142319.
Reviewed by darin.
* khtml/html/htmlparser.cpp:
(KHTMLParser::reset):
(isTableRelatedTag):
(KHTMLParser::insertNode):
(KHTMLParser::popOneBlock):
* khtml/html/htmlparser.h:
2003-01-08 David Hyatt <hyatt@apple.com>
Revert the redundancy that dirk noticed.
Fixing issue #3 on diveintomark.org's list, which actually involved
merging calcAbsoluteVertical to KHTML's trunk and then fixing
a math error in the bottom computation.
* khtml/html/html_baseimpl.cpp:
(HTMLBodyElementImpl::parseAttribute):
* khtml/rendering/render_box.cpp:
(RenderBox::calcAbsoluteVertical):
2003-01-08 Chris Blumenberg <cblu@apple.com>
Fixed: 3111432 - Support OBJECT tags with type text/plain or text/html
Reviewed by dave.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::createPart): call [_bridge frameRequiredForMIMEType:] to determine if we should create a plug-in view or iframe
* kwq/WebCoreBridge.h: add frameRequiredForMIMEType:
2003-01-08 Trey Matteson <trey@apple.com>
3136213 - Page loads stopped by backtracking don't finish when moving forward
We need to remove the entry from the KHTML image cache when a load
has an error, so it will be reloaded next time we try.
Reviewed by Darin,
* khtml/misc/loader.cpp:
(Loader::slotFinished): Remove cache entry on job error.
2003-01-08 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 96/72 dpi snafu; no need to do something different for AppKit,
because it always uses pixel sizes, not font size
* khtml/css/css_valueimpl.cpp:
* khtml/css/css_valueimpl.h:
* khtml/css/cssstyleselector.cpp:
* kwq/KWQPaintDeviceMetrics.mm:
Rolled out change from 2002-12-05
- a cut at implementing heretofore unimplemented QTextStream classes
* kwq/KWQTextStream.h:
* kwq/KWQTextStream.mm:
First cut implementation.
2003-01-05 Maciej Stachowiak <mjs@apple.com>
Reviewed by no one cause I'm just changing copyright strings.
* WebCore.pbproj/project.pbxproj: Added non-Apple copyrights to
copyright strings.
* English.lproj/InfoPlist.strings: Likewise.
2003-01-05 Darin Adler <darin@apple.com>
* Resources/Info.plist: Fix "Apple Compupter" typo.
2003-01-04 Trey Matteson <trey@apple.com>
3098388 - Pressing the back button goes back two levels at allmusic.com
When processing an assignment to document.location, allow items to be added
to history. This parallels the existing treatment of window.location.href.
Reviewed by Richard, Darin
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocument::putValue): Pass false for lockHistory arg of scheduleRedirection()
2003-01-04 Richard Williamson <rjw@apple.com>
I checked in kjs_window.cpp by accident. The only change
was a logging printf. Back out that change.
Reviewed by me.
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall):
2003-01-03 Richard Williamson <rjw@apple.com>
Fix for 3138425. Don't open a new window when document.open() is called
with < 2 parameters.
Reviewed by darin.
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocFunction::tryCall):
* khtml/ecma/kjs_window.cpp:
(WindowFunc::tryCall):
2003-01-03 Richard Williamson <rjw@apple.com>
Fixed 3138743, 3138678, and 3138854. Removed the RenderText
widths cache, replaced it with a much simply monospace character
cache. Should be much faster for covered cases too! Also fixed
buffer overrun problem causing the crash in 3138854.
Reviewed by darin.
* khtml/rendering/font.cpp:
(Font::isFixedPitch):
* khtml/rendering/font.h:
* khtml/rendering/render_text.cpp:
(TextSlave::checkSelectionPoint):
(RenderText::RenderText):
(RenderText::setStyle):
(RenderText::~RenderText):
(RenderText::shouldUseMonospaceCache):
(RenderText::cacheWidths):
(RenderText::widthFromCache):
(RenderText::trimmedMinMaxWidth):
(RenderText::calcMinMaxWidth):
(RenderText::setText):
(RenderText::width):
* khtml/rendering/render_text.h:
* kwq/KWQFont.h:
* kwq/KWQFont.mm:
(QFont::isFixedPitch):
* kwq/WebCoreTextRendererFactory.h:
* kwq/WebCoreTextRendererFactory.m:
(-[WebCoreTextRendererFactory isFontFixedPitch:]):
2003-01-03 John Sullivan <sullivan@apple.com>
- fixed 3138673 -- reproducible crash in JavaScript
Reviewed by Darin, OK'ed by Don.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::setTitle):
Check for nil view or nil part before dereferencing.
2003-01-03 David Hyatt <hyatt@apple.com>
Fix for percentage table heights. A check was missing to
look for a fixed height on the containing block.
Reviewed by darin
* khtml/rendering/render_table.cpp:
(RenderTable::layoutRows):
=== Alexander-48 ===
2003-01-02 David Hyatt <hyatt@apple.com>
Fix for 3136473. <object>s with no specified size should be
0x0. They should not be 300x200. Fixes thinker.org.
Reviewed by john and darin.
* khtml/rendering/render_frames.cpp:
(RenderPart::intrinsicWidth):
(RenderPart::intrinsicHeight):
2003-01-02 Darin Adler <darin@apple.com>
Reviewed by Maciej and Trey.
- fixed 3138063 -- REGRESSION: JavaScript-submitted form activates input type=image (webmail.mac.com)
JavaScript-submitted forms must not get a submit button activated as return-key-submitted ones do.
* khtml/html/html_formimpl.h: Add boolean activateSubmitButton parameter to submit.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::prepareSubmit): Pass true for activateSubmitButton.
(HTMLFormElementImpl::submit): Only activate a button if activateSubmitButton is true.
* khtml/dom/html_form.cpp: (HTMLFormElement::submit): Pass false for activateSubmitButton.
2003-01-02 David Hyatt <hyatt@apple.com>
Fix for the 3137790. This patch passes the mouse event x and y as
distinct arguments to constructZTree, so that the damageRect can
really reflect your clip rect.
This allows me to prune out layers that are clipped so
that if x,y aren't inside the clip rect, the layer doesn't get added to
the list.
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 followed. :)
Reviewed by darin
* khtml/rendering/render_layer.cpp:
(RenderLayer::nodeAtPoint):
(RenderLayer::constructZTree):
* khtml/rendering/render_layer.h:
2003-01-02 David Hyatt <hyatt@apple.com>
Fix for bug #3137935. When a float causes a line to get
moved down past the float, the line would incorrectly break
rather than expanding to use the newly-available width.
Reviewed by darin.
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
2003-01-02 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3131190 -- <textarea wrap="hard"> eats text on blur
* kwq/KWQTextArea.mm: (-[KWQTextArea paragraphs]): Add missing parentheses so we don't
always return 0 or 1 for the number of paragraphs.
2002-12-31 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3130831 - HOMEPAGE: JavaScript that tries to intercept onmousedown fails, image gets dragged instead
- fixed 3125554 - while dragging to select text in a nested frame, you can start dragging a link or image
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Initialize new mouseDownMayStartDrag
and mouseDownMayStartSelect methods.
(KWQKHTMLPart::khtmlMousePressEvent): Make sure a mouse down
won't be used to start a drag or selection if the default action
is prevented on the mouse down event.
(KWQKHTMLPart::mouseDown): Since the default action wasn't
prevented, decide if this might be the start of a drag or
selection.
(KWQKHTMLPart::khtmlMouseMoveEvent): On a drag or selection, call
back to the bridge to handle selection or autoscrolling
appropriately.
* kwq/WebCoreBridge.h: Prototype new methods.
2003-01-01 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3137566 -- non-reproducible nil-dereference in KHTMLView::clearPart
deallocating KWQPageState
* kwq/KWQPageState.mm: (-[KWQPageState dealloc]): Add nil check.
2003-01-01 David Hyatt <hyatt@apple.com>
Fix tables so that malformations inside them are properly pulled
out of the table without being flattened.
Fixes 3131480.
Reviewed by gramps
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode):
=== Alexander-47 ===
2002-12-30 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3132141 -- enter key does not work with input type=image
Made the logic handle image and submit type inputs in the same way.
* khtml/html/html_formimpl.h: Remove unused m_clicked flags.
* khtml/html/html_formimpl.cpp:
(HTMLButtonElementImpl::HTMLButtonElementImpl): Remove code to set the m_clicked flag.
The only place this flag was looked at is better handled by the m_activeSubmit flag.
(HTMLButtonElementImpl::defaultEventHandler): Remove more m_clicked flag code.
(HTMLInputElementImpl::HTMLInputElementImpl): Remove more m_clicked flag code.
(HTMLInputElementImpl::isSuccessfulSubmitButton): An image is also a successful submit
button, and unlike a submit element, it doesn't require a name because it will just submit
x and y with no name in that case. I suppose we could rename this function, but I think it's
still a pretty clear name even if not 100% accurate.
(HTMLInputElementImpl::encoding): Remove use of m_clicked and use m_activeSubmit instead.
This was the only place using m_clicked at all. Also remove bogus check for a -1 coordinate.
The coordinate defaults to 0, not -1, and it was never happening.
(HTMLInputElementImpl::defaultEventHandler): Remove more m_clicked flag code.
2002-12-30 David Hyatt <hyatt@apple.com>
Fix for 3129016, make sure that zero-height tables and lists
will be skipped in a search for floats that occur before
them. Makes usatoday work.
Reviewed by gramps
* khtml/rendering/render_flow.cpp:
(RenderFlow::clearFloats):
2002-12-30 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3135642 -- ad frames are missing at channels.netscape.com
* khtml/rendering/render_frames.cpp: (RenderPartObject::updateWidget): Updated to use the
same rule as Mozilla: Empty URL for an iframe means "about:blank".
* khtml/ecma/kjs_window.cpp: (Window::isSafeScript): Loosen things so that it's safe for
a frame to manipulate an empty child frame, as well as an empty opened window. Also remove
the useless check for an empty document -- it never happens in practice.
2002-12-30 Ken Kocienda <kocienda@apple.com>
Reviewed by Darin and Gramps
Fix for this bug:
Radar 3136795 (type URL with ../ in it, get assertion)
The code to remove relative portions from URLs was eating leading slashes on
URL paths. This caused absolute paths with relative portions to get mangled,
resulting in a URL that the engine could not use. Now, leading slashes are no
longer removed from URL paths, resulting in usuable URLs.
* kwq/KWQKURL.mm:
(copyPathRemovingDots)
2002-12-29 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3103287 -- body of page not rendered (page uses JavaScript trick to be both a frameset and a frame)
Our self-reference protection prevented this page from working.
To fix the bug, I did three things:
1) fixed the hole in the WebCore self-reference protection, so we could remove the WebKit one
(the hole was that it didn't ignore #xxx suffixes)
2) moved the self-reference protection into a single function so it wasn't copied and pasted all over
3) allowed one level of self-reference; still enough to prevent infinite recursion
Then I tested with the site from bug 3103287 and the one from bug 3083732 to make sure that was still OK.
* khtml/html/html_baseimpl.h: Added isURLAllowed().
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::isURLAllowed): Added. Does the self-reference check and the "local only" check.
This logic was repeated in three different places before. Note that since we don't use the "local only"
feature, it's not too risky to slightly change how it works.
(HTMLFrameElementImpl::updateForNewURL): Use isURLAllowed.
(HTMLFrameElementImpl::attach): Ditto.
(HTMLIFrameElementImpl::attach): Ditto.
2002-12-29 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3130566 -- REGRESSION: list item numbers are overlapping the text of the list items
Moved the hack that handles list items that are not in lists out of the parser and into
the DOM and Render tree code itself. This fixes the issue where the parser doesn't know which
will be the parent node of the list item, and other problems with the old hack.
* khtml/html/html_listimpl.cpp: (HTMLLIElementImpl::attach): Find the parent list (OL or UL).
If there is no parent list, set a "not in list" flag on the render object so it knows to render
"inside" no matter what the style says. Also use this parent and a safer check to make the
start attribute work even when there is an intervening DOM element in the hierarchy.
* khtml/html/htmlparser.cpp: (KHTMLParser::getElement): Remove the code that tries to set
the style of an LI based on the current node at the time it's parsed, because the current node
is now often not the OL or the UL due to our DTD fix to allow other nodes in lists.
* khtml/rendering/render_list.h: Add isInside() to RenderListMarker, setNotInList(), notInList(),
and _notInList to RenderListItem.
* khtml/rendering/render_list.cpp:
(RenderListItem::RenderListItem): Initialize _notInList to false.
(RenderListMarker::paintObject): Use isInside() instead of checking listStylePosition().
(RenderListMarker::calcMinMaxWidth): Ditto.
(RenderListMarker::baselinePosition): Ditto.
(RenderListMarker::isInside): Return true if we are not in a list, or if "inside" style is requested.
2002-12-29 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3134346 -- country menu at www.apple.com does not work when you go back to that page
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::openURLFromPageCache): Add call to checkCompleted().
2002-12-29 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3136391 -- PianoNanny.com screens turn to garbage when resized
Turns out browsers pass open calls to the window object if they show up at the document
with parameters. We now emulate that too.
* khtml/ecma/kjs_html.cpp: (KJS::HTMLDocFunction::tryCall): If we get an open call with
parameters, pass it on to the window.
2002-12-29 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3134560 -- Lord of the Rings desktops don't load
* khtml/ecma/kjs_window.cpp: (WindowFunc::tryCall): Removed the APPLE_CHANGES here.
The comment claims that we don't need the code because "JavaScript will do the work
below on demand", but that's not true for setting the base URL. Also, the comment
claims that this "adds an extra entry to the back/forward list", but testing does not
bear that out.
=== Alexander-46 ===
2002-12-28 Ken Kocienda <kocienda@apple.com>
Reviewed by Gramps and Richard.
Fix for this bug:
Radar 3112233 (400 response when attaching files at mail.yahoo.com)
KHTML multipart form code called into KMimeType class to determine
the mime type for file attachments, however, our implementation of
KMimeType has only stubs which call ERROR.
I added some code into KWQKHTMLPart and WebCoreBridge so that the
code in html_formimpl can call through to the WebFoundation mime
file map we maintain.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::formData)
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::mimeTypeForFileName)
* kwq/WebCoreBridge.h:
2002-12-26 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3136262 -- Shockwave Flash at movies.yahoo.com does not work
* khtml/rendering/render_frames.cpp: (RenderPartObject::updateWidget):
Moved the class ID special case MIME types out of the if statement so they can be shared
in the case where we have an embed tag but no MIME type.
2002-12-26 Darin Adler <darin@apple.com>
Reviewed by Don.
* kwq/KWQAssertions.h: Fixed CRASH macro to use 0xbbadbeef instead of 0xbadbeef
to reduce the chance that the address will be valid once we have allocated a lot of memory.
2002-12-24 Richard Williamson <rjw@apple.com>
Fix for 3134543 (and widely reported dupes). Don't use render_text
widths cache except for whitespace == PRE. The problem was that additional
spaces in the RenderText's string were being inappropiately measured.
An alternate, more complex and risky, fix would account for the whitespace
properties during scanning of the RenderText width buffer. Considering
the scenario for which this optimization was added (3133261), this
simpler fix is adequate.
Reviewed by Darin and Don.
* khtml/rendering/render_text.cpp:
(RenderText::computeWidths):
2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3135010 -- nil-dereference in KHTMLPart::xmlDocImpl() at channels.netscape.com
* khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::contentDocument):
Add missing nil check. Also added lots of FIXME comments about problems I observed here.
2002-12-24 Darin Adler <darin@apple.com>
Reviewed by Richard and Don.
- fixed 3133207 -- crash in HTMLFrameElementImpl updateForNewURL at home.real.com
My previous attempt to fix this dealt with the case where a RenderFrame object was
not yet created, but not with the case where a RenderFrame object was created without
a corresponding part. Somehow I overlooked this last time when I was doing testing.
Testing this time confirms this takes care of the remaining problem at movies.real.com.
* khtml/html/html_baseimpl.cpp: (HTMLFrameElementImpl::updateForNewURL):
Use the same kind of requestFrame call here as in attach when there's a RenderFrame,
but no corresponding part. Maybe we can fix this an even more elegant way later.
=== Alexander-45 ===
2002-12-23 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3134558 -- REGRESSION: Lord of the Rings site problems
This regression was caused when we fixed the abcnews.com problem (3124933).
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::createEmptyDocument):
Despite its name, this function was never intended to overwrite an existing document with
an empty document. When we changed it do do the creation in a better way, we lost the
check that prevents it from doing anything at all if we already have a document.
2002-12-22 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3134383 -- crash in KWQKHTMLPart::canCachePage at www.apple.com
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::canCachePage):
Check for nil in the result of Window::retrieveWindow.
=== Alexander-44 ===
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by Trey and Don.
- fixed 3132160 -- meta refresh does not work if there's a space after the refresh interval value
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::processHttpEquiv):
Added a call to stripWhiteSpace here. The other places that processes delays for
meta refresh already had the stripWhiteSpace call, but this was missing it.
2002-12-20 David Hyatt <hyatt@apple.com>
Fix for 3134163, a regression from the reduction of
styleForElement calls. Make sure image buttons
get the width attribute and add it to style info
before styleForElement gets called.
Reviewed by rjw
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::attach):
2002-12-20 David Hyatt <hyatt@apple.com>
Fix for 3134133. Back out the render_text code I gave to rjw
to check in. It wasn't filling in a value for hasBreak, so it
became random whether or not you'd break or not.
Reviewed by rjw
* khtml/rendering/render_text.cpp:
(RenderText::trimmedMinMaxWidth):
(RenderText::calcMinMaxWidth):
* khtml/rendering/render_text.h:
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3133801 -- REGRESSION: Japanese page comes up hash
* khtml/khtml_part.cpp: (KHTMLPart::write): Roll back to original KHTML code here,
removing the "all ASCII" optimization.
2002-12-20 David Hyatt <hyatt@apple.com>
Fix for 3133081, slashdot messed up when changing font sizes.
setStyle in RenderFlow was messed up for continuations. A
block in the middle of a continuation incorrectly propagated
its style to the following inlines.
Reviewed by darin
* khtml/rendering/render_flow.cpp:
(RenderFlow::setStyle):
2002-12-20 Richard Williamson <rjw@apple.com>
Fix for 3133601. Play the same trick we do in
KHTMLPartBrowserExtension::openURLRequest to create an empty
document if necessary.
Reviewed by darin.
* khtml/ecma/kjs_window.cpp:
(Window::get):
2002-12-19 David Hyatt <hyatt@apple.com>
Remove the clip hack from setLayout and make it
asynchronous instead. This fixes the crasher
on autosite.com, which had a sync layout occur
while in the middle of making a block box's
children get wrapped in anonymous boxes. It
was only half done when the layout got
triggered, which is what caused the assert to fire.
The bug # is 3129534.
Reviewed by rjw
* khtml/khtmlview.cpp:
(KHTMLView::KHTMLView):
(KHTMLView::timerEvent):
(KHTMLView::scheduleRelayout):
* khtml/khtmlview.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
(RenderObject::scheduleRelayout):
* khtml/rendering/render_object.h:
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3129387 -- Stopped responding to controls while filling out form (exception in KWQTextArea)
* kwq/KWQTextArea.mm:
(-[KWQTextArea getCursorPositionAsIndex:inParagraph:]): Fix code that was returning the wrong
paragraph number along with the index within the paragraph. Also made it return a paragraph one
past the end with an index of 0 for cases where you are at the end of the text.
(-[KWQTextArea setCursorPositionToIndex:inParagraph:]): Range check the passed-in index. This
would also have prevented the exception.
=== Alexander-43 ===
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3132382 -- crash in khtml::CachedImage
The source of this bug was my long-ago fix to bug 3079499.
I changed the code to copy the clients list. But this doesn't work if
one of the clients is removed while iterating because it's deleted.
So I made a new class, CachedObjectClientWalker, that does the iterating safely.
Now both this new bug and the original are fixed.
* khtml/misc/loader.cpp:
(CachedCSSStyleSheet::checkNotify): Use CachedObjectClientWalker to walk the list.
(CachedScript::checkNotify): Ditto.
(CachedImage::do_notify): Ditto.
(CachedImage::movieStatus): Ditto.
(CachedImage::checkNotify): Ditto.
(CachedObjectClientWalker::next): Walk the list using a list iterator, which is
safe against the current item being removed. But go that safety one better by making
sure you don't miss the item after one that's removed.
2002-12-20 Ken Kocienda <kocienda@apple.com>
Reviewed by Darin
Fix for this bug:
Radar 3132171 (trying to login at mypage.apple.com gives "Already Connected" message)
The issue is that we submit the login form more than once when the user hits
the return key to submit rather than clicking the submit button. We are also
susceptible to double form submissions from buggy scripts that ask to submit
more than one form.
The fix is to prevent the KWQKHTMLPart from submitting more than one form by
setting and checking a flag.
* kwq/KWQKHTMLPart.h: Add a form submit flag.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::submitForm): Check form submit flag. Return if a form
has already been submitted.
(KWQKHTMLPart::setView): Reset form flag. This is done since the part
may have been retrieved for reuse from the bac/forward cache.
2002-12-20 Richard Williamson <rjw@apple.com>
Fixed 3133261. This fix really has two parts. This first part
fixes the stupid stack allocated buffer that caused the crash.
The second part makes any RenderText with a large string perform
much faster. The page mentioned in the bug used to load and draw
in about 15 minutes. Now it loads in about 10 seconds and draws in about
2 seconds. The performance optimization caches a widths array
for the string in the RenderText, and only updates that array if
the font or text for the RenderText change.
Reviewed by john.
* khtml/rendering/render_text.cpp:
(RenderText::RenderText):
(RenderText::setStyle):
(RenderText::~RenderText):
(RenderText::computeWidths):
(RenderText::widthFromBuffer):
(RenderText::trimmedMinMaxWidth):
(RenderText::calcMinMaxWidth):
(RenderText::setText):
(RenderText::width):
* khtml/rendering/render_text.h:
2002-12-20 Trey Matteson <trey@apple.com>
We now build with symbols the B&I. Deployment builds are without symbols,
so it is easy to generate a non-huge app as a one-off.
Reviewed by Darin
* WebCore.pbproj/project.pbxproj:
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3129824 -- crash in QWidget::getView in KWQKHTMLPart::passSubframeEventToSubframe
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::passWidgetMouseDownEventToWidget):
Check for a nil QWidget in a RenderWidget, and ERROR and return true in that case.
We don't want to return false because otherwise the KHTML code will try to draw a frame splitter.
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3131449 -- crash in DOMNamedNodesCollection::tryGet opening a new window from JavaScript
* khtml/ecma/kjs_dom.cpp: (DOMNamedNodesCollection::tryGet):
Add range checking. If the index is out of range fall back to the parent tryGet,
which will eventually just return Undefined().
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by Richard and John.
- fixed 3133207 -- crash in HTMLFrameElementImpl updateForNewURL at home.real.com
This refines Maciej's fix for 3052113, 3075392, and 3125412.
* khtml/html/html_baseimpl.h: Remove detach() and parentWidget from HTMLFrameElementImpl.
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::HTMLFrameElementImpl): Take out initialization of unused parentWidget.
(HTMLFrameElementImpl::updateForNewURL): Add case for when we are attached by did not allocate
a render object. In that case we just detach so we can attach again. Also fix the self-reference
check which was in there but not working.
(HTMLFrameElementImpl::detach): Remove method since all it did was set unused parentWidget.
(HTMLIFrameElementImpl::attach): Remove unused depth computation.
- fixed more leaks
* khtml/rendering/render_replaced.h: Made the deref method inherited from khtml::Shared
private by using private inheritance. Changed the name of arenaDeref to deref, but it still
takes an arena parameter. Now incorrect deref's are compile-time errors instead of potential leaks.
* khtml/rendering/render_replaced.cpp:
(RenderWidget::detach): Rename arenaDeref to deref.
(RenderWidget::resizeWidget): Ditto.
(RenderWidget::eventFilter): Ditto.
(RenderWidget::deref): Ditto.
* khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked):
Pass the arena when deref'ing the RenderFormElement.
* kwq/WebCoreBridge.h: Add a field for the arena for the RenderPart.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge dealloc]): Pass the arena when deref'ing the RenderPart.
(-[WebCoreBridge setRenderPart:]): Pass the arena when deref'ing the RenderPart. Store the arena
of the new part when storing the part pointer.
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::~DocumentImpl): Assert that the render object is
not nil, in an attempt to catch a leak I observed yesterday.
2002-12-20 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3129129 -- leak of 820 RenderStyle objects each time we run cvs-base
The RenderStyle objects were the tip of an iceberg.
I fixed a lot of leaks, but there are still some remaining.
Note that these changes will make Development builds slower because they disable
the arena allocator in favor of assertions that check we are using it correctly.
But the changes make Deployment builds slightly faster.
* khtml/html/html_baseimpl.cpp: (HTMLFrameSetElementImpl::attach):
Fix a leak in the !isStyleAvailable() case by ref'ing and deref'ing the style.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::attach): Fix a leak by getting the style from the render
object instead of calling styleForElement again, which makes a new one.
(HTMLFormElementImpl::parseAttribute): Ditto.
(HTMLInputElementImpl::attach): Fix a leak by using the style in the local
variable rather than calling styleForElement again.
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::parseAttribute): Fix a leak by getting the style from the render
object instead of calling styleForElement again, which makes a new one.
(HTMLImageElementImpl::attach): Fix a leak by using the style in the local
variable rather than calling styleForElement again.
* khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
Fix a leak in the display() == NONE case by ref'ing and deref'ing the style.
* khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::attach): Fix a leak by using
the style in the local variable rather than calling styleForElement again.
* khtml/rendering/bidi.cpp:
(BidiIterator::detach): Added debugging code to detect if someone does a delete directly,
which will not deallocate the object because it won't run the correct arena code.
(BidiIterator::operator delete): Ditto.
(appendRunsForObject): Fix a leak by detaching bidi iterators when they are removed from
the list. The list can't delete them because it doesn't have the arena pointer.
(deleteMidpoints): Fix a leak by not removing the items from the list until done iterating.
The old code would fail to delete half the items.
* khtml/rendering/render_container.cpp:
(RenderContainer::detach): Detach the continuation here. Before we removed it but did not
detach it, which led to a leak.
(RenderContainer::removeChild): Do not remove the continuation here. If we do, then we can't
detach successfully. No one depends on this removing the continuation.
(RenderContainer::removeLeftoverAnonymousBoxes): Detach the child, don't just delete it.
This fixes a leak.
* khtml/rendering/render_flow.cpp: (RenderFlow::removeChild): Detach the child, don't just
delete it. This fixes a leak.
* khtml/rendering/render_object.h: Added arenaDelete.
* khtml/rendering/render_object.cpp:
(RenderObject::operator delete): Added debugging code to detect if someone does a delete directly,
which will not deallocate the object because it won't run the correct arena code.
(RenderObject::detach): Ditto.
(RenderObject::arenaDelete): Put the low-level delete here, so that subclasses (RenderWidget)
can call it.
* khtml/rendering/render_replaced.h: Add arenaDeref and make deref private so derived classes
won't use it by accident.
* khtml/rendering/render_replaced.cpp:
(RenderWidget::detach): Use the new arenaDeref instead of deref, since we need to pass the
arena pointer in to delete.
(RenderWidget::resizeWidget): Ditto. Store the arena before calling back, since we can't get it
once it's detached from its parent.
(RenderWidget::eventFilter): Ditto.
(RenderWidget::arenaDeref): Added. Calls RenderObject's arenaDelete.
- other changes
* khtml/rendering/render_arena.cpp:
(RenderArena::allocate): Added debugging code that stores a signature, arena pointer, and size,
and uses malloc rather than the arena.
(RenderArena::free): Check the signature, arena pointer, and size, and use free.
* khtml/rendering/render_layer.cpp:
(RenderLayer::operator delete): Added debugging code to detect if someone does a delete directly,
which will not deallocate the object because it won't run the correct arena code.
(RenderLayer::detach): Ditto.
(RenderLayer::RenderLayerElement::operator delete): Ditto.
(RenderLayer::RenderLayerElement::detach): Ditto.
(RenderLayer::RenderZTreeNode::operator delete): Ditto.
(RenderLayer::RenderZTreeNode::detach): Ditto.
* khtml/rendering/render_text.cpp:
(TextSlave::detach): Added debugging code to detect if someone does a delete directly,
which will not deallocate the object because it won't run the correct arena code.
(TextSlave::operator delete): Ditto.
* khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
Save one new/delete by using a stack-based HTMLTokenizer and add FIXMEs about
some possible leaks I spotted here.
* khtml/rendering/render_list.cpp: (RenderListItem::setStyle): Took out APPLE_CHANGES from around
a generally useful bug fix.
* WebCore.pbproj/project.pbxproj: Let Electron be Electron.
=== Alexander-42 ===
2002-12-19 David Hyatt <hyatt@apple.com>
Fix for 3129393, crasher on sundancecatalog.com. There
are two elements to this fix. The basic problem was that
sundancecatalog was saying:
<table style="display: inline">
In WinIE, this turns into an inline-table and not an inline.
In Gecko this does not happen. Like Gecko, we treated this
as an inline, so we triggered a problem in my inline splitting
code.
The first fix was to bulletproof my inline splitting code to
ensure all new render objects are fully connected before children
are added, so that you can get to renderArenas at all times.
The second fix implements the WinIE quirk and turns the table
into an inline-table so that you avoid a complete garbage
render tree.
Reviewed by trey
* khtml/css/html4.css:
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
(RenderFlow::splitFlow):
(RenderFlow::addChildToFlow):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_list.cpp:
(RenderListMarker::lineHeight):
* khtml/rendering/render_list.h:
* khtml/rendering/render_object.cpp:
(RenderObject::createObject):
* khtml/rendering/render_table.cpp:
(RenderTable::lineHeight):
(RenderTable::baselinePosition):
(RenderTable::setStyle):
* khtml/rendering/render_table.h:
2002-12-19 Darin Adler <darin@apple.com>
Reviewed by John.
A number of non-reproducible bugs look like they may be due to bad
event objects. I was assuming that callers retained the events until
the functions handling them returned, but that assumption may be wrong.
So I'm retaining/releasing the current event. This is correct in any case.
I'm also adding a new assertion, but since assertions are in Development
builds only that is very low risk.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::keyEvent): Add retain/release and a new assertion.
(KWQKHTMLPart::mouseDown): Ditto.
(KWQKHTMLPart::mouseDragged): Ditto.
(KWQKHTMLPart::mouseUp): Ditto.
(KWQKHTMLPart::mouseMoved): Ditto.
=== Alexander-41 ===
2002-12-18 Richard Williamson <rjw@apple.com>
Added an ASSERT to ensure that 3127329 isn't still happening.
This bug should have been fixed be earlier changes.
Reviewed by darin.
* kwq/KWQPageState.mm:
(-[KWQPageState dealloc]):
2002-12-18 Chris Blumenberg <cblu@apple.com>
Fixed: 3131267 - REGRESSION: Java 1.4.1 Applets Restarted When Window is Resized
Fixed: 3131244 - REGRESSION: Java 1.4.1 Multiple Copies of Applet Started When Window is Resized
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 would create a new java view for each layout. We now only create a java view when the java view hasn't already been created.
Reviewed by darin.
* kwq/KWQKJavaAppletWidget.mm:
(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.
=== Alexander-40 ===
2002-12-18 Trey Matteson <trey@apple.com>
3098388 - Pressing the back button goes back two levels at allmusic.com
In support of the fix for this bug, WebCore passes khtml's lockHistory setting
up through the bridge.
Reviewed by Darin
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::redirectionTimerStartedOrStopped): Pass it along.
* kwq/WebCoreBridge.h:
2002-12-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3131171 - Change Alex versions to satisfy both marketing and B&I requirements
* English.lproj/InfoPlist.strings:
2002-12-18 Maciej Stachowiak <mjs@apple.com>
Reviewed by Trey and Darin.
- fixed 3124933 - abcnews.com leads to empty window with sheet complaining about javascript: URL
- fixed 3091248 - picture does not show up in window from epinions
* khtml/ecma/kjs_window.cpp:
(Window::get): Put back document-creating code that was in #if
!APPLE_CHANGES.
(Window::isSafeScript): Extend access to a window that was opened
to no URL or to about:blank by the active window.
(shouldLoadAsEmptyDocument): Helper for the above.
(WindowFunc::tryCall): Update APPLE_CHANGES comments - now it's
clear we don't need to create a document in a fresh window
(accessing document will take care of that), and that it will be
counter-productive, possibly adding a useless entry to the
back/forward list.
* khtml/khtml_part.cpp:
(KHTMLPart::begin): If we're not loading a URL, make a dummy
document (the call will check if we have a dummy document
already).
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::createEmptyDocument): Isntead of setting up a
half-assed document, ask bridge to synchronously load a fully
assed (but empty) document. Renamed from createDummyDocument.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::openURLRequest): Decode script. Also,
check if return value is a string - if so, write it into the
document. Maybe we want this to be more general.
* kwq/KWQKURL.mm:
(KURL::KURL): Changed to successfully resolve absolute URLs
against an empty base URL.
* kwq/WebCoreBridge.h: prototyped new
loadEmptyDocumentSynchronously method.
2002-12-18 Chris Blumenberg <cblu@apple.com>
Fixed: 3052731 - qt file complains about lack of active-x handler
Fixed: 3025872 - Black square where lion should be on mgm.com
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 quicktime. I added a quicktime mapping as well as a mapping for shockwave.
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 strange thing was that it was setting the main URL of the plug-in to "dummy". The code has this comment:
url = "dummy"; // Not needed, but KHTMLPart aborts the request if empty
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.
Reviewed by trey.
* khtml/rendering/render_frames.cpp:
(RenderPartObject::updateWidget):
2002-12-18 Trey Matteson <trey@apple.com>
3105755 - can't log in to amex
The problem was on c/r khtml would not pick a submit button to add to the
form state that is sent. We now "activate" the first submit button that meets the
criteria for being a "successful" form element, if no button was already
activated by being clicked on.
Reviewed by Darin.
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::submit): Pick a submit button to use, if none was already
chosen by virtue of being clicked.
(HTMLButtonElementImpl::isSuccessfulSubmitButton): New getter to support
submit button selection.
(HTMLButtonElementImpl::isActivatedSubmit): New getter on existing prop.
(HTMLButtonElementImpl::setActivatedSubmit): New setter on existing prop.
(HTMLInputElementImpl::isSuccessfulSubmitButton): New getter to support
submit button selection.
(HTMLInputElementImpl::isActivatedSubmit): New getter on existing prop.
(HTMLInputElementImpl::setActivatedSubmit): New setter on existing prop.
* khtml/html/html_formimpl.h: Add new methods to common superclass.
2002-12-17 Don Melton <gramps@apple.com>
Reviewed by Joyce Chow.
* khtml/misc/arena.cpp:
* khtml/misc/arena.h:
* khtml/rendering/render_arena.cpp:
* khtml/rendering/render_arena.h:
* khtml/rendering/render_layer.cpp:
* khtml/rendering/render_layer.h:
Changed copyright and licensing.
2002-12-17 David Hyatt <hyatt@apple.com>
NOWRAP was completely broken. This fixes the problem
and makes porsche.com look ok again.
Bug #3131287.
Reviewed by gramps
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
2002-12-17 Darin Adler <darin@apple.com>
Reviewed by Trey.
* WebCore.pbproj/project.pbxproj: Remove signature.
* kwq/KWQColor.mm: Turn off inlining so we can build even on the
compiler that warns about static data in inline functions.
2002-12-17 Maciej Stachowiak <mjs@apple.com>
Reviewed by John.
- fixed 3120729 - HOMEPAGE: Can't set a DIV innerHTML property
with html content starting with <html><head><head/><body>
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::createContextualFragment): Pop <html> and
<body>, and remove <head> to allow a full HTML document to be made
and inserted as a contextual fragment.
=== Alexander-39 ===
2002-12-17 David Hyatt <hyatt@apple.com>
Make sure that anonymous block construction works properly
when you try to insert a block in between two inlines that
have already been wrapped in an anonymous block.
Reviewed by mjs
* khtml/rendering/render_flow.cpp:
(RenderFlow::addChildToFlow):
(RenderFlow::makeChildrenNonInline):
=== Alexander-38 ===
2002-12-16 Darin Adler <darin@apple.com>
Reviewed by Don and Maciej.
- fixed 3129115 -- need Apple copyright added to open source documents
* tons of files: Added copyright message to files we modified and
standardized format of copyrights too.
- fixed 3129235 -- assert in LRUList visiting apple.com if "Display images" preference is off
* khtml/misc/loader.cpp:
(Cache::getLRUListFor): Use the first list for 0-sized objects.
(Cache::removeFromLRUList): Allow 0-sized objects.
- other changes
* khtml/rendering/render_style.h: Remove bogus unused private constructor.
* kwq/KWQFont.h: Added copy constructor and assignment operator.
* kwq/KWQFont.mm:
(QFont::QFont): Copy constructor now retains the NSFont. The old version didn't which could
cause retain/release problems.
(QFont::operator=): Retain the new NSFont and release the old one.
* WebCore.pbproj/project.pbxproj: Set MACOSX_DEPLOYMENT_TARGET to 10.2.
2002-12-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3125283 - HOMEPAGE: in onload of an IMG, the width and height are equal to zero
There were two problems here. First, the calls to get image width
and height didn't force a layout in all the cases where it was
required. Second, layout wouldn't lay out images at all until
parsing was done, due to a hack to block inline layout until that
point. I'm not sure if this will have other bad consquences, but
nearly every page I tried, including Hebrew and Japanese pages as
well as every page on the base PLT laid out properly.
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::width): Force a layout if not laid out.
(HTMLImageElementImpl::height): Likewise.
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode): Remove setBlockBidi hack - this was
preventing images from getting laid out until the document was
totally done parsing.
* khtml/rendering/render_flow.cpp:
(RenderFlow::RenderFlow): More setBLockBidi removal.
(RenderFlow::layout): Likewise.
(RenderFlow::close): Likewise.
(RenderFlow::addChildToFlow): Likewise.
(RenderFlow::printTree): Likewise.
* khtml/rendering/render_flow.h:
* khtml/rendering/render_object.h:
2002-12-16 David Hyatt <hyatt@apple.com>
When a clear occurs (thus causing a block to move underneath
a float), make sure the block gets a fresh layout, so that it
can readjust its contents now that they don't have to flow
around the float.
Reviewed by darin
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
2002-12-16 Richard Williamson <rjw@apple.com>
Fixed 3128477. Check KJS::Window before saving js objects.
Reviewed by darin.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::saveWindowProperties):
(KWQKHTMLPart::saveLocationProperties):
(KWQKHTMLPart::restoreWindowProperties):
(KWQKHTMLPart::restoreLocationProperties):
=== Alexander-37 ===
2002-12-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3125412 - HOMEPAGE: 2nd load of html in the same div fails.
- fixed 3052113 - HOMEPAGE: "site menu" part of .mac home page editing doesn't work
- fixed 3075392 - HOMEPAGE: "pages" section of mac.com homepage editing is missing
* khtml/html/html_baseimpl.h:
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::updateForNewURL): Function that loads new URL,
to be called if src attribute is set explicitly and the element is already
attached.
(HTMLFrameElementImpl::parseAttribute): Call updateForNewURL when src
attrinute is set.
(HTMLFrameElementImpl::contentDocument): Don't involve render widget
in getting the content document.
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::createContextualFragment): Allow contextual
fragments to be created (and therefore innerHTML to be set on) TR
and HTML elements.
2002-12-16 David Hyatt <hyatt@apple.com>
Use the layer's bounds as the damage rect not the object's.
The layer knows about the overflow out of the object. The
object does not. Duh.
Fixes disney.com bustage.
Reviewed by sullivan
* khtml/rendering/render_layer.cpp:
(RenderLayer::constructZTree):
2002-12-16 David Hyatt <hyatt@apple.com>
Code needs to go in calcMinMaxWidth instead, so parents computing
their own minmax widths will get the correct value during the ifrst
pass. With this change weather.com is actually fixed.
Reviewed by mjs
* khtml/rendering/render_box.cpp:
(RenderBox::calcWidth):
* khtml/rendering/render_flow.cpp:
(RenderFlow::calcMinMaxWidth):
2002-12-16 David Hyatt <hyatt@apple.com>
Fix for 3128843, horked layout on weather.com. Ensure that
overflow: hidden elements bounds-check their minwidth and maxwidth
values to ensure that you don't grow the clipped element.
Reviewed by mjs
* khtml/rendering/render_box.cpp:
(RenderBox::calcWidth):
2002-12-16 Trey Matteson <trey@apple.com>
3129175 - we're doing needless GETs when using b/f cache
Turns out that an empty UserStyle was causing WebCore to reload the base URL
of the page, since it tried to load the style "".
Reviewed by Darin
* khtml/khtml_part.cpp:
(KHTMLPart::reparseConfiguration): Of the UserStyle is empty, set it to an
empty string instead of an empty URL.
2002-12-16 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3129008 - REGRESSION: Successive hot/cached runs of cvs-base PLT are slightly slower
This was due to me reintroducing a leak of the document. Now fixed.
* khtml/ecma/kjs_dom.cpp:
(DOMDocument::~DOMDocument): forget self from cached DOM object table.
(KJS::getDOMDocumentNode): Instead of storing the document in the
marked per-document table, store it in the unmarked table, and as
a property on the Window object.
(KJS::getDOMNode): use getDocumentNode when appropriate.
* khtml/ecma/kjs_dom.h:
2002-12-15 David Hyatt <hyatt@apple.com>
Fix for 3128728. Ensure that list markers get placed into an
existing line box if possible. This patch also fixes RTL bullets
and line height calculations involving image bullets that are the
biggest thing on the line. List markers also correctly move
to avoid floats.
Reviewed by mjs
* khtml/rendering/render_list.cpp:
(RenderListItem::setStyle):
(getLineBoxParent):
(RenderListItem::layout):
(RenderListMarker::calcMinMaxWidth):
2002-12-16 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3128766 -- macconnection.com tries to add properties to the navigator DOM object, which fails
* khtml/ecma/kjs_window.cpp: (Window::get): Set up properties named navigator and clientInformation
the first time either is queried. These will hold a persistent shared object rather than making one
every time it's asked for.
* WebCore.pbproj/project.pbxproj: Let Electron undo Maciej's evil.
=== WebKit-37u2 ===
2002-12-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
* WebCore.pbproj/project.pbxproj: Updated source version to 37u2.
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed regression where clicked-on buttons were getting keyboard focus
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMousePressEvent): Check clickCount here the way NSWindow does.
See below for rationale.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): I didn't read the code in
[NSWindow sendEvent:] that I was stealing carefully enough. The old needsPanelToBecomeKey
flag is used to decide whether something should really get first responder, and I need to
do check that too. And while I was in here, did the same clickCount check that NSWindow
does for good measure.
2002-12-15 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3128383 - DOM nodes should always use the same JS object
* khtml/ecma/kjs_binding.h:
* khtml/ecma/kjs_binding.cpp:
(ScriptInterpreter::ScriptInterpreter): Set auto-delete to true on
document dictionary.
(ScriptInterpreter::getDOMObjectForDocument): New function - gets
DOM object from per-document dictionary.
(ScriptInterpreter::putDOMObjectForDocument): New function - put
DOM object into per-document dictionary.
(ScriptInterpreter::deleteDOMObjectsForDocument): Clear all
objects from specific per-document dictionary.
(ScriptInterpreter::mark): Mark per-document objects.
(ScriptInterpreter::forgetDOMObjectsForDocument): Clear objects
for this document from all interpreters.
* khtml/ecma/kjs_dom.h:
* khtml/ecma/kjs_dom.cpp:
(KJS::getDOMNode): Use per-document rather than general DOM object
dictionary.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::~DocumentImpl): Call forgetDOMObjectsForDocument.
2002-12-15 David Hyatt <hyatt@apple.com>
Fix for 3057974 and 3128713. I needed to make frames check to
see if their parentNode had a renderer to complete the FOUC
fix. Completing the FOUC fix finally solves 3057974.
Reviewed by darin
* khtml/html/html_baseimpl.cpp:
(HTMLFrameElementImpl::attach):
2002-12-15 David Hyatt <hyatt@apple.com>
Fix for 3109226, epinions page is mostly blank. Add a hack
to disallow > but only inside attribute values for which there
is no corresponding attribute name.
Also fix attribute values with no name so that the value is
used as the name so that e.g., <option "selected"> works.
Reviewed by darin
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::HTMLTokenizer):
* khtml/html/htmltokenizer.h:
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed 3127900 -- REGRESSION: text fields select all their text when clicked on with the mouse
* kwq/KWQKHTMLPart.h: Add _firstResponderAtMouseDownTime.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::khtmlMousePressEvent): Don't call makeFirstResponder: if it's already set.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Using _firstResponderAtMouseDownTime, catch the
case where an NSTextField's editor was just created and became first responder. In those cases,
pass the mouseDown: to the text field, not the newly created editor. Even though it shouldn't make
a difference it does. Also don't makeFirstResponder: if it's already set.
(KWQKHTMLPart::mouseDown): Set _firstResponderAtMouseDownTime.
* kwq/KWQWidget.mm: (QWidget::setFocus): Don't call makeFirstResponder: if it's already set.
2002-12-15 David Hyatt <hyatt@apple.com>
Make sure framesets don't get built twice when FOUC delays
their loading.
Reviewed by gramps
* khtml/css/cssstyleselector.cpp:
* khtml/css/cssstyleselector.h:
* khtml/html/html_baseimpl.cpp:
(HTMLFrameSetElementImpl::attach):
* khtml/rendering/render_style.cpp:
(RenderStyle::operator==):
(RenderStyle::isStyleAvailable):
* khtml/rendering/render_style.h:
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Dave.
- fixed ==/= typo in QFontMetrics that caused a part of my recent speedup to not take effect
- fixed 3128582 -- REGRESSION: Crash on planetquake.com
* kwq/KWQFontMetrics.mm:
(QFontMetricsPrivate::setFont): Fix a horrifying "== instead of =" mistake.
(QFontMetrics::ascent): Give an ERROR message, don't crash, when this is called on a
font metrics object that hasn't been updated to work for a particular font.
(QFontMetrics::descent): Ditto.
(QFontMetrics::lineSpacing): Ditto.
(QFontMetrics::xHeight): Ditto.
(QFontMetrics::width): Ditto.
(QFontMetrics::floatWidth): Ditto.
(QFontMetrics::floatCharacterWidths): Ditto.
* khtml/html/html_inlineimpl.cpp: (HTMLBRElementImpl::attach):
Eliminated what was causing us to hit the above. BR elements need to respect display() == NONE.
- fixed the fix for operator==; needs to work even if the pseudo type was
extracted already for one of the two, and not the other
* khtml/css/cssparser.cpp:
(CSSSelector::extractPseudoType): Only do work when the selector is Pseudo.
(CSSSelector::operator==): Call pseudoType() instead of going right at _pseudoType.
2002-12-15 David Hyatt <hyatt@apple.com>
Fix for 3128402, missing content on voodooextreme. Don't allow
object/embed inside the head.
Reviewed by cblu
* khtml/html/dtd.cpp:
2002-12-15 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3127898 -- Crash going to altavista.com after visiting sony.com
* khtml/ecma/kjs_window.cpp: (Window::get): Change lots of properties to return "undefined"
rather than crashing when the view is NULL. I'm not sure that undefined is the perfect thing
to return in this case, but it's better than crashing the program. We can refine later as needed.
- fixed 3127157 -- REGRESSION: applet does not become first responder when clicked-on
- fixed 3127934 -- Crash in KWQKHTMLPart::widgetWillReleaseView scrolling around
* kwq/KWQKHTMLPart.h: Get rid of widgetWillReleaseView(). Add mouseDownViewIfStillGood().
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Call makeFirstResponder: in the same way that
the NSWindow does before delivering a mouseDown: message. This oversight caused the applet problem.
(findViewInSubviews): Added.
(KWQKHTMLPart::mouseDownViewIfStillGood): Added. Gets _mouseDownView, but then checks that it's
still a subview before returning it. A little inefficient, but the only way to do it given that
there's no general way to find out that an NSView is being removed from your view hierarchy or deallocated.
This fixes the crash in widgetWillReleaseView.
(KWQKHTMLPart::khtmlMouseMoveEvent): Use mouseDownViewIfStillGood() instead of _mouseDownView directly.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Ditto.
(KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
* kwq/KWQWidget.mm:
(QWidget::~QWidget): Remove call to widgetWillReleaseView().
(QWidget::setView): Ditto.
2002-12-15 David Hyatt <hyatt@apple.com>
operator== on CSSSelectors needed to be updated to compare
_pseudoTypes. A nice subtle bug from the mega-patch.
Reviewed by mjs
* khtml/css/cssparser.cpp:
(CSSSelector::operator == ):
2002-12-15 David Hyatt <hyatt@apple.com>
Fix for 3128429, sans-serif font got broken. Just a typo
from darin's mega-patch.
Reviewed by mjs
* khtml/css/cssstyleselector.cpp:
2002-12-14 Darin Adler <darin@apple.com>
Reviewed by Maciej and Dave.
- optimizations that improve speed; total is 13.8% on cached cvs-base on my machine
* khtml/css/css_valueimpl.h: Add isKonqBody() and genericFamilyType() to find out if
a font is a standard one. This is much faster than doing string comparisons all the time.
* khtml/css/css_valueimpl.cpp: (FontFamilyValueImpl::FontFamilyValueImpl):
Check the font names against the standard ones on time when the FontFamilyValueImpl
object is constructed rather than every time the stuff is matched.
* khtml/css/cssparser.h: Add pseudoType() and extractPseudoType() to CSSSelector so we
don't have to do string compares all the time.
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseValue): Use QConstString in a way that's effective (with an
object that has a long enough lifetime), or don't use it at all.
(StyleBaseImpl::parseContent): Ditto.
(StyleBaseImpl::preprocess): Preprocess into a buffer, usually on the stack, rather than
using QString += QChar over and over again.
(CSSSelector::extractPseudoType): Convert the value string into a type, and get rid of it.
Saves memory because the string goes away. And doing it once is much faster than string
comparing each time.
* khtml/css/cssstyleselector.cpp:
(cleanPath): Restructure to save one find() in the common case.
(checkPseudoState): Restructure to avoid some DOMString creation/destruction in the case
where the tag is not an <A>. Also use QConstString correctly.
(CSSStyleSelector::checkOneSelector): Use the new pseudoType() instead of string compares.
(CSSStyleSelector::applyRule): Use isKonqBody() and genericFamilyType() instead of string
comparisons.
* khtml/dom/dom_string.h: Make the destructor non-virtual. This was a big win, and a mistake
the way it was before. Also make the DOMString constructor with no parameters inline.
* khtml/dom/dom_string.cpp:
(DOMString::string): Don't use QConstString here, since it does no good.
(DOM::operator==): Rewrite to do things faster and avoid calling strlen.
* khtml/html/html_objectimpl.h: Don't use QConstString in places where it does harm and no good.
* khtml/html/html_objectimpl.cpp: (HTMLEmbedElementImpl::parseAttribute): Use QConstString properly.
* khtml/html/htmltokenizer.cpp:
(tagMatch): Added.
(HTMLTokenizer::parseSpecial): Change tokenizing so it doesn't construct temporary strings (with
QConstString) just to compare small substrings.
* khtml/khtml_part.cpp: (KHTMLPart::write): Don't use a decoder object when source is all ASCII.
* kwq/KWQColor.mm:
(hex2int): Don't bother with uppercase hex since we always lowercase anyway.
(QColor::setNamedColor): Use a new gperf-based table instead of an NSDictionary to look up colors.
* kwq/KWQColorData.c: Added this autogenerated file.
* kwq/KWQColorData.gperf: Added. Source file with list of colors and color values.
* kwq/Makefile.am: Build KWQColorData.c from KWQColorData.gperf.
* WebCore.pbproj/project.pbxproj: Added KWQColorData.gperf.
* khtml/misc/helper.cpp: (khtml::setNamedColor): Don't call setNamedColor again with the lowercased
color name, since our QColor::setNamedColor already has to lowercase the name (because it has to check
all names before checking any hex values).
* khtml/rendering/font.h: Don't initialize the QFontMetrics since in every case we end up changing
the font later anyway. Also remove unused field.
* khtml/rendering/font.cpp: (Font::update): Use the new QFontMetrics::setFont for speed.
* khtml/rendering/render_object.cpp: (RenderObject::enclosingLayer): Change it so it doesn't get
the layer twice. This function showed up on the sample so we know it's hot.
* khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::containsOnlyWhitespace): Did a faster implementation
that doesn't call QChar::direction() except for non-ASCII characters.
* kwq/KWQFontMetrics.h: Add empty constructor for use in font.cpp. Add accessor and setter for the
font too. Made baselineOffset() inline since it's trivial.
* kwq/KWQFontMetrics.mm:
(QFontMetricsPrivate::QFontMetricsPrivate): Don't make the renderer until we use it.
(QFontMetricsPrivate::getRenderer): Make it here.
(QFontMetricsPrivate::font): Added.
(QFontMetricsPrivate::setFont): Added. Dumps the renderer if the font is different.
(QFontMetrics::QFontMetrics): Added empty constructor.
(QFontMetrics::setFont): Added.
* kwq/KWQKURL.mm: (KURL::parse): Avoid function call overhead calling strncasecmp and strncmp.
Also made the check for localhost case insensitive.
* kwq/KWQString.h: Remove _isUnicodeInternal and _isAsciiInternal, since they are trivially
computed, and it saves time to not have that extra field to manipulate. Removed private
data() function since it's the same as *dataHandle and not really more clear. Made ascii()
and unicode() simpler and inline. Also made latin1() and getCFString() inline. Renamed
QStringData to KWQStringData.
* kwq/KWQString.mm:
(QStringData::QStringData): Remove initializers for the xxxInternal.
(QStringData::initialize): Removed some unnecessary if statements, and made a slight improvement
in the case of a 0-length string that comes with a pointer for Unicode (can't do it in the
char * case because it's a feature that's used).
(QString::makeSharedNull): No need to set _isUnicodeInternal.
(QStringData::~QStringData): Use the new functions instead of the old bits.
(QStringData::increaseAsciiSize): Grow faster when we get to larger sizes where the "good size"
call doesn't have as much of an effect. Simplified by removing unneeded code.
(QStringData::increaseUnicodeSize): Ditto.
(QStringData::makeAscii): Update for removal of _isAsciiInternal.
(QStringData::makeUnicode): Update for removal of _isUnicodeInternal.
(QString::detachIfInternal): Add this new inline to speed things up for the common case where
there's no detaching needed.
(QString::at): Simplify, there were excess if branches here.
(QString::toDouble): Use kjs_strtod and don't copy the string using QCString for additional speed.
(QString::lower): Don't detach if the string is already all lowercase. Added a FIXME about the
code that assumes all "ASCII" bytes are truly ASCII. This code blurs the distinction between Latin-1
and ASCII in a way that will not work right for Latin-1 characters in an 8-byte character QString.
(QString::detachInternal): Update for removal of _isUnicodeInternal.
(QString::detach): Removed a special case for shared_null that was dead code since shared_null has
the _isUnicodeValid flag set.
(operator==): Rewrote the comparison with char * to avoid the costly call to strlen.
* Makefile.am: Updated the rules here so the force clean timestamp works right.
* force-clean-timestamp: Touched this since the header dependencies don't seem right
for the DOMString constructor change, at least.
* WebCore-tests.exp: Exported a symbol now needed by tests since QString does more inlining.
* WebCore-combined.exp: Re-generated.
2002-12-14 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- slightly improved situation with 3124933 (abcnews.com leads to
empty window with sheet complaining about javascript: URL); the
popup window still comes up empty but it doesn't put up a sheet.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::openURLRequest): Handled "javascript:"
URLs here.
2002-12-14 David Hyatt <hyatt@apple.com>
Fix insidemacgames.com. Reinstate rules I removed
and fix other rules to be !important so that the
td[align=right] rules won't affect child tables
with align=center.
Reviewed by gramps
* khtml/css/html4.css:
2002-12-14 David Hyatt <hyatt@apple.com>
Fix for 3016385, menus on webreference.com don't show up.
Fixes to make webreference.com menus show up. This involved
fixing layers to not clip positioned objects when overflow:hidden
is set, fixing the stupid clip/sync layout hack for livepage
so that it doesn't break webreference, and implementing
navigator.productSub (right now the date is set to
Christmas 2002).
Reviewed by gramps/maciej.
* khtml/ecma/kjs_navigator.cpp:
(Navigator::getValueProperty):
* khtml/ecma/kjs_navigator.h:
* khtml/ecma/kjs_navigator.lut.h:
* khtml/rendering/render_box.cpp:
(RenderBox::getOverflowClipRect):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
(RenderLayer::nodeAtPoint):
(RenderLayer::constructZTree):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.cpp:
(RenderObject::setLayouted):
* khtml/rendering/render_object.h:
2002-12-14 Ken Kocienda <kocienda@apple.com>
Reviewed by Maciej
Fix for this bug:
Radar 3128159 (Netscape non-standard DOM event attribute "which" unsupported)
* khtml/dom/dom2_events.cpp:
(UIEvent::which): Added which() definition.
* khtml/dom/dom2_events.h: Added declarations for which() functions in UIEvent.
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Added which property.
* khtml/ecma/kjs_events.h: Ditto.
* khtml/ecma/kjs_events.lut.h: File regenerated.
2002-12-13 Richard Williamson <rjw@apple.com>
Fixed 3127310 and 3127920.
Implemented findWordBoundary. We now correctly detect word boundaries.
This function makes use of carbon unicode utilities.
With help from hyatt, made selection correctly account for render
continuations. This fixes many of the 'unable to select' issues.
Reviewed by trey and hyatt.
* khtml/khtml_events.cpp:
(khtml::MouseEvent::offset):
* khtml/khtml_part.cpp:
(findWordBoundary):
(KHTMLPart::khtmlMousePressEvent):
(KHTMLPart::khtmlMouseMoveEvent):
* khtml/rendering/render_object.cpp:
(RenderObject::checkSelectionPoint):
* khtml/rendering/render_object.h:
* khtml/rendering/render_text.cpp:
(RenderText::checkSelectionPoint):
* khtml/rendering/render_text.h:
2002-12-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Don.
- fixed build.
* ForwardingHeaders/rendering/render_layer.h: Added.
2002-12-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Don.
- fixed 3114737 - DHTML image content mispositioned on lexus.com
* khtml/dom/dom2_events.cpp:
(UIEvent::layerX): Added to support nonstandard Mozilla
event.layerX property.
(UIEvent::layerY): Added to support nonstandard Mozilla
event.layerY property.
* khtml/dom/dom2_events.h:
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Implemented layerX and layerY
* khtml/ecma/kjs_events.h:
* khtml/ecma/kjs_events.lut.h:
* khtml/xml/dom2_eventsimpl.cpp:
(MouseEventImpl::MouseEventImpl): Added call to computeLayerPos.
(MouseEventImpl::computeLayerPos): Compute layer position.
(MouseEventImpl::layerX): Added.
(MouseEventImpl::layerY): Added.
(MouseEventImpl::initMouseEvent): Added call to computeLayerPos.
* khtml/xml/dom2_eventsimpl.h:
2002-12-13 David Hyatt <hyatt@apple.com>
Fix for 314799, image at wired.com doesn't show up. Block
level replaced floating elements were being treated as though
they didn't float.
Reviewed by gramps
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
2002-12-13 David Hyatt <hyatt@apple.com>
Fix for 3098045.
Do not treat XHTML-style tags e.g., <br/> or <table/> as
self-closing. This is absolutely wrong, and it does not
match the behavior of other browsers. According to the HTML4
spec for parsing, / is an erroneous character and should simply
be dropped, so <table/> should be treated like <table>.
Fixes for crashes on glazman's blog and on tantek's blog. Both
still mis-render, but at least they don't crash.
Reviewed by gramps (and darin too)
* khtml/html/htmltokenizer.cpp:
* khtml/rendering/render_container.cpp:
* khtml/rendering/render_style.cpp:
=== Alexander-37u1 ===
2002-12-13 David Hyatt <hyatt@apple.com>
Two fixes. Bugs are 3121024, which had to do with handling
escaped characters in the CSS content property, and
bug 3127375 (44854 in bugs.kde.org), which had to do with
making sure table cells relayout properly when images load
async.
Reviewed by darin and john
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseContent):
(StyleBaseImpl::isHexadecimal):
* khtml/css/cssparser.h:
* khtml/rendering/bidi.cpp:
(RenderFlow::layoutInlineChildren):
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_flow.h:
2002-12-13 Darin Adler <darin@apple.com>
Reviewed by Trey.
- moved KWQFontFamily and KWQPageState to new homes
* kwq/KWQFontFamily.h: Added.
* kwq/KWQFontFamily.mm: Added.
* kwq/KWQPageState.h: Added.
* kwq/KWQPageState.mm: Added.
* WebCore.pbproj/project.pbxproj: Added new source files.
* kwq/KWQFont.h: Removed KWQFontFamily.
* kwq/KWQFont.mm: Removed KWQFontFamily.
* kwq/WebCoreBridge.mm: Removed KWQPageState.
2002-12-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- fixed 3083814 - dhtml at www.bayarea.com doesn't hide on some mouse movements
* khtml/ecma/kjs_events.h:
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Implemented pageX and pageY properties.
* khtml/ecma/kjs_events.lut.h: Regenerated.
* khtml/dom/dom2_events.h:
* khtml/dom/dom2_events.cpp:
(UIEvent::pageX): Get x coordinate if a mouse event.
(UIEvent::pageY): Get y coordinate if a mouse event.
2002-12-13 Richard Williamson <rjw@apple.com>
Fixed 3127225. Set WebCore object cache size when first bridge is created.
Reviewed by gramps.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge init]):
2002-12-13 Darin Adler <darin@apple.com>
Reviewed by John.
Overall speedup on cvs-base is about 5%.
- reduce QString use in the tokenizer and tighten up QString implementation for a speedup
- fix up the QFontFamily implementation, using new QString features too, for a speedup
* khtml/html/htmltokenizer.h: Take const QString & instead of QString to avoid an extra copy.
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::begin): Use QString::null instead of "" for QString objects; faster.
(HTMLTokenizer::scriptHandler): In APPLE_CHANGES, use new prepend that avoids the need to
create a temporary QString. Use QString::null instead of QString() for a null string, and
also made other small fixes to avoid temporary QStrings.
(HTMLTokenizer::setSrc): Take const QString & instead of QString to avoid an extra copy.
* kwq/KWQFont.h: Rename QFontFamily to KWQFontFamily. Make family() inline, add inline
familyIsEmpty(). Change KWQFontFamily to store both the QString for the family and the
NSString instead of only the NSString to avoid constant conversions back and forth.
Remove type cases in CREATE_FAMILY_ARRAY that could result in copying the font object.
* kwq/KWQFont.mm:
(KWQFontFamily::KWQFontFamily): Fix bug where a copied family object would have a random
ref count instead of a ref count of 0. Also update for NSString change.
(KWQFontFamily::operator=): Use the ref before deref algorithm instead of the check for
self-assignment.
(KWQFontFamily::getNSFamily): Compute the NSString for the family name here. To avoid
making an NSString every time, use a CFDictionary with QString as a key and NSString as
a value instead of using an NSSet.
(KWQFontFamily::setFamily): Invalidate the NSString family when the QString family is
changed. Moved the code to make things unique to getNSFamily.
(KWQFontFamily::operator==): Call getNSFamily rather than
* kwq/KWQString.h: Added a prepend and insert overload that take a QChar pointer and length, for
use in the tokenizer, and a hash function, for use in CFDictionary. Also added a global set of
CFDictionaryKeyCallBacks.
* kwq/KWQString.mm:
(QString::prepend): New overload calls new insert overload.
(QString::insert): Old insert slightly tightened by calling detach() only after the early exit
and removing an extra detach from a function that already does forceUnicode. Added the new insert
that takes a QChar * and a length.
(operator==): Rewrite this so that it is efficient and doesn't involve creating a QString temporary
or doing a function call.
(QString::hash): Wrote this. Used the same hash algorithm I did in my recent KJS work.
(retainQString): Added. For use in CFDictionaryKey callback.
(releaseQString): Added. For use in CFDictionaryKey callback.
(describeQString): Added. For use in CFDictionaryKey callback.
(equalQString): Added. For use in CFDictionaryKey callback.
(hashQString): Added. For use in CFDictionaryKey callback.
* khtml/rendering/font.h: Change name to KWQFontFamily.
* khtml/rendering/font.cpp: (Font::update): Call familyIsEmpty() instead of family().isEmpty()
to avoid making and destroying a QString every time. Also put this batch of KWQFontFamily-specific
changes inside #if APPLE_CHANGES. Much to my dismay, we have others elsewhere that aren't ifdef'd.
* khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): Change name to KWQFontFamily.
Clearly this code needs some #if APPLE_CHANGES, and changing the class name helps make that clear.
- change KHTMLSettings so using it doesn't require copying QStrings for a speedup
* kwq/KWQKHTMLSettings.h: Made all the functions static members to avoid the unnecessary
overhead of passing a this pointer. Added lots of setXXX functions for use by the WebCoreSettings
code that gets called by WebKit when settings are changed. Return objects by reference because we
can and it avoids copying QString objects.
* kwq/KWQKHTMLSettings.mm: Changed all the functions in here to return the same global object
each time, and made the set functions update those globals.
* kwq/WebCoreSettings.mm: All the setters now call through to KHTMLSettings set functions.
- fixed 3126513 -- crash in KWQKHTMLPart::clearTimers() deallocating KWQPageState
- did some cleanup in the bridge and the part; part of the process of moving real work out of the bridge
* kwq/KWQKHTMLPart.h: Rearrange things to be a little more logical. Mark isFrameSet() const.
added an attributedString function here so it's not inside WebCoreBridge. Added an overload
of clearTimers that takes a view parameter.
* kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Mark this const.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::clearTimers): Add the overload that takes the view parameter.
(KWQKHTMLPart::attributedString): Moved this code in here from the bridge.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge selectedAttributedString]): Call the attributedString function in its new home in
KWQKHTMLPart.
(-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
(-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
Take a const KURL & instead of a KURL to avoid unnecessary copying.
(-[KWQPageState dealloc]): Call the new clearTimers that takes a view parameter. This should fix the
crash in autorelease pool deallocation mentioned above.
2002-12-13 David Hyatt <hyatt@apple.com>
Fix for 3121865, content missing at disney.com. Make
sure blocks track width overflow as well as height
overflow and ensure that a layer's dimensions expand
to encompass both width and height overflow.
Also fixes a bug with line breaking that allowed unbreakable
words to actually be broken up when they were the only word
on a line. This is wrong and differs from all other
browsers, so the patch in bidi.cpp fixes us to match
other browsers. (This was required to fix the above bug.)
Reviewed by mjs.
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
* khtml/rendering/render_flow.cpp:
(RenderFlow::RenderFlow):
(RenderFlow::layout):
(RenderFlow::layoutBlockChildren):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::updateLayerPosition):
* khtml/rendering/render_object.cpp:
(RenderObject::nodeAtPoint):
* khtml/rendering/render_object.h:
* khtml/rendering/render_table.h:
2002-12-12 Richard Williamson <rjw@apple.com>
Fixed 3116584. Made letter-spacing, word-spacing, and text-decoration play
well together.
Reviewed by hyatt.
Changes made with trey to enable to release of page cache from the
"Empty Cache" menu item in Alex.
Reviewed by trey.
* khtml/rendering/font.cpp:
(Font::drawLineForText):
(Font::drawText):
* khtml/rendering/font.h:
* khtml/rendering/render_text.cpp:
(TextSlave::paintDecoration):
(RenderText::paintObject):
* khtml/rendering/render_text.h:
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::drawLineForText):
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge dealloc]):
(-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
(-[KWQPageState invalidate]):
(-[KWQPageState dealloc]):
* kwq/WebCoreTextRenderer.h:
2002-12-12 Ken Kocienda <kocienda@apple.com>
Reviewed by Maciej and Darin
Final fix for this bug:
Radar 3062858 (REGRESSION: failed login at www.usaa.com doesn't return error text)
We were down to a case where submitting the login form with the return key
failed since we did not implement either non-standard keyCode (IE-style) or
which (Netscape-style) UI event extension for getting the value of a key
press. The form submission code depended on sensing the value of the
key press by checking one of these properties.
Since the "which" property also can be used for mouse events, and fixing
this bug could be done by implementing either keyCode or which, I chose
to implement keyCode only.
* khtml/dom/dom2_events.cpp: Added keyCode function definition.
* khtml/dom/dom2_events.h: Added keyCode function declaration.
* khtml/ecma/kjs_events.cpp:
(DOMUIEvent::getValueProperty): Added new KeyCode attribute.
* khtml/ecma/kjs_events.h: New generated file.
* khtml/ecma/kjs_events.lut.h: Ditto.
* khtml/xml/dom2_eventsimpl.cpp:
(KeyEventImpl::KeyEventImpl): Fixed a bug in khtml that prevented the
m_keyVal field on KeyEventImpl from ever being set correctly.
I guess I am the first person ever to care about that value. :-)
=== Alexander-36 ===
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3126042 -- Failure to send onkeypress event on key down causes forms to submit incorrectly
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::keyEvent): Fixed the code to send the second event with repeat
set equal to true. Before it was constructing the event but never sending it because result was true.
Also fixed a problem where it was considering sending a second mouse up event. What we're doing here
is a bit of a hack and probably should be fixed -- it seems that the behavior in dispatchKeyEvent where
it sends only a down and not a press for the a non-autorepeat event is a KHTML bug that we should fix
instead of work around eventually.
- fix to something that made this harder to debug
* khtml/xml/dom2_eventsimpl.cpp: (KeyEventImpl::KeyEventImpl): Logging the type was showing the wrong
type, and I narrowed it down to this code here. Changing m_id after the fact doesn't change the type
string, so you need to compute the correct ID and pass it to the constructor.
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Ken.
- fixed 3125886 -- Failure to set document onkeypress handler causes return key to submit forms incorrectly
The handler was getting ignored because the property setting code never got to the DOMNode level.
* khtml/ecma/kjs_dom.cpp: (DOMDocument::tryPut): Pass correct parent class, DOMNode, instead
of DOMObject. By passing DOMObject, we skipped all the properties inherited from DOMNode,
including onkeypress.
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Trey and Ken.
- fixed 3125613 -- REGRESSION: resizing frames after clicking on scroll bar doesn't work right
The problem was that the mouse dragged events were going to the scroll bar because the new click
on the frame resizer didn't fall into the code path that sets _mouseDownView.
* kwq/KWQKHTMLPart.h: Add override of khtmlMouseMoveEvent.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Don't set _mouseDownView. This is now handled
at the higher level when the mouseDown comes in.
(KWQKHTMLPart::khtmlMouseMoveEvent): Added. Pass along mouseDragged: events. I didn't have this
before because I don't want or need to pass mouseMoved: events along, but the KHTML mouse move
event corresponds to both AppKit mouseDragged and mouseMoved.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Don't clear _mouseDownView. This is now handled at the
higher level when the mouseUp comes in.
(KWQKHTMLPart::passSubframeEventToSubframe): Ditto.
(KWQKHTMLPart::mouseDown): Set _mouseDownView to nil; it will be set by passWidgetMouseDownEventToWidget
if we end up passing the event down. This is the change that actually fixes the bug mentioned above.
(KWQKHTMLPart::mouseUp): Set _mouseDownView to nil after handling the mouseUp. It's OK if we don't
clear this out in cases where we don't get a mouseUp event -- we'll get a mouseDown later -- but it's
still probably a good idea to clear it when we know the mouse is no longer down.
- used update-kwq-assert to update the code that's a shared copy of WebFoundation code
* kwq/KWQAssertions.m: (vprintf_stderr_objc): Got the UTF-8 fix I did a while back.
2002-12-12 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
* force-js-clean-timestamp: Update for JavaScriptCore changes.
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Maciej.
- fixed 3125504 -- REGRESSION: Selection not working correctly for text area on http://glish.com/css/7.asp
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::khtmlMousePressEvent): Call makeFirstResponder here explicitly,
since we are disabling the makeFirstResponder that normally happens during window event dispatching
in WebKit.
* kwq/KWQScrollView.h: Define getDocumentView().
* kwq/KWQScrollView.mm: Use getDocumentView() everywhere.
(QScrollView::getDocumentView): Define it here.
2002-12-12 Darin Adler <darin@apple.com>
Reviewed by Maciej and Richard.
- fixed 3125497 -- REGRESSION: Infinite recursion with mouseUp: events
The problem was that events could end up back at the same part due to the responder chain.
* kwq/KWQKHTMLPart.h: Added mouseDown, mouseDragged, mouseUp, mouseMoved, buttonForCurrentEvent,
and stateForCurrentEvent. Remove setCurrentEvent and currentEvent. Renamed handleMouseDownEventForWidget
to passWidgetMouseDownEventToWidget. John and I had agreed to this name change before the last commit,
but I forgot.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Initialize _sendingEventToSubview to false. No need to initialize
_mouseDownWasInSubframe at all since it's only looked at when _mouseDownView is non-nil.
(KWQKHTMLPart::keyEvent): Save and restore _currentEvent instead of setting to nil.
Use stateForCurrentEvent instead of stateForEvent:.
(KWQKHTMLPart::khtmlMousePressEvent): Name change.
(KWQKHTMLPart::khtmlMouseDoubleClickEvent): Name change.
(KWQKHTMLPart::passWidgetMouseDownEventToWidget): Name change. Set _sendingEventToSubview when
sending event to subview.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Name change. Set _sendingEventToSubview when sending
event to subview.
(KWQKHTMLPart::passSubframeEventToSubframe): Name change. Set _sendingEventToSubview when
sending event to subview.
(KWQKHTMLPart::buttonForCurrentEvent): Added. Similar to code I moved here from WebCoreBridge.
(KWQKHTMLPart::stateForCurrentEvent): Added. Similar to code I moved here from WebCoreBridge.
(KWQKHTMLPart::mouseDown): Added. Similar to code I moved here from WebCoreBridge, except returns
and does nothing if _sendingEventToSubview is set.
(KWQKHTMLPart::mouseDragged): Ditto.
(KWQKHTMLPart::mouseUp): Ditto.
(KWQKHTMLPart::mouseMoved): Added. Similar to code I moved here from WebCoreBridge.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge mouseDown:]): Just call _part->mouseDown().
(-[WebCoreBridge mouseDragged:]): Just call _part->mouseDragged().
(-[WebCoreBridge mouseUp:]): Just call _part->mouseUp().
(-[WebCoreBridge mouseMoved:]): Just call _part->mouseMoved().
* kwq/WebCoreBridgePrivate.h: Removed.
* WebCore.pbproj/project.pbxproj: Removed WebCoreBridgePrivate.h.
2002-12-12 Richard Williamson <rjw@apple.com>
Fixed 3125583. Don't redraw view under resize bar
on mouseup.
Reviewed by gramps.
* khtml/rendering/render_frames.cpp:
(RenderFrameSet::userResize):
2002-12-11 David Hyatt <hyatt@apple.com>
Fix hang on monkeyvoodoo.net and on skramkoob.com. The bugs
are 3105714 and 3045965. Also fix margin collapsing churn
on thestar by not laying out a second time when collapsing
margins make you move unless you contain floats.
Reviewed by: gramps
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren);
2002-12-11 Richard Williamson <rjw@apple.com>
Fixed 3124121, 3124716 (and other dupes). Regressions related to b/f crash.
Reviewed by hyatt.
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::openURLFromPageCache):
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge dealloc]):
(-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
2002-12-11 Darin Adler <darin@apple.com>
Reviewed by Richard.
- fixed 3124263 -- REGRESSION: Crash running development build of PLT
* kwq/KWQWidget.mm:
(QWidget::~QWidget): Don't worry about the outer view here, since we can never hit one of those.
Just pass the view to KWQKHTMLPart::widgetWillReleaseView.
(QWidget::getOuterView): Re-add the assertion I had removed.
- fixed 3124837 -- Crash trying to handle weird javascript URL in page address field
* kwq/KWQKURL.mm: (KURL::decode_string): Made this function return the URL still encoded
rather than a null string (actually, crashing) when CFURLCreateStringByReplacingPercentEscapes
rejects the passed-in string. Also updated the FIXME.
(appendEscapingBadChars): Fixed problem with high-bit-set characters.
* kwq/KWQString.mm: (QString::setBufferFromCFString): Made this tolerant of NULL.
2002-12-11 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed handling of mouse events so I could turn the mechanism on all the way
- fixed anomalies in the red-painting-for-null-view-detection
- fixed 3123105 -- REGRESSION: Crash in KHTMLView::unscheduleRelayout on exit
- fixed 3124047 -- REGRESSION: crash in KWQKHTMLPart::handleMouseDownEventForWidget at nwa.com
* kwq/KWQKHTMLPart.h: Add setCurrentEvent()/currentEvent()/_currentEvent back, because we can
end up doing a lot of work and processing a lot of events before we get around to handling the
current event, so [NSApp currentEvent] won't cut it. Also add clearTimers, passSubframeEventToSubframe,
an overload for handleMouseDownEventForWidget, and _mouseDownWasInSubframe boolean.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::submitForm): Use _currentEvent.
(KWQKHTMLPart::urlSelected): Use _currentEvent.
(KWQKHTMLPart::paint): Fixed red-drawing-for-debug code by using KWQPainter instead of going
directly to the AppKit level.
(KWQKHTMLPart::keyEvent): Moved the check for null node up a bit, and set _currentEvent.
(KWQKHTMLPart::handleMouseDownEventForWidget): Break into two pieces, so we can share the
code with the new passSubframeEventToSubframe. Set _mouseDownWasInSubframe to false
when setting _mouseDownView. Use getView() instead of getOuterView() since we really don't
care about the WebView after all. Use _currentEvent. Add a check for nodes that lack a renderer
to fix the crash at nwa.com above.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Use _currentEvent.
(KWQKHTMLPart::clearTimers): Added. Checks for null view, which fixes the crash on exit above.
(KWQKHTMLPart::passSubframeEventToSubframe): Added. Checks for the categories of events that we
can pass to subframes, which are mouse down, up, and dragged events, and passes them along.
This is the main fix that makes subframes work properly.
* khtml/khtmlview.cpp:
(KHTMLView::viewportMousePressEvent): Add call to the new passSubframeEventToSubframe.
(KHTMLView::viewportMouseDoubleClickEvent): Ditto.
(KHTMLView::viewportMouseMoveEvent): Ditto.
(KHTMLView::viewportMouseReleaseEvent): Ditto.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge saveDocumentToPageCache]): Call clearTimers on the part now, instead of the document.
(-[WebCoreBridge mouseUp:]): Call setCurrentEvent.
(-[WebCoreBridge mouseDown:]): Ditto.
(-[WebCoreBridge mouseMoved:]): Ditto.
(-[WebCoreBridge mouseDragged:]): Ditto.
(-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]): Call clearTimers on the
part now, instead of the document.
- other changes
* khtml/ecma/kjs_window.lut.h: Let this be regenerated. I think I accidentally checked
in an obsolete version of this earlier.
* khtml/html/html_documentimpl.h: Remove clearTimers(). We don't need it here in APPLE_CHANGES.
* khtml/html/html_documentimpl.cpp: Ditto.
* khtml/khtmlpart_p.h: Removed unneeded APPLE_CHANGES. We don't use m_frameNameId any more, nor
do we need m_savingPageState or m_restoringPageState.
* khtml/khtml_part.cpp: (KHTMLPart::clear): Removed unneeded APPLE_CHANGES, now that we don't
use m_frameNameId any more.
* kwq/KWQWidget.mm: (KWQWidget::getOuterView): Tolerate nil for view here, so we can use this from
the QWidget destructor.
2002-12-11 Darin Adler <darin@apple.com>
Rolled out changes I accidentally checked in last night.
2002-12-10 John Sullivan <sullivan@apple.com>
Fixed more "Alexander"s that were lurking in places I forgot
to look before.
Reviewed by Darin
* Makefile.am:
"rm -rf $(SYMROOTS)/Safari.app/Frameworks/WebCore.framework"
2002-12-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Don.
- really fixed 3123727 - SJ: Viewmaster arm sometimes doesn't animate on
http://www.pixar.com/howwedoit/
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Call Cache::init before
KHTMLPart::init so we have a loader to connect the signals to.
2002-12-10 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3123727 - SJ: Viewmaster arm sometimes doesn't animate on
http://www.pixar.com/howwedoit/
* khtml/khtml_part.cpp:
(KHTMLPart::KHTMLPart): Don't call KHTMLPart::init at all...
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Call it here instead so that signal
connections happen properly.
2002-12-10 David Hyatt <hyatt@apple.com>
Fix for 3116996. My hack to make selects ignore fixed CSS
widths that are smaller than their intrinsic width was not
good. Remove the hack.
Reviewed by darin
* khtml/rendering/render_box.cpp:
(RenderBox::calcReplacedWidth):
2002-12-10 Darin Adler <darin@apple.com>
Reviewed by John.
- fixed 3108912 -- onclick handlers not supported on form elements
We now pass the events back to the NSView here in WebCore; they pass through all the
machinery in the DOM before getting sent on.
* kwq/KWQKHTMLPart.h: Add widgetWillReleaseView and handleMouseDownEventForWidget functions,
overrides for khtmlMousePressEvent, khtmlMouseDoubleClickEvent, khtmlMouseReleaseEvent, and
a new _mouseDownView field.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Initialize _mouseDownView to nil.
(KWQKHTMLPart::khtmlMousePressEvent): Call handleMouseDownEventForWidget, but if it returns
false call through to the base class function.
(KWQKHTMLPart::khtmlMouseDoubleClickEvent): Ditto.
(KWQKHTMLPart::handleMouseDownEventForWidget): Do a hit test to find out which view to send
the mouse down event to, and then send it.
(KWQKHTMLPart::khtmlMouseReleaseEvent): Send the mouse up event to the view we sent a mouse
down event to, or call through to the base class otherwise.
(KWQKHTMLPart::widgetWillReleaseView): Clear out the _mouseDownView field if the view is
being released by the QWidget that owns it.
* kwq/KWQWidget.mm:
(QWidget::~QWidget): Call KWQKHTMLPart::widgetWillReleaseView.
(QWidget::setView): Call KWQKHTMLPart::widgetWillReleaseView on the old view.
2002-12-09 Darin Adler <darin@apple.com>
Reviewed by Maciej.
* WebCore.pbproj/project.pbxproj: Bump versions to 0.8 and 35u.
2002-12-09 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed 3117734 - fail at document.releaseEvents in js at rollingstone.com
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocFunction::tryCall): Added no-op implementations of
captureEvents and releaseEvents.
(KJS::HTMLDocument::tryGet):
* khtml/ecma/kjs_html.h:
* khtml/ecma/kjs_window.cpp:
(Window::get, WindowFunc::tryCall): Added no-op implementation of
releaseEvents.
* khtml/ecma/kjs_window.h:
* khtml/ecma/kjs_html.lut.h: Regenerated.
* khtml/ecma/kjs_window.lut.h: Regenerated.
2002-12-09 David Hyatt <hyatt@apple.com>
Fix for the CSS test suite link. Need to make sure inlines
that are obscured by blocks are properly considered to be
above the block background.
* khtml/rendering/render_object.cpp:
(RenderObject::nodeAtPoint):
2002-12-09 Darin Adler <darin@apple.com>
Reviewed by Trey.
- made KWQKHTMLPart a subclass of KHTMLPart so we can override virtual functions
* khtml/khtml_part.h: Get rid of kwq pointer.
* khtml/khtml_part.cpp:
(KHTMLPart::init): No need to make a KWQKHTMLPart any more.
(KHTMLPart::~KHTMLPart): No need to delete a KWQKHTMLPart any more.
(KHTMLPart::closeURL): KWQKHTMLPart does saveDocumentState in an override now.
(KHTMLPart::begin): KWQ() instead of ->kwq.
(KHTMLPart::checkCompleted): KWQ() instead of ->kwq, and ifdef out some unneeded code.
(KHTMLPart::urlSelected): KWQ() instead of ->kwq.
(KHTMLPart::requestFrameName): KWQ() instead of ->kwq.
(KHTMLPart::processObjectRequest): Just call openURL, since we are now KWQKHTMLPart.
(KHTMLPart::submitForm): KWQ() instead of ->kwq.
(KHTMLPart::popupMenu): Did a bit more ifdef'int out here.
* kwq/KWQKHTMLPart.h: Include "khtml_part.h" and remove includes we don't need any more.
Inherit from KHTMLPart instead of QObject. Remove KHTMLPart parameter from constructor.
Override openURL and closeURL. Remove part and d pointers. Add KWQ() inline to avoid casting.
* kwq/KWQKHTMLPart.mm:
(KHTMLPart::completed): KWQ() instead of ->kwq.
(KHTMLPart::openURL): Never reached now, since we override.
(KHTMLPart::setStatusBarText): KWQ() instead of ->kwq.
(KHTMLPart::started): KWQ() instead of ->kwq.
(KWQKHTMLPart::KWQKHTMLPart): No need to deal with separate part.
(KWQKHTMLPart::bridgeForFrameName): KWQ() instead of ->kwq.
(KWQKHTMLPart::openURL): Add bool return value so we can override the existing openURL.
(KWQKHTMLPart::slotData): Remove unneeded part->.
(KWQKHTMLPart::setView): Remove unneeded part->.
(KWQKHTMLPart::document): Remove unneeded part->.
(KWQKHTMLPart::renderer): Remove unneeded part->.
(KWQKHTMLPart::userAgent): Remove unneeded part->.
(KWQKHTMLPart::nextKeyViewInFrame): KWQ() instead of ->kwq.
(KWQKHTMLPart::nextKeyViewInFrameHierarchy): KWQ() instead of ->kwq.
(KWQKHTMLPart::canCachePage): Remove unneeded part->.
(KWQKHTMLPart::saveWindowProperties): Use this instead of part.
(KWQKHTMLPart::saveLocationProperties): Use this instead of part.
(KWQKHTMLPart::restoreWindowProperties): Use this instead of part.
(KWQKHTMLPart::restoreLocationProperties): Use this instead of part.
(KWQKHTMLPart::openURLFromPageCache): Remove unneeded part->.
(KWQKHTMLPart::partForNode): KWQ() instead of ->kwq.
(KWQKHTMLPart::updatePolicyBaseURL): Remove unneeded part->.
(KWQKHTMLPart::setPolicyBaseURL): Remove unneeded part->.
(KWQKHTMLPart::createDummyDocument): Use this instead of part.
(KWQKHTMLPart::scrollToAnchor): Remove unneeded part->.
(KWQKHTMLPart::closeURL): Added. Calls saveDocumentState().
* kwq/WebCoreBridge.h: Use KWQKHTMLPart instead of KHTMLPart.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge init]): Make a KWQKHTMLPart.
Use _part instead of _part->kwq in the rest of the file.
* kwq/KWQSignal.mm: (KWQSignal::disconnect): Add the names of a few signals that are
disconnected after the KWQKHTMLPart part of the KHTMLPart is destroyed, to avoid noise.
* khtml/ecma/kjs_navigator.cpp: (Navigator::getValueProperty): KWQ() instead of ->kwq.
* khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::initScript): KWQ() instead of ->kwq.
* khtml/ecma/kjs_window.cpp:
(Window::scheduleClose): KWQ() instead of ->kwq.
(WindowFunc::tryCall): KWQ() instead of ->kwq.
* khtml/xml/dom_docimpl.cpp: (DocumentImpl::setTitle): KWQ() instead of ->kwq.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::openURLRequest): KWQ() instead of ->kwq.
(KHTMLPartBrowserExtension::createNewWindow): KWQ() instead of ->kwq.
(KHTMLPartBrowserExtension::setIconURL): KWQ() instead of ->kwq.
(KHTMLPartBrowserExtension::setTypedIconURL): KWQ() instead of ->kwq.
* kwq/KWQKJavaAppletWidget.mm: (KJavaAppletWidget::showApplet): KWQ() instead of ->kwq.
* kwq/KWQLoader.mm:
(KWQServeRequest): Cast to KWQKHTMLPart instead of casting to KHTMLPart and doing ->kwq.
(KWQCheckIfReloading): Ditto.
(KWQCheckCacheObjectStatus): Ditto.
* WebCore.pbproj/project.pbxproj: Let Electron punish the wicked.
2002-12-09 Richard Williamson <rjw@apple.com>
Many changes for b/f list.
1. Always attempt to cache snap back items.
2. Lazily release resources from page cache. This garners gains on the PLT (and presumably iBench) tests, both for uncached.
3. Set the page cache size to 4 (+ snap back items). After releasing resources we hover around 28MB footprint. Closing windows releases all resources.
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.
5. Addition of lazy update to PLT memory statistics to show footprint after lazy release of page cache resources.
6. Delayed to leak detector to account for lazy release of resources.
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.
8. A change to ensure a layout when restoring a page from the b/f cache. Without this fix scrollbars wouldn't appear correctly.
9. A change to ensure that khtmlview layout and paint timers are unscheduled when a page is placed in the b/f cache.
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.
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.)
12. Reapply styles when loading page from cache. This ensures that visited link get the appropriate style.
Reviewed by kocienda.
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::clearTimers):
* khtml/html/html_documentimpl.h:
* khtml/khtmlview.cpp:
(KHTMLView::clearPart):
(KHTMLView::timerEvent):
* khtml/khtmlview.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::restoreRenderer):
(DocumentImpl::detach):
* khtml/xml/dom_docimpl.h:
* kwq/KWQKHTMLPageCache.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
(-[WebCoreBridge saveDocumentToPageCache]):
(-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
(-[KWQPageState dealloc]):
(-[KWQPageState KJS::]):
(-[KWQPageState khtml::]):
2002-12-08 Trey Matteson <trey@apple.com>
Fixed 3115903 - exchangehomes.com sometimes has form state poorly restored
KHTML is much smarter about restoring form state now, taking into account element names and
types instead of blindly blasting data by simple element ordering. We encode the name
and type at the front of the "state" strings that previously just held the value of the
element.
QString::endsWith() was just plain wrong. Looks like it had some copied code, but was
never really implemented.
Reviewed by: Darin Adler
* WebCore.pbproj/project.pbxproj: PB is hellbent on adding "shouldUseHeadermap = 0;"
* khtml/html/html_formimpl.cpp:
(encodedElementName): Utility func to encode an element name, escaping amp and lt
(HTMLGenericFormElementImpl::state): Build the prefix of an element's state string,
e.g. ELEMENT_NAME&ELEMENT_TYPE&
(HTMLGenericFormElementImpl::findMatchingState): Find a matching piece of state out of
the list of state strings that were previously saved.
(HTMLFieldSetElementImpl::type): Return our element type.
(HTMLInputElementImpl::state): Call super as part of building state string.
(HTMLInputElementImpl::restoreState): Use findMatchingState.
(HTMLLegendElementImpl::type): Return our element type.
(HTMLSelectElementImpl::state): Call super as part of building state string.
(HTMLSelectElementImpl::restoreState): Use findMatchingState.
(HTMLKeygenElementImpl::type): Return our element type.
(HTMLOptGroupElementImpl::type): Return our element type.
(HTMLOptionElementImpl::type): Return our element type.
(HTMLTextAreaElementImpl::state): Call super as part of building state string.
(HTMLTextAreaElementImpl::restoreState): Use findMatchingState.
* khtml/html/html_formimpl.h: type() is moved up to HTMLGenericFormElementImpl
* khtml/html/htmlparser.cpp:
(KHTMLParser::insertNode): Pass list of states to restoreState.
(KHTMLParser::popOneBlock): Pass list of states to restoreState.
* khtml/xml/dom_docimpl.h: Add method to return the whole list of form states.
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::restoreState): Nodes receive the whole list of form states to restore from,
not just a single state that has already been chosen.
* khtml/xml/dom_nodeimpl.h:
* kwq/KWQString.mm:
(QString::endsWith): Walk the search string correctly.
2002-12-09 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3103954 - preferences not displayed properly at excite.com
* khtml/html/html_formimpl.cpp:
(HTMLInputElementImpl::value): If a radio or checkbox input has a
value, return that rather than something based on the checked
state. Only fall back on the checked state if there is no value.
2002-12-09 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- fixed 3103036 - REGRESSION: scripts dropped from DOM tree;
javascript text rendered to screen
The problem here is that we don't allow SCRIPT inside MAP, so the
script tag gets thrown away in the DOM and the text is added
directly to the MAP. I can't see a good reason not to allow SCRIPT
here, so I think the best thing to do is relax the DTD.
* khtml/html/dtd.cpp:
(DOM::checkChild): Relax the DTD to allow SCRIPT inside MAP.
2002-12-08 David Hyatt <hyatt@apple.com>
Fix for 3007276, styles do not cascade properly through
tables. The font was being reset to the default font
(konq_default) when it needed to be reset to the body's font.
I added a new font family value called konq_body and the
style system resolves that value to be the body's font family list.
Reviewed by: gramps and mjs
* khtml/css/cssstyleselector.cpp:
* khtml/html/html_tableimpl.cpp:
(HTMLTableElementImpl::attach):
2002-12-08 David Hyatt <hyatt@apple.com>
Fix for 3121814. Forms inside table elements (tbody and table
etc.) can be inline. Just remove the assert and replace it
with a bailout.
Fix for 3036479. Tables with specified heights but cells
with no height (or no cells at all) were not honoring
the specified height.
Reviewed by: gramps
* khtml/rendering/render_table.cpp:
(RenderTable::RenderTable):
(RenderTable::startRow):
(RenderTable::layoutRows):
(RenderTable::paint):
(RenderTable::recalcCells):
2002-12-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Dave.
- fixed 2981252 - JavaScript inside <!-- --> comments inside <select> is not executed
This problem is caused by the hack to turn all whitespace into
spaces inside <select>, so that it's collapsed in the DOM. But
this is especially bad for scripts inside select tags, so I
changed the select special case to not apply inside scripts.
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::addPending):
(HTMLTokenizer::write):
2002-12-08 Darin Adler <darin@apple.com>
Reviewed by Don and Dave.
- fixed 3115845 -- bad-pointer crash destroying DOM tree reproducible at a particular site
All hail libgmalloc, without which this would just be another bug I can't reproduce!
This memory trasher bug was caused bug calling setChildrenLoaded after casting a node to
HTMLObjectElementImpl, when the node wasn't always an object element. It turns out that this
fix was made obsolete a while back when I changed close on renderers to be delivered even for
cases where the renderer is not created yet at close time.
* khtml/html/htmlparser.cpp: (KHTMLParser::processCloseTag): Remove the special case for
</object>. Now that this is fixed another way we don't need this at all.
* khtml/html/html_objectimpl.h: Remove setChildrenLoaded and m_childrenLoaded.
* khtml/html/html_objectimpl.cpp: (HTMLObjectElementImpl::HTMLObjectElementImpl):
Remove code that sets m_childrenLoaded to false.
(HTMLObjectElementImpl::attach): Remove code that looks at m_childrenLoaded, since we don't
need it any more (and in fact there's no way to set it any more).
- fixed 3120578 -- REGRESSION: going to about:blank creates null view
If no tokens are ever sent to the parser, then we end up without a render tree.
* khtml/html/htmlparser.h: Add finished() function.
* khtml/html/htmlparser.cpp: (KHTMLParser::finished): Make an HTML element if the document is still
empty at this point. This is identical to what KHTMLParser::insertNode does when you insert any kind
of element other than an HTML element.
* khtml/html/htmltokenizer.cpp: (HTMLTokenizer::end): Call finished() to let the parser know.
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::paint): Turn on the "paint red" feature in development builds.
Null view problems are particularly hard to debug without something like this, and we don't care
if development builds are ever-so-slightly slower. No change in deployment.
- fixed 3121527 -- crash in WebCoreBridge frameBorderStyle
* kwq/WebCoreBridge.mm: (-[WebCoreBridge frameBorderStyle]): Handle case where this is called and
we don't have a KHTMLView yet.
- other changes
* WebCore.pbproj/project.pbxproj: Electron is doing his thing.
2002-12-08 David Hyatt <hyatt@apple.com>
Fix for image bullets. They were neglecting to offset
themselves by their own width, and were just relying on
sheer luck (the default margin) to accommodate their
size. The bug is 3007040 (borkware.com).
Reviewed by: gramps
* khtml/rendering/render_list.cpp:
(RenderListMarker::paintObject):
2002-12-07 David Hyatt <hyatt@apple.com>
This change fixes three bugs in list items.
(1) Stop implementing markers as floats. This is simply
wrong. The bullet doesn't affect the height of the line
box if it's a float, and it can also affect other
list items that follow the bullet's enclosing list item
(leading to odd staggered layout of lists).
(2) Relax the DTD. It was trying to obey strict HTML, which
is hopeless in the case of lists. Match the behavior of
both Gecko and the IEs (mac and win32) and allow non-list
content to be inserted between list items without being
wrapped in its own list item. Lists were making empty
items for whitespace in between items, and this stops that
and makes our lists behave much more like Gecko and the IEs.
(3) The bullet's min and max width weren't getting set, which
could lead to confused line width calculations when image
bullets were used.
Reviewed by: gramps
* ChangeLog:
* khtml/html/dtd.cpp:
(DOM::checkChild):
* khtml/rendering/bidi.cpp:
(RenderFlow::findNextLineBreak):
* khtml/rendering/render_list.cpp:
(RenderListItem::setStyle):
(RenderListMarker::calcMinMaxWidth):
2002-12-07 Ken Kocienda <kocienda@apple.com>
Reviewed by: Maciej
Fix for this bug:
Radar 3073988 (URLs with /../ are not resolved before being sent to the host)
* kwq/KWQKURL.mm:
(KURL::KURL):
(copyPathRemovingDots): New function containing code that was pulled out of
the existing relative URL resolution code.
(KURL::parse): Call new copyPathRemovingDots function instead of doing same work
inline.
2002-12-06 David Hyatt <hyatt@apple.com>
Sigh. I forgot to commit the first layer fix (that has already
been reviewed), so now this is also including that.
The first layer fix was to deal with the yale.edu crasher.
It involved making sure that append/remove of render object
trees drill down into those trees to remove/append corresponding
layers (instead of just checking the root of the trees).
The second fix involves making sure that cliprects are right
for painting backgrounds and borders of clipped objects.
Fixes benoit's bug.
Reviewed by: mjs and darin (fix 1), mjs and gramps (fix 2)
* khtml/rendering/render_container.cpp:
(RenderContainer::removeChildNode):
(RenderContainer::appendChildNode):
(RenderContainer::insertChildNode):
* khtml/rendering/render_container.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::paint):
(RenderLayer::constructZTree):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.cpp:
(RenderObject::appendLayers):
(RenderObject::removeLayers):
(RenderObject::enclosingLayer):
* khtml/rendering/render_object.h:
2002-12-06 Maciej Stachowiak <mjs@apple.com>
Reviewed by: Darin
- fixed 3077227 - netflix "top 100" page JavaScript runs so
slowly, it seems like a hang
I fixed this by adding hash tables of image and form elements by
name and id. This allows scans of the whole document to be avoided
in many cases.
This also results in a small speedup (~1%) on cvs-js-ibench.
* khtml/dom/html_document.cpp:
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLDocument::hasProperty):
(KJS::HTMLDocument::tryGet):
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::addNamedImageOrForm):
(HTMLDocumentImpl::removeNamedImageOrForm):
(HTMLDocumentImpl::haveNamedImageOrForm):
* khtml/html/html_documentimpl.h:
* khtml/html/html_formimpl.cpp:
(HTMLFormElementImpl::attach):
(HTMLFormElementImpl::detach):
(HTMLFormElementImpl::parseAttribute):
* khtml/html/html_formimpl.h:
* khtml/html/html_imageimpl.cpp:
(HTMLImageElementImpl::parseAttribute):
(HTMLImageElementImpl::attach):
(HTMLImageElementImpl::detach):
* khtml/html/html_imageimpl.h:
2002-12-06 David Hyatt <hyatt@apple.com>
Hack to make i-bench paint every fourth page. We can tune
this # as needed.
Reviewed by: darin
* khtml/html/html_documentimpl.cpp:
(HTMLDocumentImpl::close):
* khtml/rendering/render_flow.h:
2002-12-06 Darin Adler <darin@apple.com>
Reviewed by Trey.
Update to latest character-sets document.
* kwq/character-sets.txt: Got the newest one and merged in our change.
* kwq/KWQCharsetData.c: Regenerated this. Added just one character set name.
2002-12-06 Darin Adler <darin@apple.com>
Reviewed by Maciej.
* khtml/ecma/kjs_events.h: Add listenerObjImp() method so we don't have to
ref/unref for speed-critical uses.
* khtml/ecma/kjs_window.cpp: (Window::getJSEventListener): Change this
to work with ObjectImp so we don't ref/unref each listener. This should give
us some extra speed.
2002-12-06 Maciej Stachowiak <mjs@apple.com>
Reviewed by: Darin Adler
- made framework embedding work correctly with buildit
* WebCore.pbproj/project.pbxproj: Give framework a relative
install path, don't install it the normal way, and copy it
manually to /AppleInternal/Library/Frameworks if installing. Also
look for other frameworks in
${DSTROOT}/AppleInternal/Library/Frameworks.
2002-12-06 Darin Adler <darin@apple.com>
Reviewed by Trey.
- fixed 3111903 -- crash in DOM::HTMLDocumentImpl::close
* khtml/html/html_documentimpl.cpp: (HTMLDocumentImpl::close):
Check for the case where view() is 0 so we don't do a null-dereference.
Also, remove some of the unneeded redundant isNull/isEmpty checking here.
2002-12-05 Darin Adler <darin@apple.com>
Reviewed by Don.
- fixed 3116149 -- REGRESSION: assert on invalid encoding trying to show accuweather.com source
The regression was caused when we updated the View Source window to try to get the encoding right.
* kwq/WebCoreBridge.mm: (+[WebCoreBridge stringWithData:textEncoding:]):
Make this function decode the string as Windows Latin-1 if the passed-in encoding is
invalid or ISO Latin-1, since that's what we always want.
* kwq/mac-encodings.txt: Add "8859_1" since we have now seen it "in the wild".
* kwq/KWQCharsetData.c: Check in new version of generated file.
2002-12-05 David Hyatt <hyatt@apple.com>
Fix for javadoc page. It specified an invalid unit, and our
unit match was on a substring, so it allowed "pts" when it
shouldn't. This patch adds some code to help handle this
error case.
Bug # is 3119830.
Reviewed by: rjw
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseUnit):
2002-12-05 Chris Blumenberg <cblu@apple.com>
Reviewed by: rjw
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge selectedString]): renamed to reflect WebDocument API change
(-[WebCoreBridge deselectAll]): added
(-[WebCoreBridge elementAtPoint:]): call selectedString
2002-12-05 David Hyatt <hyatt@apple.com>
Fix relative positioned elements to add in the right offset
when repainting themselves.
Reviewed by: darin
* khtml/rendering/render_box.cpp:
(RenderBox::repaintRectangle):
2002-12-05 Richard Williamson <rjw@apple.com>
Fixed two issues relating to font sizes. Fixes any page
that specifies font size in device independent units, i.e.
www.abcnews.com.
1. Change dpi to 72. Mac OS X does appear to assume 72, not 96!
2. Don't appply DPI adjustments to font selections, instead
normalize values to points. OS X takes care of device scaling.
Reviewed by: gramps
* khtml/css/css_valueimpl.cpp:
(CSSPrimitiveValueImpl::computeLengthFloat):
(CSSPrimitiveValueImpl::computePointFloat):
* khtml/css/css_valueimpl.h:
* khtml/css/cssstyleselector.cpp:
* kwq/KWQPaintDeviceMetrics.mm:
(QPaintDeviceMetrics::logicalDpiY):
2002-12-05 David Hyatt <hyatt@apple.com>
Make sure that blocks with block children compute their
minwidth and maxwidth correctly. This fixes 4-5 bugs on my
list, including the becblog.blogspot.com misrender and
the wrapping list item on webstandards.org.
The fix ensures that the margins of a child have been
computed before they are asked for by the parent in
calcBlockMinMaxWidth.
Also fix a bug in collapsing margins that caused the height
of positioned elements that contained only zero-height children
to not compute their heights correctly. We now pass tests 2
and 3 on the collapsing margin tests with this fix.
Reviewed by: trey
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
(RenderFlow::calcBlockMinMaxWidth):
2002-12-05 David Hyatt <hyatt@apple.com>
Fix for wsj.com orange underline regression. In quirks mode
only, don't let anchors without hrefs go into :hover. This
matches MacIE's behavior.
The bug is 3118643.
Reviewed by: mjs
* khtml/rendering/render_object.cpp:
(RenderObject::setHoverAndActive):
(RenderObject::nodeAtPoint):
* khtml/rendering/render_object.h:
* khtml/rendering/render_text.h:
2002-12-04 Maciej Stachowiak <mjs@apple.com>
Reviewed by: David Hyatt
- fixed 3118083 - WebCore includes config.h from Labyrinth top level
* Makefile.am: Regenerate config.h from top-level version, but
make sure not to alter date if it has not changed.
* config.h: Added (autogenerated but checked in for benefit of B&I).
* ForwardingHeaders/config.h: Include WebCore copy rather than
Labyrinth copy.
2002-12-04 Maciej Stachowiak <mjs@apple.com>
Reviewed by: David Hyatt
- fixed 3049601 - support the equivalent of
createcontextualfragment(NS6) or insertAdjacentHTML (IE)
- fixed 3108065 - DHTML at expedia.com doesn't work-- lack of
support for createContextualFragment
- fixed 3114627 - DHTML menus used in Yahoo mail don't work-- lack
of support for createContextualFragment
- improvement towards 3052113 - "site menu" part of .mac home page
editing doesn't work
* khtml/ecma/kjs_range.h:
* khtml/ecma/kjs_range.cpp:
(DOMRangeProtoFunc::tryCall): Added suppor for
createContextualFragment method.
* khtml/ecma/kjs_range.lut.h: Regenerated.
* khtml/dom/dom2_range.h:
* khtml/dom/dom2_range.cpp:
(Range::createContextualFragment): Implemented (calls impl).
* khtml/html/html_elementimpl.h:
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::createContextualFragment): Factored out of setInnerHTML.
(HTMLElementImpl::setInnerHTML): Call createContextualFragment to
make the fragment.
* khtml/xml/dom2_rangeimpl.h:
* khtml/xml/dom2_rangeimpl.cpp:
(RangeImpl::createContextualFragment): Implemented (calls start
container element).
2002-12-04 David Hyatt <hyatt@apple.com>
Fix assert on compuserve page. <form> under <table> should not
get a layout() call.
Reviewed by: gramps
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_table.cpp:
(RenderTable::layout):
2002-12-04 David Hyatt <hyatt@apple.com>
Fix shroudedisles.com table misalignment by removing more\
bogus rules from html4.css.
Fix forums on macosx.com by implementing support for the align
attribute on the <P> tag.
Implement min-width and max-width for block level floating
and normal flow elements.
Fix event handling so that :hover notifications get through to
objects inside floats.
Reviewed by: rjw
* khtml/css/html4.css:
* khtml/html/html_blockimpl.cpp:
(HTMLParagraphElementImpl::parseAttribute):
* khtml/html/html_blockimpl.h:
* khtml/rendering/render_box.cpp:
(RenderBox::calcWidth):
(RenderBox::calcWidthUsing):
(RenderBox::calcHeight):
* khtml/rendering/render_box.h:
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
(RenderFlow::nodeAtPoint):
* khtml/rendering/render_flow.h:
* khtml/rendering/render_frames.cpp:
(RenderFrameSet::nodeAtPoint):
* khtml/rendering/render_frames.h:
* khtml/rendering/render_image.cpp:
(RenderImage::nodeAtPoint):
* khtml/rendering/render_image.h:
* khtml/rendering/render_object.cpp:
(RenderObject::nodeAtPoint):
* khtml/rendering/render_object.h:
* khtml/rendering/render_root.cpp:
(RenderRoot::calcHeight):
* khtml/rendering/render_style.cpp:
(StyleBoxData::StyleBoxData):
* khtml/rendering/render_text.cpp:
(RenderText::nodeAtPoint):
* khtml/rendering/render_text.h:
2002-12-04 Darin Adler <darin@apple.com>
Reviewed by Trey and Maciej.
- fixed 3117558 -- Assertion failure in KWQKHTMLPart::slotData after typing "amazon.com" twice
- got rid of the per-part NSEvent in preparation for NSView mouse event handling going through WebCore
* khtml/khtml_part.h: Added declaration for didOpenURL.
* khtml/khtml_part.cpp: (KHTMLPart::openURL): Changed name to didOpenURL in the APPLE_CHANGES
version because calls to openURL from within KHTML need to make the round trip to WebKit.
Also disabled the "scroll to anchor" part.
* kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Fix to return false when document is 0.
* kwq/KWQKHTMLPart.h: Add scrollToAnchor, remove setCurrentEvent and _currentEvent
* kwq/KWQKHTMLPart.mm:
(KHTMLPart::openURL): Pass the openURL call to the KWQKHTMLPart.
(KWQKHTMLPart::KWQKHTMLPart): Don't initialize _currentEvent.
(KWQKHTMLPart::~KWQKHTMLPart): Don't release _currentEvent.
(KWQKHTMLPart::submitForm): Pass [NSApp currentEvent] instead of _currentEvent.
(KWQKHTMLPart::urlSelected): Pass [NSApp currentEvent] instead of _currentEvent.
(KWQKHTMLPart::scrollToAnchor): Added. Contains the code from the anchor case inside
KHTMLPart::openURL.
* kwq/WebCoreBridge.h: Added scrollToAnchorWithURL:.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]): Change around so that we
don't do a bunch of irrelevant stuff in the page cache case. I think we might just want to
make a separate method for the page cache case.
(-[WebCoreBridge scrollToAnchorWithURL:]): Added.
(-[WebCoreBridge mouseUp:]): Simplify check for nil view. Remove calls to setCurrentEvent.
(-[WebCoreBridge mouseDown:]): Simplify check for nil view. Fix event type constants for
right mouse button and other mouse button.
(-[WebCoreBridge mouseMoved:]): Simplify check for nil view.
(-[WebCoreBridge mouseDragged:]): Simplify check for nil view.
2002-12-04 Richard Williamson <rjw@apple.com>
Cache the NSFont in QFont after doing family based lookup.
Use that cached font to find a text renderer.
Reviewed by: Darin
* kwq/KWQFont.h:
* kwq/KWQFont.mm:
(QFont::QFont):
(QFont::~QFont):
(QFont::setFamily):
(QFont::setFirstFamily):
(QFont::setPixelSize):
(QFont::setWeight):
(QFont::setItalic):
(QFont::getNSFont):
* kwq/KWQFontMetrics.mm:
* kwq/KWQPainter.mm:
(QPainter::_updateRenderer):
* kwq/WebCoreTextRendererFactory.h:
* kwq/WebCoreTextRendererFactory.m:
(-[WebCoreTextRendererFactory rendererWithFont:]):
2002-12-04 Richard Williamson <rjw@apple.com>
Cache the last used text renderer to avoid expensive lookup
when font hasn't changed.
Reviewed by: maciej
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::_updateRenderer):
(QPainter::drawText):
(QPainter::drawUnderlineForText):
== Rolled over to ChangeLog-2002-12-03 ==