[Mono-dev] improved patch for ApplyTheme

Andrew Skiba andrews at mainsoft.com
Sun May 21 10:12:25 EDT 2006


Hello, Chris.

Sorry for the late answer. Please look at the test in
sys.web/Tests/standalone/themes/PageLinks. On dotnet it outputs 

child.set_ImageUrl
child.OnInit
parent.set_ImageUrl
parent.OnInit
page.OnInit

The property setters set_ImageUrl are called when the theme is applied.

This is the output of unpatched sys.web:

page.OnInit
child.OnInit
parent.OnInit

In addition to the incorrect flow, this test shows the invalid behaviour
(missing image). After applying the patch, both the flow and the image
are fixed.

Here is how the flow changed. Was:

1. InitializeTheme + ApplyThemeRecursive (incorrect recursion, should be
in the same depth-first search as OnInit)
2. Init Recursive
3. ApplyMasterPage

As result, 'ApplyThemeRecursive' did not affect any controls related to
the master page feature. 

After the fix the flow became:

1. Initialize Theme
2. ApplyMasterPage
3. InitRecursive + ApplyTheme

As a result, when the theme is applied, all the controls are already
created.

When I started to trace the order of set_ImageUrl, I found a mistake in
my previous patch: first child.OnInit should be called, and only then
ApplyTheme. Anyway, it's easy to see that on dotnet ApplyTheme (however
it's named) is called during the same tree travel as OnInit.

If no one objects I will commit.

Andrew.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ApplyTheme.patch
Type: application/octet-stream
Size: 2026 bytes
Desc: ApplyTheme.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060521/39ee0591/attachment.obj 


More information about the Mono-devel-list mailing list