Bug 8091 - Changes made to DOM styles via Obj-C not immediately visible
Summary: Changes made to DOM styles via Obj-C not immediately visible
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2006-03-30 14:06 PST by Jim Correia
Modified: 2022-08-10 10:33 PDT (History)
5 users (show)

See Also:


Attachments
Example app (36.17 KB, application/octet-stream)
2006-03-30 14:06 PST, Jim Correia
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Correia 2006-03-30 14:06:25 PST
see also rdar://4496964

Programatically change DOM styles via the Objective-C interface doesn't automatically update the display in the WebView.

Consider the attached example.

Build and run.
Click the Change DOM button.

The changes are not immediately visible. Mousing over the web view makes the change visible.

Sending the webview a -setNeedsDisplay:YES or sending -setNeedsToApplyStyles:YES to the document view doesn't work around the problem either.

The code which manipulates the DOM looks like this:

	DOMDocument *document = [[webView mainFrame] DOMDocument];
    DOMElement *element = [document getElementById: @"foo"];
    DOMCSSStyleDeclaration *style = [element style];
    [style setBackground :@"red"];
Comment 1 Jim Correia 2006-03-30 14:06:57 PST
Created attachment 7405 [details]
Example app
Comment 2 Joost de Valk (AlthA) 2006-07-09 13:34:51 PDT
Confirming the behavior, though i don't know for sure if this is wrong :)
Comment 3 Timothy Hatcher 2007-02-22 14:18:03 PST
This still happens. Using setValue:forKey: is a workaround, because that causes the change to happen in the JavaScript binding (which always does an update layout and paints if needed). It seems we should do something similar on the ObjC binding side, or make WebCore smarter about when to update automatically.
Comment 4 Ahmad Saleem 2022-08-10 09:25:14 PDT
rniwa@webkit.org - Is this need anymore? Thanks!
Comment 5 Ryosuke Niwa 2022-08-10 10:33:47 PDT
We're not improving legacy webkit API at this point.