If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[regression] background color no longer propogates to embedded webshell

VERIFIED DUPLICATE of bug 17303

Status

()

Core
Layout: Form Controls
P3
normal
VERIFIED DUPLICATE of bug 17303
18 years ago
17 years ago

People

(Reporter: buster, Assigned: Pierre Saslawsky)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
Peter had put in code that propogated the background color from a text control
to its embedded webshell.  This used to work, and at some point it has stopped
working.  The code on the html form control side is here:

http://lxr.mozilla.org/seamonkey/source/layout/html/forms/src/nsGfxTextControlFr
ame.cpp#2595

  /* set all style that propogates from the text control to its content
   * into the presContext for the webshell.
   * what I would prefer to do is hand the webshell my own
   * pres context at creation, rather than having it create its own.
   */

  nsFont font(presContext->GetDefaultFixedFontDeprecated());
  GetFont(presContext, font);
  const nsStyleFont* controlFont;
  GetStyleData(eStyleStruct_Font,  (const nsStyleStruct *&)controlFont);
  presContext->SetDefaultFont(font);
  presContext->SetDefaultFixedFont(font);

  const nsStyleColor* controlColor;
  GetStyleData(eStyleStruct_Color,  (const nsStyleStruct *&)controlColor);
  presContext->SetDefaultColor(controlColor->mColor);
  presContext->SetDefaultBackgroundColor(controlColor->mBackgroundColor);
  presContext->SetDefaultBackgroundImageRepeat(controlColor->mBackgroundRepeat);

  presContext->SetDefaultBackgroundImageAttachment
    (controlColor->mBackgroundAttachment);

  presContext->SetDefaultBackgroundImageOffset
    (controlColor->mBackgroundXPosition, controlColor->mBackgroundYPosition);
  presContext->SetDefaultBackgroundImage(controlColor->mBackgroundImage);

  /* HACK:
   * since I don't yet have a hook for setting info on the pres context before
style is
   * resolved, I need to call remap style on the root frame's style context.
   * The above code for setting presContext data should happen on a presContext
that
   * I create and pass into the webshell, rather than having the webshell create
its own
   */
  nsCOMPtr<nsIStyleContext> sc;
  result = frame->GetStyleContext(getter_AddRefs(sc));
  if (NS_FAILED(result)) { return result; }
  if (nsnull==sc) { return NS_ERROR_NULL_POINTER; }
  sc->RemapStyle(presContext);
  // end HACK
(Assignee)

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Depends on: 17303
Resolution: --- → DUPLICATE
Target Milestone: M19
(Assignee)

Comment 1

18 years ago
It's yet another dup of 19341 and 17303: fonts and background colors are ignored
in text edit fields because a hard-coded style rule is applied to the body
element. See PlaintextInitalStyle in nsTextEditRules.cpp.


*** This bug has been marked as a duplicate of 17303 ***
(Assignee)

Comment 2

18 years ago
To verify this, go to an attachment I made for another bug:
http://bugzilla.mozilla.org/showattachment.cgi?attach_id=6784

You can see that text edit fields can have a background of a different color now.
(Assignee)

Comment 3

18 years ago
A related problem was described in bug 33557

Comment 4

18 years ago
VERIFY dupe
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.