mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 966591 - Part 1: Put very basic hit region interface in + add runtime flag. r=roc
This commit is contained in:
parent
9eb3dbf7f6
commit
5cad2c4200
@ -2355,6 +2355,13 @@ CanvasRenderingContext2D::MeasureText(const nsAString& rawText,
|
||||
return new TextMetrics(width);
|
||||
}
|
||||
|
||||
void CanvasRenderingContext2D::AddHitRegion(const HitRegionOptions& )
|
||||
{}
|
||||
|
||||
void CanvasRenderingContext2D::RemoveHitRegion(const nsAString&)
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
* Used for nsBidiPresUtils::ProcessText
|
||||
*/
|
||||
|
@ -186,6 +186,9 @@ public:
|
||||
TextMetrics*
|
||||
MeasureText(const nsAString& rawText, mozilla::ErrorResult& error);
|
||||
|
||||
void AddHitRegion(const HitRegionOptions& options);
|
||||
void RemoveHitRegion(const nsAString& id);
|
||||
|
||||
void DrawImage(const HTMLImageOrCanvasOrVideoElement& image,
|
||||
double dx, double dy, mozilla::ErrorResult& error)
|
||||
{
|
||||
|
@ -11,8 +11,6 @@
|
||||
* and create derivative works of this document.
|
||||
*/
|
||||
|
||||
interface HitRegionOptions;
|
||||
|
||||
enum CanvasWindingRule { "nonzero", "evenodd" };
|
||||
|
||||
dictionary ContextAttributes2D {
|
||||
@ -20,6 +18,11 @@ dictionary ContextAttributes2D {
|
||||
boolean willReadFrequently = false;
|
||||
};
|
||||
|
||||
dictionary HitRegionOptions {
|
||||
DOMString id = "";
|
||||
Element? control = null;
|
||||
};
|
||||
|
||||
interface CanvasRenderingContext2D {
|
||||
|
||||
// back-reference to the canvas. Might be null if we're not
|
||||
@ -113,7 +116,8 @@ interface CanvasRenderingContext2D {
|
||||
void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
|
||||
|
||||
// hit regions
|
||||
// NOT IMPLEMENTED void addHitRegion(HitRegionOptions options);
|
||||
[Pref="canvas.hitregions.enabled"] void addHitRegion(optional HitRegionOptions options);
|
||||
[Pref="canvas.hitregions.enabled"] void removeHitRegion(DOMString id);
|
||||
|
||||
// pixel manipulation
|
||||
[NewObject, Throws]
|
||||
|
@ -432,6 +432,7 @@ pref("accessibility.tabfocus_applies_to_xul", true);
|
||||
// provide ability to turn on support for canvas focus rings
|
||||
pref("canvas.focusring.enabled", false);
|
||||
pref("canvas.customfocusring.enabled", false);
|
||||
pref("canvas.hitregions.enabled", false);
|
||||
|
||||
// We want the ability to forcibly disable platform a11y, because
|
||||
// some non-a11y-related components attempt to bring it up. See bug
|
||||
|
Loading…
Reference in New Issue
Block a user