Closed Bug 196805 Opened 23 years ago Closed 2 years ago

Remove GFX nsITheme dependencies on content and layout

Categories

(Core Graveyard :: GFX, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bryner, Unassigned)

References

Details

Currently, nsITheme implementations on all platforms have dependencies on content and layout. This isn't a clean separation - gfx should only contain low-level drawing code. I see 2 ways we could fix this up: - Move the entire nsITheme implementation into layout, with platform-specific source files. This would involve adding an additional API on nsIRenderingContext or nsIDrawingSurface to get the "native" drawing surface (the HDC on win32, the CGrafPtr on Mac, or the GdkWindow on unix). - Split up the nsITheme implementation such that the part of it that needs to inspect the frame and the element attributes lives in layout, and fills in a generic struct containing, for example, the disabled, hover, and focus state. Then have the platform-specific code in gfx which gets handed this struct, instead of the frame.
There's also the problem that nsITheme needs to know whether the node is styled by author/user sheets or not. If it is, we need to drop theming altogether... At the moment this is done by hardcoding knowledge of the values in forms.css and comparing the computed values to those. We may want a better method....
Is there a way we can ask the style system what the value in forms.css is?
Alec might have some comments here.
Brian, not at the moment. It would basically require recomputing style for the node and all its ancestors without including user and author stylesheets in the current arch, as far as I can tell.
Assignee: bryner → general
Product: Core → Core Graveyard
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.